43
43
- stable
44
44
- preview
45
45
- development
46
+ test-release-artifacts :
47
+ type : boolean
48
+ description : " [Debug] Test release artifacts?"
49
+ default : false
46
50
47
51
jobs :
48
52
release-linux :
@@ -171,11 +175,122 @@ jobs:
171
175
with :
172
176
name : StabilityMatrix-${{ env.platform-id }}
173
177
path : ./out/${{ env.out-name }}
174
-
178
+
179
+ release-macos :
180
+ name : Release (macos-arm64)
181
+ env :
182
+ platform-id : osx-arm64
183
+ app-name : " Stability Matrix.app"
184
+ out-name : " StabilityMatrix-macos-arm64.dmg"
185
+ runs-on : macos-13
186
+ steps :
187
+ - uses : actions/checkout@v3
188
+
189
+ -
uses :
olegtarasov/[email protected]
190
+ if : github.event_name == 'release'
191
+ id : tag_name
192
+ with :
193
+ tagRegex : " v(.*)"
194
+
195
+ - name : Set Version from Tag
196
+ if : github.event_name == 'release'
197
+ run : |
198
+ echo "Using tag ${{ env.GIT_TAG_NAME }}"
199
+ echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $GITHUB_ENV
200
+
201
+ - name : Set Version from manual input
202
+ if : github.event_name == 'workflow_dispatch'
203
+ run : |
204
+ echo "Using version ${{ github.event.inputs.version }}"
205
+ echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
206
+
207
+ - name : Set up .NET 8
208
+ uses : actions/setup-dotnet@v3
209
+ with :
210
+ dotnet-version : ' 8.0.x'
211
+
212
+ - name : Install dependencies
213
+ run : dotnet restore -p:PublishReadyToRun=true
214
+
215
+ - name : Check Version
216
+ run : echo $RELEASE_VERSION
217
+
218
+ - name : .NET Msbuild (App)
219
+ env :
220
+ SENTRY_AUTH_TOKEN : ${{ secrets.SENTRY_AUTH_TOKEN }}
221
+ run : >
222
+ dotnet msbuild ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
223
+ -t:BundleApp -p:UseAppHost=true -p:SelfContained=true
224
+ -p:Configuration=Release -p:RuntimeIdentifier=${{ env.platform-id }}
225
+ -p:Version=$RELEASE_VERSION
226
+ -p:PublishDir=out
227
+ -p:PublishReadyToRun=true
228
+ -p:CFBundleShortVersionString=$RELEASE_VERSION
229
+ -p:CFBundleName="Stability Matrix"
230
+ -p:CFBundleDisplayName="Stability Matrix"
231
+ -p:CFBundleVersion=$RELEASE_VERSION
232
+ -p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
233
+ -p:SentryUploadSymbols=true -p:SentryUploadSources=true
234
+
235
+ - name : Post Build (App)
236
+ run : mkdir -p signing && mv "./StabilityMatrix.Avalonia/out/Stability Matrix.app" "./signing/${{ env.app-name }}"
237
+
238
+ - name : Codesign app bundle
239
+ env :
240
+ MACOS_CERTIFICATE : ${{ secrets.PROD_MACOS_CERTIFICATE }}
241
+ MACOS_CERTIFICATE_PWD : ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
242
+ MACOS_CERTIFICATE_NAME : ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
243
+ MACOS_CI_KEYCHAIN_PWD : ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
244
+ run : ./Build/codesign_macos.sh "./signing/${{ env.app-name }}"
245
+
246
+ - name : Notarize app bundle
247
+ env :
248
+ MACOS_NOTARIZATION_APPLE_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
249
+ MACOS_NOTARIZATION_TEAM_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
250
+ MACOS_NOTARIZATION_PWD : ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
251
+ run : ./Build/notarize_macos.sh "./signing/${{ env.app-name }}"
252
+
253
+ - name : Zip Artifact (App)
254
+ working-directory : signing
255
+ run : zip -r -y "../StabilityMatrix-${{ env.platform-id }}-app.zip" "${{ env.app-name }}"
256
+
257
+ - name : Upload Artifact (App)
258
+ uses : actions/upload-artifact@v2
259
+ with :
260
+ name : StabilityMatrix-${{ env.platform-id }}-app
261
+ path : StabilityMatrix-${{ env.platform-id }}-app.zip
262
+
263
+ - uses : actions/setup-node@v4
264
+ with :
265
+ node-version : ' 20.x'
266
+
267
+ - name : Install dependencies for dmg creation
268
+ run : >
269
+ npm install --global create-dmg
270
+ brew install graphicsmagick imagemagick
271
+
272
+ - name : Create dmg
273
+ working-directory : signing
274
+ run : >
275
+ create-dmg "${{ env.app-name }}" --overwrite --identity "${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}"
276
+
277
+ - name : Rename dmg
278
+ working-directory : signing
279
+ run : mv "$(find . -type f -name "*.dmg")" "${{ env.out-name }}"
280
+
281
+ - name : Zip Artifact (dmg)
282
+ working-directory : signing
283
+ run : zip -r -y "../StabilityMatrix-${{ env.platform-id }}-dmg.zip" "${{ env.out-name }}"
284
+
285
+ - name : Upload Artifact (dmg)
286
+ uses : actions/upload-artifact@v2
287
+ with :
288
+ name : StabilityMatrix-${{ env.platform-id }}-dmg
289
+ path : StabilityMatrix-${{ env.platform-id }}-dmg.zip
175
290
176
291
publish-release :
177
292
name : Publish GitHub Release
178
- needs : [ release-linux, release-windows ]
293
+ needs : [ release-linux, release-windows, release-macos ]
179
294
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.github-release == 'true' }}
180
295
runs-on : ubuntu-latest
181
296
steps :
@@ -194,11 +309,12 @@ jobs:
194
309
- name : Download Artifacts
195
310
uses : actions/download-artifact@v3
196
311
197
- # Zip each build
312
+ # Zip each build (except macos which is already dmg)
198
313
- name : Zip Artifacts
199
314
run : |
200
315
cd StabilityMatrix-win-x64 && zip -r ../StabilityMatrix-win-x64.zip ./. && cd $OLDPWD
201
316
cd StabilityMatrix-linux-x64 && zip -r ../StabilityMatrix-linux-x64.zip ./. && cd $OLDPWD
317
+ unzip "StabilityMatrix-osx-arm64-dmg/StabilityMatrix-osx-arm64-dmg.zip"
202
318
203
319
- name : Create Github Release
204
320
id : create_release
@@ -209,15 +325,75 @@ jobs:
209
325
files : |
210
326
StabilityMatrix-win-x64.zip
211
327
StabilityMatrix-linux-x64.zip
328
+ StabilityMatrix-macos-arm64.dmg
212
329
fail_on_unmatched_files : true
213
330
tag_name : v${{ github.event.inputs.version }}
214
331
body : ${{ steps.release_notes.outputs.release_notes }}
215
332
draft : ${{ github.event.inputs.github-release-draft == 'true' }}
216
333
prerelease : ${{ github.event.inputs.github-release-prerelease == 'true' }}
217
334
335
+ test-artifacts :
336
+ name : Test Release Artifacts
337
+ needs : [ release-linux, release-windows, release-macos ]
338
+ if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.test-release-artifacts == 'true' }}
339
+ runs-on : ubuntu-latest
340
+ steps :
341
+ - uses : actions/checkout@v3
342
+
343
+ - name : Extract Release Notes
344
+ id : release_notes
345
+ run : |
346
+ RELEASE_NOTES="$(awk -v version="${{ github.event.inputs.version }}" '/## v/{if(p) exit; if($0 ~ version) p=1}; p' CHANGELOG.md)"
347
+ RELEASE_NOTES="${RELEASE_NOTES//'%'/'%25'}"
348
+ RELEASE_NOTES="${RELEASE_NOTES//$'\n'/'%0A'}"
349
+ RELEASE_NOTES="${RELEASE_NOTES//$'\r'/'%0D'}"
350
+ echo "::set-output name=release_notes::$RELEASE_NOTES"
351
+ echo "Release Notes:"
352
+ echo "$RELEASE_NOTES"
353
+
354
+ # Downloads all previous artifacts to the current working directory
355
+ - name : Download Artifacts
356
+ uses : actions/download-artifact@v3
357
+
358
+ # Zip each build (except macos which is already dmg)
359
+ - name : Zip Artifacts
360
+ run : |
361
+ cd StabilityMatrix-win-x64 && zip -r ../StabilityMatrix-win-x64.zip ./. && cd $OLDPWD
362
+ cd StabilityMatrix-linux-x64 && zip -r ../StabilityMatrix-linux-x64.zip ./. && cd $OLDPWD
363
+ unzip "StabilityMatrix-osx-arm64-dmg/StabilityMatrix-osx-arm64-dmg.zip"
364
+
365
+ # Check that the zips and CHANGELOG.md are in the current working directory
366
+ - name : Check files
367
+ run : |
368
+ if [ ! -f StabilityMatrix-win-x64.zip ]; then
369
+ echo "StabilityMatrix-win-x64.zip not found"
370
+ exit 1
371
+ else
372
+ echo "StabilityMatrix-win-x64.zip found"
373
+ sha256sum StabilityMatrix-win-x64.zip
374
+ fi
375
+ if [ ! -f StabilityMatrix-linux-x64.zip ]; then
376
+ echo "StabilityMatrix-linux-x64.zip not found"
377
+ exit 1
378
+ else
379
+ echo "StabilityMatrix-linux-x64.zip found"
380
+ sha256sum StabilityMatrix-linux-x64.zip
381
+ fi
382
+ if [ ! -f StabilityMatrix-macos-arm64.dmg ]; then
383
+ echo "StabilityMatrix-macos-arm64.dmg not found"
384
+ exit 1
385
+ else
386
+ echo "StabilityMatrix-macos-arm64.dmg found"
387
+ sha256sum StabilityMatrix-macos-arm64.dmg
388
+ fi
389
+ if [ ! -f CHANGELOG.md ]; then
390
+ echo "CHANGELOG.md not found"
391
+ exit 1
392
+ fi
393
+
218
394
publish-auto-update-github :
219
395
name : Publish Auto-Update Release (GitHub)
220
- needs : [ release-linux, release-windows ]
396
+ needs : [ release-linux, release-windows, release-macos ]
221
397
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.auto-update-release == 'true' && github.event.inputs.auto-update-release-mode == 'github url' }}
222
398
runs-on : ubuntu-latest
223
399
steps :
@@ -233,7 +409,7 @@ jobs:
233
409
python-version : ' 3.11'
234
410
235
411
- name : Install Python Dependencies
236
- run : pip install stability-matrix-tools>=0.2.18 --upgrade
412
+ run : pip install stability-matrix-tools>=0.3.0 --upgrade
237
413
238
414
- name : Publish Auto-Update Release
239
415
env :
@@ -246,7 +422,7 @@ jobs:
246
422
247
423
publish-auto-update-b2 :
248
424
name : Publish Auto-Update Release (B2)
249
- needs : [ release-linux, release-windows ]
425
+ needs : [ release-linux, release-windows, release-macos ]
250
426
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.auto-update-release == 'true' && github.event.inputs.auto-update-release-mode == 'upload to b2' }}
251
427
runs-on : ubuntu-latest
252
428
steps :
@@ -261,18 +437,19 @@ jobs:
261
437
- name : Download Artifacts
262
438
uses : actions/download-artifact@v3
263
439
264
- # Zip each build
440
+ # Zip each build (except macos which is already dmg)
265
441
- name : Zip Artifacts
266
442
run : |
267
443
cd StabilityMatrix-win-x64 && zip -r ../StabilityMatrix-win-x64.zip ./. && cd $OLDPWD
268
444
cd StabilityMatrix-linux-x64 && zip -r ../StabilityMatrix-linux-x64.zip ./. && cd $OLDPWD
445
+ unzip "StabilityMatrix-osx-arm64-dmg/StabilityMatrix-osx-arm64-dmg.zip"
269
446
270
447
- uses : actions/setup-python@v4
271
448
with :
272
449
python-version : ' 3.11'
273
450
274
451
- name : Install Python Dependencies
275
- run : pip install stability-matrix-tools>=0.2.18 --upgrade
452
+ run : pip install stability-matrix-tools>=0.3.0 --upgrade
276
453
277
454
# Check that the zips and CHANGELOG.md are in the current working directory
278
455
- name : Check files
@@ -285,6 +462,10 @@ jobs:
285
462
echo "StabilityMatrix-linux-x64.zip not found"
286
463
exit 1
287
464
fi
465
+ if [ ! -f StabilityMatrix-macos-arm64.dmg ]; then
466
+ echo "StabilityMatrix-macos-arm64.dmg not found"
467
+ exit 1
468
+ fi
288
469
if [ ! -f CHANGELOG.md ]; then
289
470
echo "CHANGELOG.md not found"
290
471
exit 1
@@ -303,4 +484,5 @@ jobs:
303
484
--changelog CHANGELOG.md
304
485
--win-x64 StabilityMatrix-win-x64.zip
305
486
--linux-x64 StabilityMatrix-linux-x64.zip
487
+ --macos-arm64 StabilityMatrix-macos-arm64.dmg
306
488
-y
0 commit comments