forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
386 lines (369 loc) · 13.3 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
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
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
name: Build Audacity
on:
push:
paths-ignore: ["au4/**", "**/**.md", "**/**.dox2", "**/**.dox", "**/**.dox.in", "**/LICENSE.txt", "/.github/ISSUE_TEMPLATE/**", "INSTALL", "CHANGELOG.txt", ".editorconfig", ".gitignore", ".gitattributes"]
pull_request:
paths-ignore: ["au4/**", "**/**.md", "**/**.dox2", "**/**.dox", "**/**.dox.in", "**/LICENSE.txt", "/.github/ISSUE_TEMPLATE/**", "INSTALL", "CHANGELOG.txt", ".editorconfig", ".gitignore", ".gitattributes"]
workflow_dispatch:
inputs:
build_level:
description: "Build level to be used. Valid values are: alpha, beta, release"
required: false
default: 'alpha'
type: string
build_type:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel'
required: false
default: RelWithDebInfo
type: string
configuration_types:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel or any combination separated with a semicolon'
required: false
default: RelWithDebInfo
type: string
configure_cmake_options:
description: 'Additional CMake options for configuration'
required: false
default: ''
type: string
workflow_call:
inputs:
build_level:
description: "Build level to be used. Valid values are: alpha, beta, release"
required: false
default: 'alpha'
type: string
build_type:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel'
required: false
default: RelWithDebInfo
type: string
configuration_types:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel or any combination separated with a semicolon'
required: false
default: RelWithDebInfo
type: string
configure_cmake_options:
description: 'Additional CMake options for configuration'
required: false
default: ''
type: string
secrets:
APPLE_CERTIFICATE:
required: false
APPLE_CERTIFICATE_PASSWORD:
required: false
APPLE_CODESIGN_IDENTITY:
required: false
APPLE_NOTARIZATION_USER_NAME:
required: false
APPLE_NOTARIZATION_PASSWORD:
required: false
APPLE_NOTARIZATION_TEAM_ID:
required: false
CRASH_REPORT_URL:
required: false
SENTRY_AUTH_TOKEN:
required: false
SENTRY_DSN_KEY:
required: false
SENTRY_HOST:
required: false
SENTRY_ORG_SLUG:
required: false
SENTRY_PROJECT:
required: false
SENTRY_PROJECT_SLUG:
required: false
WINDOWS_CERTIFICATE:
required: false
WINDOWS_CERTIFICATE_PASSWORD:
required: false
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN_KEY: ${{ secrets.SENTRY_DSN_KEY }}
SENTRY_HOST: ${{ secrets.SENTRY_HOST }}
SENTRY_ORG_SLUG: ${{ secrets.SENTRY_ORG_SLUG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_PROJECT_SLUG: ${{ secrets.SENTRY_PROJECT_SLUG }}
ARTIFACTORY_SYMBOLS_URL: ${{ secrets.ARTIFACTORY_SYMBOLS_URL }}
ARTIFACTORY_SYMBOLS_KEY: ${{ secrets.ARTIFACTORY_SYMBOLS_KEY }}
CONAN_BINARIES_REMOTE: ${{ secrets.CONAN_BINARIES_REMOTE }}
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_LOGIN_USERNAME }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASSWORD }}
BUILD_TYPE: ${{ (inputs && inputs.build_type) || (github.event.inputs && github.event.inputs.build_type) || 'RelWithDebInfo' }}
CONFIGURATION_TYPES: ${{ (inputs && inputs.configuration_types) || (github.event.inputs && github.event.inputs.configuration_types) || 'RelWithDebInfo' }}
CONFIGURE_CMAKE_OPTIONS: |
-Daudacity_has_url_schemes_support=On
-Daudacity_has_audiocom_upload=On
${{ (inputs && inputs.configure_cmake_options) || (github.event.inputs && github.event.inputs.configure_cmake_options) || '' }}
BUILD_LEVEL: ${{ (inputs && inputs.build_level) || (github.event.inputs && github.event.inputs.build_level) || ((startsWith(github.ref, 'refs/heads/release-') && 'beta') || 'alpha') }}
CRASH_REPORT_URL: ${{ secrets.CRASH_REPORT_URL }}
jobs:
build_linux:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Ubuntu 20.04 AppImage (x86_64)
os: ubuntu-20.04
force_gcc11: false
postfix: '-20.04'
# - name: Ubuntu 20.04 AppImage (x86_64, gcc 11)
# os: ubuntu-20.04
# force_gcc11: true
# postfix: '-20.04-gcc11'
- name: Ubuntu 22.04 AppImage (x86_64)
os: ubuntu-22.04
force_gcc11: false
postfix: '-22.04'
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
with:
force_gcc11: ${{ matrix.config.force_gcc11 }}
- name: Configure
uses: audacity/audacity-actions/configure@v2
with:
generator: Unix Makefiles
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CONFIGURE_CMAKE_OPTIONS }}
- name: Build
uses: audacity/audacity-actions/build@v2
- name: Test
uses: GabrielBB/xvfb-action@v1
with:
run: ctest -C ${{ env.BUILD_TYPE }} --verbose
working-directory: ./.build.x64/
- name: Package
uses: audacity/audacity-actions/package@v2
with:
postfix: ${{ matrix.config.postfix }}
build_windows:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Windows MSVC 2019 (x86)
os: windows-2019
arch: x32
generator: Visual Studio 16 2019
postfix: '-msvc2019'
windows_sdk: '10.0.18362.0'
- name: Windows MSVC 2019 (x86_64)
os: windows-2019
arch: x64
generator: Visual Studio 16 2019
postfix: '-msvc2019'
windows_sdk: '10.0.18362.0'
- name: Windows MSVC 2022 (x86)
os: windows-2022
arch: x32
generator: Visual Studio 17 2022
postfix: '-msvc2022'
windows_sdk: '10.0.22000.0'
- name: Windows MSVC 2022 (x86_64)
os: windows-2022
arch: x64
generator: Visual Studio 17 2022
postfix: '-msvc2022'
windows_sdk: '10.0.22000.0'
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
with:
force_gcc11: ${{ matrix.config.force_gcc11 }}
- name: Configure
uses: audacity/audacity-actions/configure@v2
with:
generator: ${{ matrix.config.generator }}
arch: ${{ matrix.config.arch }}
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: |
${{ env.CONFIGURE_CMAKE_OPTIONS }}
-DCMAKE_SYSTEM_VERSION=${{ matrix.config.windows_sdk }}
windows_certificate: ${{ secrets.WINDOWS_CERTIFICATE }}
windows_certificate_password: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
- name: Build
uses: audacity/audacity-actions/build@v2
- name: Test
shell: pwsh
run: |
pushd .build.${{ matrix.config.arch }}
ctest -C ${{ env.BUILD_TYPE }} --verbose
popd
- name: Package
uses: audacity/audacity-actions/package@v2
with:
postfix: ${{ matrix.config.postfix }}
build_macos_intel:
name: Build macOS (x86_64)
runs-on: macos-13
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
with:
force_gcc11: ${{ matrix.config.force_gcc11 }}
- name: Configure x86_64
uses: audacity/audacity-actions/configure@v2
with:
generator: Xcode
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CONFIGURE_CMAKE_OPTIONS }}
arch: x64
- name: Build x86_64
uses: audacity/audacity-actions/build@v2
- name: Test
shell: bash
run: |
pushd .build.x64
ctest -C ${{ env.BUILD_TYPE }} --verbose
popd
- name: 'Tar files'
shell: bash
run: tar cf macos_intel.tar .build.x64
- uses: actions/upload-artifact@v4
with:
name: macos-intel-${{ github.run_id }}-${{ github.run_attempt }}
path: macos_intel.tar
build_macos_arm64:
name: Build macOS (arm64)
runs-on: macos-13
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
with:
force_gcc11: ${{ matrix.config.force_gcc11 }}
- name: Configure x86_64
uses: audacity/audacity-actions/configure@v2
with:
generator: Xcode
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CONFIGURE_CMAKE_OPTIONS }}
arch: x64
- name: Build x86_64
uses: audacity/audacity-actions/build@v2
with:
target: image-compiler
- name: Configure arm64
uses: audacity/audacity-actions/configure@v2
with:
generator: Xcode
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CONFIGURE_CMAKE_OPTIONS }}
arch: arm64
image_compiler: "${{ github.workspace }}/.build.x64/RelWithDebInfo/Audacity.app/Contents/image-compiler/image-compiler"
- name: Build arm64
uses: audacity/audacity-actions/build@v2
- name: 'Tar files'
shell: bash
run: tar cf macos_arm64.tar .build.arm64
- uses: actions/upload-artifact@v4
with:
name: macos-arm64-${{ github.run_id }}-${{ github.run_attempt }}
path: macos_arm64.tar
package_macos:
name: Package macOS (x86_64, arm64, universal)
runs-on: macos-13
needs: [build_macos_intel, build_macos_arm64]
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: macos-intel-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/download-artifact@v4
with:
name: macos-arm64-${{ github.run_id }}-${{ github.run_attempt }}
- name: Untar files
shell: bash
run: |
tar xf macos_intel.tar
tar xf macos_arm64.tar
- uses: geekyeggo/delete-artifact@v5
with:
name: |
macos-intel-${{ github.run_id }}-${{ github.run_attempt }}
macos-arm64-${{ github.run_id }}-${{ github.run_attempt }}
- name: Install Apple codesigning certificates
uses: apple-actions/import-codesign-certs@v2
env:
P12_FILE_BASE64: ${{ secrets.APPLE_CERTIFICATE }}
P12_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
if: ${{ env.P12_FILE_BASE64 != '' && env.P12_PASSWORD != '' }}
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Package
uses: audacity/audacity-actions/package@v2
env:
AUDACITY_BUILD_DIR: "${{ github.workspace }}/.build.x64"
AUDACITY_BUILD_TYPE: ${{ env.BUILD_TYPE }}
AUDACITY_BUILD_LEVEL: ${{ env.BUILD_LEVEL }}
with:
apple_codesign_identity: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
apple_notarization_user_name: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
apple_notarization_password: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
apple_notarization_team_id: ${{ secrets.APPLE_NOTARIZATION_TEAM_ID }}
archs: |
x64
arm64
sources:
name: Source Tarball
runs-on: ubuntu-20.04
steps:
- name: Checkout Audacity
uses: actions/checkout@v4
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
with:
force_gcc11: ${{ matrix.config.force_gcc11 }}
- name: Configure
uses: audacity/audacity-actions/configure@v2
with:
generator: Unix Makefiles
build_type: ${{ env.BUILD_TYPE }}
configuration_types: ${{ env.CONFIGURATION_TYPES }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CONFIGURE_CMAKE_OPTIONS }}
- name: Package
shell: bash
run: |
function gh_export()
{
[[ "${GITHUB_ENV-}" ]] || local -r GITHUB_ENV="/dev/null"
export -- "$@" && printf "%s\n" "$@" >> "${GITHUB_ENV}"
}
cmake --build .build.x64 --target package_source
artifact_name=$(basename "$(ls .build.x64/package/*.tar.gz | head -n 1)" ".tar.gz")
gh_export SOURCES_ARTIFACT_NAME="${artifact_name}"
- name: Upload sources
uses: actions/upload-artifact@v4
with:
name: ${{ env.SOURCES_ARTIFACT_NAME }}
path: |
.build.x64/package/*
!.build.x64/package/_CPack_Packages
if-no-files-found: error