Add manual GitHub Actions release workflow for macOS builds
- Add `.github/workflows/release.yml` with `workflow_dispatch` inputs for tag, version, arch, draft, and prerelease - Build and package macOS DMG artifacts, generate SHA256 checksums, and upload run artifacts - Create or update a GitHub release and publish packaged assets automatically
This commit is contained in:
1 parent
d48b42c017
commit
249cf8c03b
1 file changed
+114
@@ -0,0 +1,114 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: "Git tag to create/use for this release (example: v0.1.0)"
|
||||
required: true
|
||||
type: string
|
||||
release_name:
|
||||
description: "Display name for the GitHub release"
|
||||
required: false
|
||||
type: string
|
||||
version:
|
||||
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
|
||||
default: true
|
||||
type: boolean
|
||||
prerelease:
|
||||
description: "Mark release as pre-release"
|
||||
required: true
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: release-${{ inputs.tag }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
name: Build, Package, and Publish
|
||||
runs-on: macos-14
|
||||
env:
|
||||
CI: "true"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version-file: package.json
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Cache Bun and Turbo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.bun/install/cache
|
||||
.turbo
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-${{ hashFiles('turbo.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}-
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Build and package macOS artifact
|
||||
run: |
|
||||
bun run dist:desktop:dmg -- --arch "${{ inputs.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.
|
||||
# - Provide APPLE_ID / APPLE_TEAM_ID / APPLE_APP_SPECIFIC_PASSWORD secrets.
|
||||
# - Build with signing enabled and notarize + staple before release upload.
|
||||
|
||||
- name: Generate SHA256 checksums
|
||||
run: |
|
||||
find release -maxdepth 1 -type f ! -name "SHA256SUMS.txt" -print0 \
|
||||
| xargs -0 shasum -a 256 > release/SHA256SUMS.txt
|
||||
cat release/SHA256SUMS.txt
|
||||
|
||||
- name: Upload packaged artifacts to workflow run
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: release-assets-${{ inputs.tag }}-${{ inputs.arch }}
|
||||
path: release/*
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Create GitHub release and upload assets
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ inputs.tag }}
|
||||
name: ${{ inputs.release_name != '' && inputs.release_name || inputs.tag }}
|
||||
draft: ${{ inputs.draft }}
|
||||
prerelease: ${{ inputs.prerelease }}
|
||||
generate_release_notes: true
|
||||
files: release/*
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# TODO: Add a multi-platform release matrix and publish Linux/Windows installers:
|
||||
# - Linux: build/sign AppImage/deb/rpm artifacts on ubuntu runners.
|
||||
# - Windows: build/sign MSI/NSIS artifacts on windows runners.
|
||||
# - Consider per-platform updater metadata/signature publishing strategy.
|
||||
Reference in new issue
Block a user