-
Notifications
You must be signed in to change notification settings - Fork 1
198 lines (184 loc) · 8.52 KB
/
build.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: build
on:
push:
schedule:
# Executed daily, 9:37 is randomly picked time, not 00:00,
# because 00:00 is used too frequently and GitHub asks to do cronjobs at less busy times
- cron: '37 9 * * *'
workflow_dispatch:
inputs:
package_name:
description: Package name
type: choice
options:
- all
- odrcore
- pdf2htmlex
- fontforge
- poppler
- poppler-data
- cairo
- openlibm
- fontconfig
- glib
- tmpfile
- libgsf
- libwmf
- wvware
package_version:
description: Package version. Specify 'newest' or leave empty to request the newest version. Specify 'all' to request all versions.
required: false
upload_to_artifactory:
description: Upload built packages to artifactory
type: boolean
default: false
build_dependents:
description: Parse conan dependency tree and build not just the requested package, but also all dependents of it
type: boolean
default: true
build_dependencies_from_source:
description: Build all dependencies from source (conan install --build=* instead of --build=missing)
type: boolean
default: false
run-name: build ${{ inputs.package_name }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
generate-matrices:
runs-on: ubuntu-22.04
outputs:
packages_0: ${{ steps.list-packages-with-dependents.outputs.packages_0 }}
packages_1: ${{ steps.list-packages-with-dependents.outputs.packages_1 }}
packages_2: ${{ steps.list-packages-with-dependents.outputs.packages_2 }}
packages_3: ${{ steps.list-packages-with-dependents.outputs.packages_3 }}
packages_4: ${{ steps.list-packages-with-dependents.outputs.packages_4 }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
# Fetch whole git history.
# Required to parse modified packages
fetch-depth: 0
- name: setup python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: install python dependencies
run: pip install --upgrade pip conan
- name: conan config
run: conan config install .github/config/ubuntu-22.04/conan
- name: Conan export all packages
run: python scripts/conan_export_all_packages.py
# Generate dependency graphs for all disjoint packages
# Dependency graphs for android-21 and android-23 profiles are not identical.
# android-21 has an extra openlibm dependency. Android ABI does not matter for dependency graph, as long as it's still Android.
# Generating graphs for both 21 and 23 would be more self-explanatory, but conan graph generation takes a few seconds.
- name: Generate odrcore dependency tree
id: odrcore-dependency-tree
if: ${{ github.event.inputs.build_dependents != 'false' }}
shell: bash # bash shell needed to pipefail on error
run: |
conan graph info recipes/odrcore/all/conanfile.py --version=4.1.0 --profile:host=android-21-armv8 --format=json | tee odrcore-dependency-tree.json
echo "graph_file=odrcore-dependency-tree.json" >> $GITHUB_OUTPUT
- name: Generate wvware dependency tree
id: wvware-dependency-tree
if: ${{ github.event.inputs.build_dependents != 'false' }}
shell: bash # bash shell needed to pipefail on error
run: |
conan graph info recipes/wvware/all/conanfile.py --version=1.2.9 --profile:host=android-21-armv8 --format=json | tee wvware-dependency-tree.json
echo "graph_file=wvware-dependency-tree.json" >> $GITHUB_OUTPUT
- name: Get requested packages and dependants from commits and workflow_dispatch inputs
id: list-packages-with-dependents
run: python scripts/list_package_versions.py --dependency-graph ${{ steps.odrcore-dependency-tree.outputs.graph_file }} ${{ steps.wvware-dependency-tree.outputs.graph_file }}
env:
GITHUB_EVENT: ${{ toJson(github.event) }}
build_0:
if: ${{ needs.generate-matrices.outputs.packages_0 != '[]' && needs.generate-matrices.outputs.packages_0 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_0) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_1:
if: ${{ needs.generate-matrices.outputs.packages_1 != '[]' && needs.generate-matrices.outputs.packages_1 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_0
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_1) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_2:
if: ${{ needs.generate-matrices.outputs.packages_2 != '[]' && needs.generate-matrices.outputs.packages_2 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_1
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_2) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_3:
if: ${{ needs.generate-matrices.outputs.packages_3 != '[]' && needs.generate-matrices.outputs.packages_3 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_2
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_3) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}
build_4:
if: ${{ needs.generate-matrices.outputs.packages_4 != '[]' && needs.generate-matrices.outputs.packages_4 != '' }}
name: ${{ matrix.package.package_reference }}
needs:
- generate-matrices
- build_3
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.generate-matrices.outputs.packages_4) }}
uses: ./.github/workflows/build_inner.yml
with:
conanfile: ${{ matrix.package.conanfile }}
package_version: ${{ matrix.package.version }}
build_dependencies_from_source: ${{ github.event.inputs.build_dependencies_from_source == 'true' }}
artifactory_upload: ${{ github.repository_owner == 'opendocument-app' && (github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_to_artifactory == 'true')) }}
secrets:
ARTIFACTORY: ${{ secrets.ARTIFACTORY }}