chore: add publish wf #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: | |
- publish.wf # TEMPORARY - Remove before merging to main | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Release tag (e.g., v0.0.6)' | |
required: true | |
type: string | |
jobs: | |
build-macos: | |
name: Build macOS (${{ matrix.arch }}) | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
arch: [arm64, x64] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10.13.1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Download Node.js binaries | |
working-directory: apps/desktop | |
run: pnpm download-node:all | |
- name: Build Swift helper | |
run: pnpm build:swift-helper | |
- name: Import Apple certificates | |
env: | |
APPLE_CERT_BASE64: ${{ secrets.APPLE_CERT_BASE64 }} | |
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} | |
run: | | |
# Create temporary keychain | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
KEYCHAIN_PASSWORD=actions | |
# Decode certificate | |
echo "$APPLE_CERT_BASE64" | base64 --decode > certificate.p12 | |
# Create keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
# Import certificate | |
security import certificate.p12 -P "$APPLE_CERT_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | |
security list-keychain -d user -s "$KEYCHAIN_PATH" | |
# Set key partition list | |
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
# Clean up | |
rm certificate.p12 | |
- name: Build artifacts | |
working-directory: apps/desktop | |
env: | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
CODESIGNING_IDENTITY: ${{ secrets.CODESIGNING_IDENTITY }} | |
run: | | |
# Build both DMG and ZIP with single make command | |
pnpm make:${{ matrix.arch }} | |
- name: Get version from package.json | |
id: package_version | |
working-directory: apps/desktop | |
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-${{ matrix.arch }} | |
path: | | |
apps/desktop/out/make/*.dmg | |
apps/desktop/out/make/zip/darwin/${{ matrix.arch }}/*.zip | |
release: | |
name: Create Release | |
needs: build-macos | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 10.13.1 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'pnpm' | |
- name: Get version from package.json | |
id: package_version | |
working-directory: apps/desktop | |
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: List artifacts | |
run: ls -la artifacts/* | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
prerelease: true | |
tag_name: ${{ github.event.inputs.tag || github.ref_name }} | |
name: Amical Desktop v${{ steps.package_version.outputs.version }} | |
body: | | |
## Amical Desktop v${{ steps.package_version.outputs.version }} | |
### What's New | |
- Please update this section with actual changes | |
### Downloads | |
#### macOS | |
- **Apple Silicon (M1/M2/M3)**: | |
- DMG: `Amical-${{ steps.package_version.outputs.version }}-arm64.dmg` | |
- ZIP: `Amical-darwin-arm64-${{ steps.package_version.outputs.version }}.zip` | |
- **Intel**: | |
- DMG: `Amical-${{ steps.package_version.outputs.version }}-x64.dmg` | |
- ZIP: `Amical-darwin-x64-${{ steps.package_version.outputs.version }}.zip` | |
### Installation | |
**macOS**: | |
- **DMG**: Download and open the DMG file, then drag Amical to your Applications folder | |
- **ZIP**: Download and extract the ZIP file, then drag Amical to your Applications folder | |
The ZIP files are primarily for automatic updates. We recommend using the DMG files for initial installation. | |
files: | | |
artifacts/macos-arm64/*.dmg | |
artifacts/macos-arm64/*.zip | |
artifacts/macos-x64/*.dmg | |
artifacts/macos-x64/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |