Build macOS release artifacts in matrix and publish in follow-up job
- remove manual `arch` workflow input and build `arm64` + `x64` via matrix - split release flow into `build-macos` and `publish-release` jobs - download merged artifacts before creating the GitHub release
This commit is contained in:
1 parent
249cf8c03b
commit
c2a588fd02
1 file changed
+23
-14
@@ -15,15 +15,6 @@ on:
|
||||
description: "Semver version injected into packaged artifacts (example: 0.1.0)"
|
||||
required: true
|
||||
type: string
|
||||
arch:
|
||||
description: "macOS architecture to build"
|
||||
required: true
|
||||
default: arm64
|
||||
type: choice
|
||||
options:
|
||||
- arm64
|
||||
- x64
|
||||
- universal
|
||||
draft:
|
||||
description: "Create release as draft"
|
||||
required: true
|
||||
@@ -43,9 +34,15 @@ concurrency:
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
name: Build, Package, and Publish
|
||||
build-macos:
|
||||
name: Build and package macOS (${{ matrix.arch }})
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
arch:
|
||||
- arm64
|
||||
- x64
|
||||
env:
|
||||
CI: "true"
|
||||
steps:
|
||||
@@ -77,7 +74,7 @@ jobs:
|
||||
|
||||
- name: Build and package macOS artifact
|
||||
run: |
|
||||
bun run dist:desktop:dmg -- --arch "${{ inputs.arch }}" --version "${{ inputs.version }}"
|
||||
bun run dist:desktop:dmg -- --arch "${{ matrix.arch }}" --version "${{ inputs.version }}"
|
||||
ls -lah release
|
||||
# TODO: Add production macOS signing and notarization in CI:
|
||||
# - Import Developer ID Application certificate + private key into keychain.
|
||||
@@ -93,10 +90,22 @@ jobs:
|
||||
- name: Upload packaged artifacts to workflow run
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-assets-${{ inputs.tag }}-${{ inputs.arch }}
|
||||
name: release-assets-${{ inputs.tag }}-${{ matrix.arch }}
|
||||
path: release/*
|
||||
if-no-files-found: error
|
||||
|
||||
publish-release:
|
||||
name: Create GitHub release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-macos
|
||||
steps:
|
||||
- name: Download packaged artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: release-assets-${{ inputs.tag }}-*
|
||||
merge-multiple: true
|
||||
path: release-assets
|
||||
|
||||
- name: Create GitHub release and upload assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
@@ -105,7 +114,7 @@ jobs:
|
||||
draft: ${{ inputs.draft }}
|
||||
prerelease: ${{ inputs.prerelease }}
|
||||
generate_release_notes: true
|
||||
files: release/*
|
||||
files: release-assets/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# TODO: Add a multi-platform release matrix and publish Linux/Windows installers:
|
||||
|
||||
Reference in new issue
Block a user