-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (117 loc) · 4.33 KB
/
build_one.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build one package
on:
workflow_call:
inputs:
conanfile:
required: true
type: string
package_version:
required: true
type: string
upload_to_artifactory:
required: true
type: boolean
build_dependencies_from_source:
required: true
type: boolean
platform_include_patterns:
required: false
type: string
platform_exclude_patterns:
required: false
type: string
secrets:
ARTIFACTORY:
required: true
workflow_dispatch:
inputs:
conanfile:
description: Conanfile to build
type: string
package_version:
description: The version of the package to build
type: string
upload_to_artifactory:
description: Upload built packages to artifactory
type: boolean
default: false
build_dependencies_from_source:
description: Build all dependencies from source (conan install --build=* instead of --build=missing)
type: boolean
default: false
platform_include_patterns:
description: Include patterns for platforms
type: string
platform_exclude_patterns:
description: Exclude patterns for platforms
type: string
run-name: Build ${{ inputs.conanfile }} version ${{ inputs.package_version }}
jobs:
generate-matrix:
runs-on: ubuntu-24.04
outputs:
configs: ${{ steps.list-build-matrix.outputs.configs }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies
run: python -m pip install --upgrade pip conan semver
- name: conan config
run: conan config install .github/config/ubuntu-24.04/conan
- name: list build matrix
id: list-build-matrix
run: python scripts/list_build_matrix.py
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
GITHUB_INPUT: ${{ toJson(inputs) }}
build:
if: ${{ needs.generate-matrix.outputs.configs != '[]' && needs.generate-matrix.outputs.configs != '' }}
name : ${{ matrix.config.host_profile }}
needs:
- generate-matrix
runs-on: ${{ matrix.config.build_machine }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.generate-matrix.outputs.configs) }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies and setuptools (required to build GLib)
run: python -m pip install --upgrade pip conan setuptools
- name: install NDK
if: startsWith(matrix.config.host_profile, 'android')
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ matrix.config.ndk_version }}"
- name: conan remote
run: conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan config
run: conan config install .github/config/${{ matrix.config.build_machine }}/conan
- name: Parse build from source option
id: build_from_source
shell: bash
run: |
if [ ${{ inputs.build_dependencies_from_source }} == true ]; then
echo argument=--build=* | tee $GITHUB_OUTPUT
else
echo argument=--build=missing | tee $GITHUB_OUTPUT
fi
- name: Conan export all packages
run: python scripts/conan_export_all_packages.py
- name: conan install
run: conan install ${{ inputs.conanfile }} --version ${{ inputs.package_version }} --profile:host ${{ matrix.config.host_profile }} --profile:build default ${{ steps.build_from_source.outputs.argument }}
- name: conan create
run: conan create ${{ inputs.conanfile }} --version ${{ inputs.package_version }} --profile:host ${{ matrix.config.host_profile }} --profile:build default
- name: conan login
if: ${{ inputs.upload_to_artifactory }}
run: conan remote login odr admin --password '${{ secrets.ARTIFACTORY }}'
- name: conan upload
if: ${{ inputs.upload_to_artifactory }}
run: conan upload "*" --check --confirm --remote odr