forked from MeshInspector/MeshLib
-
Notifications
You must be signed in to change notification settings - Fork 0
242 lines (223 loc) · 12.5 KB
/
Copy pathconfig.yml
File metadata and controls
242 lines (223 loc) · 12.5 KB
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: Configuration
on:
workflow_call:
outputs:
# manually defined values
vs19_vcpkg_version:
description: "vs19 vcpkg version"
value: "2024.10.21" # fixed version - refer 'vcpkg-auto-update.yml' for more info
vs22_vcpkg_version:
description: "vs22 vcpkg version"
value: "2025.04.09" # VCPKG-AUTO-UPDATE - refer 'vcpkg-auto-update.yml' for more info
# automatically computed or tag-based values
app_version:
description: "Version without namespace: v1.2.3.4"
value: ${{ jobs.prepare-config.outputs.app_version }}
full_config_build:
description:
value: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || jobs.prepare-config.outputs.tag-full-ci == 'true' }}
docker_image_tag:
description:
value: ${{ jobs.prepare-config.outputs.docker-image-tag }}
internal_build:
description:
value: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
need_linux_image_rebuild:
description:
value: ${{ jobs.prepare-config.outputs.linux-changes == 'true' && github.event_name != 'schedule' && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
need_linux_vcpkg_rebuild:
description:
value: ${{ jobs.prepare-config.outputs.linux-vcpkg-changes == 'true' && github.event_name != 'schedule' && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
need_windows_vcpkg_rebuild:
description:
value: ${{ ( jobs.prepare-config.outputs.windows-changes == 'true' || jobs.prepare-config.outputs.tag-bump-vcpkg == 'true' ) && jobs.prepare-config.outputs.tag-skip-image-rebuild != 'true' }}
release_tag:
description: "Version with namespace (if it exists): v1.2.3.4-namespace"
value: ${{ jobs.prepare-config.outputs.release_tag }}
ubuntu_x64_config_matrix:
description: "Config matrix for Ubuntu x64 builds"
value: ${{ jobs.prepare-config.outputs.ubuntu_x64_config_matrix }}
windows_x64_config_matrix:
description: "Config matrix for Windows builds"
value: ${{ jobs.prepare-config.outputs.windows_x64_config_matrix }}
update_doc:
description:
value: ${{ jobs.prepare-config.outputs.tag-update-doc == 'true' || jobs.prepare-config.outputs.tag-update-doc-only == 'true' }}
upload_artifacts:
description:
value: ${{ github.event_name == 'push' || github.event_name == 'schedule' || jobs.prepare-config.outputs.tag-full-ci == 'true' || jobs.prepare-config.outputs.tag-upload-binaries == 'true' }}
upload_test_artifacts:
description:
value: ${{ jobs.prepare-config.outputs.tag-upload-test-artifacts == 'true' }}
vcpkg_docker_image_tag:
description:
value: ${{ jobs.prepare-config.outputs.vcpkg-docker-image-tag }}
run_unity_nuget_test:
description: "expression to run unity-nuget-test.yml"
value: ${{ github.event_name == 'schedule' || jobs.prepare-config.outputs.tag-full-ci == 'true' }}
test_pip_build:
description:
value: ${{ jobs.prepare-config.outputs.tag-test-pip-build == 'true' }}
# flags for disabling builds for different systems
build_enable_ubuntu_arm64:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-disable-ubuntu-arm64 == 'true' ) }}
build_enable_ubuntu_x64:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-update-doc-only == 'true' || jobs.prepare-config.outputs.tag-disable-ubuntu-x64 == 'true' ) }}
build_enable_linux_vcpkg:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-update-doc-only == 'true' || jobs.prepare-config.outputs.tag-disable-linux-vcpkg == 'true' ) }}
build_enable_windows:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-update-doc-only == 'true' || jobs.prepare-config.outputs.tag-disable-windows == 'true' ) }}
build_enable_macos:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-update-doc-only == 'true' || jobs.prepare-config.outputs.tag-disable-macos == 'true' ) }}
build_enable_emscripten:
description:
value: ${{ !( jobs.prepare-config.outputs.tag-update-doc-only == 'true' || jobs.prepare-config.outputs.tag-disable-emscripten == 'true' ) }}
jobs:
prepare-config:
outputs:
app_version: ${{ steps.version-tag.outputs.app_version }}
docker-image-tag: ${{ steps.select-docker-image-tag.outputs.image_tag }}
release_tag: ${{ steps.version-tag.outputs.release_tag }}
linux-changes: ${{ steps.linux-changes.outputs.src }}
linux-vcpkg-changes: ${{ steps.linux-vcpkg-changes.outputs.src }}
ubuntu_x64_config_matrix: ${{ steps.set-ubuntu-x64-matrix.outputs.matrix }}
windows_x64_config_matrix: ${{ steps.set-windows-x64-matrix.outputs.matrix }}
vcpkg-docker-image-tag: ${{ steps.select-vcpkg-docker-image-tag.outputs.image_tag }}
windows-changes: ${{ steps.windows-changes.outputs.src }}
# please list the required tags here
tag-bump-vcpkg: ${{ contains( github.event.pull_request.labels.*.name, 'bump-vcpkg' ) }}
tag-full-ci: ${{ contains( github.event.pull_request.labels.*.name, 'full-ci' ) }}
tag-skip-image-rebuild: ${{ contains( github.event.pull_request.labels.*.name, 'skip-image-rebuild' ) }}
tag-update-doc: ${{ contains( github.event.pull_request.labels.*.name, 'update-doc' ) }}
tag-update-doc-only: ${{ contains( github.event.pull_request.labels.*.name, 'update-doc-only' ) }}
tag-upload-binaries: ${{ contains( github.event.pull_request.labels.*.name, 'upload-binaries' ) }}
tag-upload-test-artifacts: ${{ contains( github.event.pull_request.labels.*.name, 'upload-test-artifacts' ) }}
tag-test-pip-build: ${{ contains( github.event.pull_request.labels.*.name, 'test-pip-build' ) }}
# tags for disabling builds for different systems
tag-build-release-windows: ${{ contains( github.event.pull_request.labels.*.name, 'build-release-windows' ) }}
tag-disable-windows: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-windows' ) }}
tag-disable-ubuntu-x64: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-ubuntu-x64' ) }}
tag-disable-ubuntu-arm64: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-ubuntu-arm64' ) }}
tag-disable-linux-vcpkg: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-linux-vcpkg' ) }}
tag-disable-macos: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-macos' ) }}
tag-disable-emscripten: ${{ contains( github.event.pull_request.labels.*.name, 'disable-build-emscripten' ) }}
runs-on: aws-micro
env:
# duplicate output values here since they cannot be accessed from steps
full_config_build: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains( github.event.pull_request.labels.*.name, 'full-ci' ) }}
upload_artifacts: ${{ github.event_name == 'push' || github.event_name == 'schedule' || contains( github.event.pull_request.labels.*.name, 'full-ci' ) || contains( github.event.pull_request.labels.*.name, 'upload-binaries' ) }}
version_namespace: ${{ ( contains( github.event.pull_request.labels.*.name, 'full-ci' ) || contains( github.event.pull_request.labels.*.name, 'upload-binaries' ) ) && github.event_name != 'push' && 'pr-test' || '' }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: true
# install helper utility for Python version management
- name: Install uv
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6
- name: Check for errors
run: uvx --python 3.12 pre-commit run --all-files --hook-stage manual
- name: Filter Linux paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: linux-changes
with:
filters: |
src:
- 'docker/(ubuntu20|ubuntu22|ubuntu24|emscripten)Dockerfile'
- 'requirements/(ubuntu|distribution_python).txt'
- 'scripts/build_thirdparty.sh'
- 'scripts/install_apt_requirements.sh'
- 'scripts/mrbind/install_deps_ubuntu.sh'
- 'thirdparty/!(install.bat|vcpkg/**)'
- name: Filter Linux vcpkg paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: linux-vcpkg-changes
with:
filters: |
src:
- 'docker/(rockylinux8|rockylinux9)-vcpkgDockerfile'
- 'requirements/vcpkg-linux.txt'
- 'thirdparty/vcpkg/**'
- name: Filter Windows paths
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: windows-changes
with:
filters: |
src:
- 'requirements/windows.txt'
- 'thirdparty/vcpkg/**'
- 'thirdparty/install.bat'
# if nothing to rebuild: "latest"
# else: $branch-name | sed -r 's/[^a-zA-Z0-9._-]+/-/
# example: fix/mesh -> fix-mesh
- name: Select Docker image tag
id: select-docker-image-tag
run: |
if [[ ${{ steps.linux-changes.outputs.src }} == 'true' ]] && [[ ${{ github.event_name }} != 'push' && ${{ github.event_name }} != 'schedule' ]]; then
# https://stackoverflow.com/q/58033366/7325599
IMAGE_TAG=$(echo "${{ github.head_ref || github.ref_name }}" | sed -r 's/[^a-zA-Z0-9._-]+/-/g')
else
IMAGE_TAG="latest"
fi
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Select vcpkg Docker image tag
id: select-vcpkg-docker-image-tag
run: |
if [[ ${{ steps.linux-vcpkg-changes.outputs.src }} == 'true' ]] && [[ ${{ github.event_name }} != 'push' && ${{ github.event_name }} != 'schedule' ]]; then
# https://stackoverflow.com/q/58033366/7325599
IMAGE_TAG=$(echo "${{ github.head_ref || github.ref_name }}" | sed -r 's/[^a-zA-Z0-9._-]+/-/g')
else
IMAGE_TAG="latest"
fi
echo "image_tag=${IMAGE_TAG}" >> $GITHUB_OUTPUT
- name: Checkout full history
if: ${{ env.upload_artifacts == 'true' }}
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Versioning
if: ${{ env.upload_artifacts == 'true' }}
uses: paulhatch/semantic-version@a8f8f59fd7f0625188492e945240f12d7ad2dca3 # v5.4.0
id: version
with:
tag_prefix: "v"
version_format: "v${major}.${minor}.${patch}.${increment}"
bump_each_commit: false
search_commit_body: true
namespace: ${{ env.version_namespace }}
- name: Set version tag
id: version-tag
run: |
version=${{ steps.version.outputs.version }}
echo "release_tag=${version}" >> $GITHUB_OUTPUT
echo "app_version=${version%%-*}" >> $GITHUB_OUTPUT
- name: Set matrix for ubuntu-x64 builds
id: set-ubuntu-x64-matrix
run: |
if [[ "${{ env.full_config_build }}" == "true" ]]; then
echo "matrix=$(jq -c . < .github/workflows/matrix/ubuntu-x64-full-config.json)" >> $GITHUB_OUTPUT
else
echo "matrix=$(jq -c . < .github/workflows/matrix/ubuntu-x64-minimal-config.json)" >> $GITHUB_OUTPUT
fi
- name: Set matrix for windows-x64 builds
id: set-windows-x64-matrix
run: |
if [[ "${{ env.full_config_build }}" == "true" || github.event_name == 'schedule' ]]; then
MATRIX_FILE=".github/workflows/matrix/windows-full-config.json"
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'build-release-windows') }}" == "true" ]]; then
MATRIX_FILE=".github/workflows/matrix/windows-standard-config.json"
else
MATRIX_FILE=".github/workflows/matrix/windows-minimal-config.json"
fi
jq \
--arg vs19 "2024.10.21" \
--arg vs22 "2025.04.09" \
'(.include[] | select(.["vcpkg-version"]=="__VCPKG_VERSION_VS19__") | .["vcpkg-version"]) = $vs19
| (.include[] | select(.["vcpkg-version"]=="__VCPKG_VERSION_VS22__") | .["vcpkg-version"]) = $vs22' \
"$MATRIX_FILE" > tmp.json
echo "matrix=$(jq -c . tmp.json)" >> $GITHUB_OUTPUT