-
-
Notifications
You must be signed in to change notification settings - Fork 5
226 lines (195 loc) · 6.6 KB
/
buildArtifacts.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
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
name: Build Artifacts
on:
push:
branches: [ "develop", "main" ]
pull_request:
branches: [ "develop", "main" ]
workflow_call:
env:
ninja-version: '1.11.1'
clang-version: '18.1.8'
sha-length: 7
jobs:
prepare-package:
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
compiler: [MSVC, Clang]
include:
- os: windows-latest
compiler: MSVC
vcpkg_triplet: x64-windows
- os: windows-latest
compiler: Clang
vcpkg_triplet: x64-windows-llvm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: ${{env.ninja-version}}
- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
shell: cmd
run: .\bootstrap-vcpkg.bat
- name: Initialize MSVC Environment
if: matrix.compiler == 'MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{runner.arch}}
- name: Initialize Clang Compiler
if: matrix.compiler == 'Clang'
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{env.clang-version}}
directory: ${{runner.temp}}/llvm
- name: Export GitHub Actions Cache Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Packages
working-directory: ${{github.workspace}}/vcpkg
shell: pwsh
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=${{matrix.vcpkg_triplet}}
- name: Get Short SHA
if: ${{!cancelled()}}
uses: benjlevesque/[email protected]
id: short-sha
with:
length: ${{env.sha-length}}
- name: Archive vcpkg Logs
if: ${{!cancelled()}}
uses: actions/upload-artifact@v4
with:
name: vcpkglogs-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{steps.short-sha.outputs.sha}}
path: |
vcpkg/buildtrees/*/*.log
retention-days: 7
compression-level: 9
build:
runs-on: ${{matrix.os}}
needs: [prepare-package]
strategy:
fail-fast: false
matrix:
os: [windows-latest]
build_type: [Debug, Release]
compiler: [MSVC, Clang]
include:
- os: windows-latest
compiler: MSVC
vcpkg_triplet: x64-windows
- os: windows-latest
compiler: Clang
vcpkg_triplet: x64-windows-llvm
- os: windows-latest
build_type: Debug
compiler: MSVC
cmake_config: 'Ninja Debug x64'
build_path: 'ninja-debug-x64'
- os: windows-latest
build_type: Release
compiler: MSVC
cmake_config: 'Ninja Release x64'
build_path: 'ninja-release-x64'
- os: windows-latest
build_type: Debug
compiler: Clang
cmake_config: 'Ninja Debug Win64 LLVM'
build_path: 'ninja-debug-win64-llvm'
- os: windows-latest
build_type: Release
compiler: Clang
cmake_config: 'Ninja Release Win64 LLVM'
build_path: 'ninja-release-win64-llvm'
permissions:
id-token: write
contents: read
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
with:
version: ${{env.ninja-version}}
- name: Install vcpkg Windows
if: runner.os == 'Windows'
working-directory: ${{github.workspace}}/vcpkg
shell: cmd
run: .\bootstrap-vcpkg.bat
- name: Initialize MSVC Environment
if: matrix.compiler == 'MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{runner.arch}}
- name: Initialize Clang Compiler
if: matrix.compiler == 'Clang'
uses: KyleMayes/install-llvm-action@v2
with:
version: ${{env.clang-version}}
directory: ${{runner.temp}}/llvm
- name: Export GitHub Actions Cache Environment Variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Packages
working-directory: ${{github.workspace}}/vcpkg
shell: pwsh
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
run: vcpkg install --x-manifest-root=../scripts/vcpkg-manifest --x-install-root=./installed --triplet=${{matrix.vcpkg_triplet}}
- name: Configure CMake
working-directory: ${{github.workspace}}
shell: pwsh
run: cmake --preset "${{matrix.cmake_config}}"
- name: Build
working-directory: ${{github.workspace}}
shell: pwsh
run: cmake --build "build/${{matrix.build_path}}" --target VocalShaper
- name: Pre Packing
working-directory: ${{github.workspace}}
shell: pwsh
run: ./scripts/ci/prePacking.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin"
- name: Find Binary Files
id: find-binary
working-directory: ${{github.workspace}}
shell: pwsh
run: |
$result = (./scripts/ci/findBinary.ps1 -DirectoryPath "./build/${{matrix.build_path}}/bin") | Out-String
$outputString = "exec_files=$result"
$outputString | Out-File -FilePath $env:GITHUB_OUTPUT -Append
Write-Host "Found executable and dynamic library files: $result"
- name: Generate Artifact Attestation
if: github.event_name != 'pull_request'
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{steps.find-binary.outputs.exec_files}}'
- name: Get Short SHA
uses: benjlevesque/[email protected]
id: short-sha
with:
length: ${{env.sha-length}}
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: VocalShaper-${{runner.os}}-${{runner.arch}}-${{matrix.compiler}}-${{matrix.build_type}}-${{steps.short-sha.outputs.sha}}
path: |
build/${{matrix.build_path}}/bin/**
compression-level: 9