-
Notifications
You must be signed in to change notification settings - Fork 10
272 lines (231 loc) Β· 9.49 KB
/
Copy pathrelease.yml
File metadata and controls
272 lines (231 loc) Β· 9.49 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
ο»Ώ# Copyright (c) 2023 Carsten Rudolph
name: Publish Release
on:
workflow_dispatch:
inputs:
major:
description: 'Major Version'
required: true
minor:
description: 'Minor Version'
required: true
build:
description: 'Build Number'
required: true
releaseLog:
description: 'Location of the Release Log file.'
required: true
jobs:
# ------------------------------------- Toolchain setup -------------------------------------
setup:
name: run-setup
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
name: [ windows-latest ]
include:
- name: windows-latest
os: windows-latest
#- name: ubuntu-latest
# os: ubuntu-latest
env:
MESA_3D_VERSION: ${{ vars.MESA_3D_VERSION }}
VULKAN_SDK_VERSION: ${{ vars.VULKAN_SDK_VERSION }}
CACHE_KEY: windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
steps:
- name: Setup dependency directory
run: echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
- name: Lookup dependency cache (no restore use)
id: cache
uses: actions/cache/restore@v6
with:
path: ${{ env.DEPENDENCY_DIR }}
key: ${{ env.CACHE_KEY }}
lookup-only: true
- name: Ensure cache exists
if: steps.cache.outputs.cache-hit != 'true'
run: |
echo "Cache is missing. Please run 'update_dependencies.yml' workflow first."
exit 1
# ------------------------------------- Build job -------------------------------------
build:
name: Build ${{ matrix.profile }}
needs: [ setup ]
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
profile: [ windows-msvc-x64, windows-msvc-x86, windows-clang-x64 ]
include:
- profile: windows-msvc-x64
triplet: x64-windows
compiler: msvc
architecture: x64
artifact: win_x64_msvc
- profile: windows-msvc-x86
triplet: x86-windows
compiler: msvc
architecture: x86
artifact: win_x86_msvc
- profile: windows-clang-x64
triplet: x64-windows
compiler: clang
architecture: x64
artifact: win_x64_clang
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}-rel
VCPKG_FEATURE_FLAGS: 'manifests'
MESA_3D_VERSION: ${{ vars.MESA_3D_VERSION }}
VULKAN_SDK_VERSION: ${{ vars.VULKAN_SDK_VERSION }}
LLVM_VERSION: ${{ vars.LLVM_VERSION }}
CACHE_KEY: windows-dependencies-mesa-${{ vars.MESA_3D_VERSION }}-vulkan-${{ vars.VULKAN_SDK_VERSION }}
steps:
- name: Setup dependency directory
run: echo "DEPENDENCY_DIR=$env:RUNNER_TEMP/dep/win" >> $env:GITHUB_ENV
- name: Restore dependency cache
uses: actions/cache/restore@v6
with:
path: ${{ env.DEPENDENCY_DIR }}
key: ${{ env.CACHE_KEY }}
- name: Setup build environment
id: setup-environment
run: |
cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x64\vulkan-1.dll" "C:\Windows\System32\vulkan-1.dll"
cp "${{ env.DEPENDENCY_DIR }}/vulkan/${{ env.VULKAN_SDK_VERSION }}\runtime\x86\vulkan-1.dll" "C:\Windows\SysWOW64\vulkan-1.dll"
- name: Update LLVM
if: ${{ matrix.compiler == 'clang' }}
uses: KyleMayes/install-llvm-action@v2.0.9
with:
version: ${{ env.LLVM_VERSION }}
- name: Checking out sources
uses: actions/checkout@master
with:
submodules: true
- name: Update version
working-directory: "${{ github.workspace }}"
shell: powershell
run: ".\\write-version.ps1 -major ${{ github.event.inputs.major }} -minor ${{ github.event.inputs.minor }} -build ${{ github.event.inputs.build }}"
- name: Retrieve latest CMake build
uses: lukka/get-cmake@latest
- name: Restore or build vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/src/Modules/vcpkg'
vcpkgJsonGlob: '**/src/vcpkg.json'
- name: Build with CMake and Ninja (Release)
id: build-with-cmake-release
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/src/CMakeLists.txt'
configurePreset: '${{ matrix.profile }}-release'
buildPreset: '${{ matrix.profile }}-release'
- name: Install with CMake (Release)
run: |
Set-Location '${{ github.workspace }}/out/build/${{ matrix.profile }}-release'
cmake --install .
#- name: Sign binaries
# uses: dlemstra/code-sign-action@v1
# with:
# certificate: '${{ secrets.SIGN_CERTIFICATE_BASE64 }}'
# password: '${{ secrets.SIGN_CERTIFICATE_PASSWORD }}'
# folder: '${{ github.workspace }}/out/install/'
# recursive: true
- name: Upload install artifacts
uses: actions/upload-artifact@v4
with:
name: LiteFX_${{ matrix.artifact }}
path: '${{ github.workspace }}/out/install/${{ matrix.profile }}-release'
if-no-files-found: error
publish:
name: 'Publish'
needs: build
runs-on: ubuntu-latest
steps:
- name: Download windows-msvc-x64 artifacts...
uses: actions/download-artifact@v4
with:
name: LiteFX_win_x64_msvc
path: ${{ github.workspace }}/../.artifacts/msvc/x64/
- name: Download windows-msvc-x86 artifacts...
uses: actions/download-artifact@v4
with:
name: LiteFX_win_x86_msvc
path: ${{ github.workspace }}/../.artifacts/msvc/x86/
- name: Download windows-clang-x64 artifacts...
uses: actions/download-artifact@v4
with:
name: LiteFX_win_x64_clang
path: ${{ github.workspace }}/../.artifacts/clang/x64/
- run: |
ls -R ${{ github.workspace }}/../.artifacts/
- name: Installing zip
uses: montudor/action-zip@v1
- run: zip -r ${{ github.workspace }}/../windows-x64-msvc.zip .
working-directory: ${{ github.workspace }}/../.artifacts/msvc/x64/
- run: zip -r ${{ github.workspace }}/../windows-x86-msvc.zip .
working-directory: ${{ github.workspace }}/../.artifacts/msvc/x86/
- run: zip -r ${{ github.workspace }}/../windows-x64-clang.zip .
working-directory: ${{ github.workspace }}/../.artifacts/clang/x64/
- run: |
ls ${{ github.workspace }}/../*.zip
# For debug purposes
- uses: actions/upload-artifact@v4
with:
name: windows-x64-msvc.zip
path: ${{ github.workspace }}/windows-x64-msvc.zip
- uses: actions/upload-artifact@v4
with:
name: windows-x86-msvc.zip
path: ${{ github.workspace }}/windows-x86-msvc.zip
- uses: actions/upload-artifact@v4
with:
name: windows-x64-clang.zip
path: ${{ github.workspace }}/windows-x64-clang.zip
- run: |
ls ${{ github.workspace }}/../*.zip
# Build documentation.
- name: Checking out sources
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.RELEASE_BOT_PAT }}
- name: Update version
working-directory: ${{ github.workspace }}
run: |
#sudo apt-get update
#sudo apt-get install -y wget apt-transport-https software-properties-common
#wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
#sudo dpkg -i packages-microsoft-prod.deb
#sudo apt-get update
#sudo apt-get install -y powershell
pwsh -File .\\write-version.ps1 -major ${{ github.event.inputs.major }} -minor ${{ github.event.inputs.minor }} -build ${{ github.event.inputs.build }}
- name: Build documentation
uses: mattnotmitt/doxygen-action@v1
with:
working-directory: .
doxyfile-path: ./.doxyfile
- run: |
ls ${{ github.workspace }}/../*.zip
- name: Collect changes and push commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: Release Bot π€
commit_user_email: 18394207+github-actions[bot]@users.noreply.github.com
commit_message: Release ${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.build }} π
status_options: --untracked-files=all
add_options: --ignore-removal
#push_options: --force
skip_dirty_check: true
skip_fetch: true
disable_globbing: true
tagging_message: 'v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.build }}'
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.workspace }}/../*.zip
token: ${{ secrets.RELEASE_BOT_PAT }}
bodyFile: "${{ github.workspace }}/${{ github.event.inputs.releaseLog }}"
name: "v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.build }}"
tag: "v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.build }}"