Files
ICCery/.github/workflows/build-macos.yml
gronod 6976ced610
Build Windows Packages / Build Windows (push) Canceled after 10s
Build Linux Packages / Build Linux (push) Canceled after 14s
Build macOS Packages / Build macOS (Intel) (push) Successful in 10m34s
Build macOS Packages / Build macOS (Apple Silicon) (push) Successful in 10m43s
feat(ci): build styled macOS DMG headlessly via dmgbuild (#189)
- Add scripts/build-dmg.py using dmgbuild to generate DMGs with custom background art and icon locations without Finder AppleScript.
- Update .gitea/workflows/build-macos.yml and .github/workflows/build-macos.yml to package the .app bundle using dmgbuild in a headless virtual environment.
- Resolves missing DMG background in CI while preventing AppleScript GUI automation timeouts.
2026-09-06 22:04:36 +01:00

127 lines
4.0 KiB
YAML

name: Build macOS Packages
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build-macos:
name: Build macOS (${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
platform:
- name: Intel
os: macos-26-intel
target: x86_64-apple-darwin
binary_dir: macos-x86_64
arch: x86_64
- name: Apple Silicon
os: macos-latest
target: aarch64-apple-darwin
binary_dir: macos-aarch64
arch: arm64
- name: Universal (Intel + Apple Silicon)
os: macos-latest
target: universal-apple-darwin
binary_dir: macos-universal
arch: universal
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Ensure workspace and git permissions
run: |
mkdir -p "${{ runner.temp }}/.config/git"
touch "${{ runner.temp }}/.config/git/ignore"
mkdir -p .git/info
touch .git/info/exclude
chmod -R u+rwX .git || true
chmod 644 .git/info/exclude || true
git config --local core.excludesFile "${{ runner.temp }}/.config/git/ignore" || true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.platform.target == 'universal-apple-darwin' && 'x86_64-apple-darwin,aarch64-apple-darwin' || matrix.platform.target }}
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Install Node dependencies
run: npm ci
- name: Fetch ArgyllCMS binaries
env:
ARGYLL_RELEASE_TAG: ${{ vars.ARGYLL_RELEASE_TAG }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run fetch-argyll -- --force --platform ${{ matrix.platform.binary_dir }}
- name: Verify sidecar binaries
run: |
test -x "src-tauri/argyll/${{ matrix.platform.binary_dir }}/instlist"
test -x "src-tauri/argyll/${{ matrix.platform.binary_dir }}/targen"
- name: Set Release Environment
id: set_env
shell: bash
run: |
TAG="${{ github.ref_name }}"
SHORT_SHA=$(git rev-parse --short HEAD)
echo "TAG=${TAG}" >> $GITHUB_ENV
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
echo "PREFIX=ICCery_${TAG}-${SHORT_SHA}-macos-${{ matrix.platform.arch }}" >> $GITHUB_ENV
- name: Build Tauri App
env:
CI: "true"
run: npm run tauri build -- --target ${{ matrix.platform.target }}
- name: Prepare Release Assets
shell: bash
run: |
mkdir -p release-assets
APP_PATH=$(find src-tauri/target -type d -path "*/release/bundle/macos/*.app" | head -n 1)
if [ -z "$APP_PATH" ] || [ ! -d "$APP_PATH" ]; then
echo "Error: Could not locate built .app bundle in src-tauri/target"
exit 1
fi
echo "Found .app bundle: ${APP_PATH}"
# Setup isolated Python virtual environment for dmgbuild
python3 -m venv "${{ runner.temp }}/dmgbuild-venv"
"${{ runner.temp }}/dmgbuild-venv/bin/pip" install --quiet dmgbuild
# Build styled DMG with background art and custom icon locations
"${{ runner.temp }}/dmgbuild-venv/bin/python" scripts/build-dmg.py \
--app "${APP_PATH}" \
--output "release-assets/${PREFIX}.dmg" \
--volname "ICCery"
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PREFIX }}
path: release-assets/*
- name: Release on GitHub
uses: softprops/action-gh-release@v2
with:
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}