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
- 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.
147 lines
5.1 KiB
YAML
147 lines
5.1 KiB
YAML
name: Build macOS Packages
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-macos:
|
|
name: Build macOS (${{ matrix.platform.name }})
|
|
runs-on: ${{ matrix.platform.os }}
|
|
env:
|
|
XDG_CONFIG_HOME: ${{ runner.temp }}/.config
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- name: Intel
|
|
os: macos
|
|
target: x86_64-apple-darwin
|
|
binary_dir: macos-x86_64
|
|
arch: x86_64
|
|
- name: Apple Silicon
|
|
os: macos
|
|
target: aarch64-apple-darwin
|
|
binary_dir: macos-aarch64
|
|
arch: arm64
|
|
# - name: Universal (Intel + Apple Silicon)
|
|
# os: macos
|
|
# 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: 24
|
|
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: Install Node dependencies
|
|
run: npm ci
|
|
|
|
- name: Run frontend tests
|
|
run: npm test
|
|
|
|
- name: Fetch ArgyllCMS binaries
|
|
env:
|
|
ARGYLL_SERVER_URL: ${{ github.server_url }}
|
|
ARGYLL_RELEASE_TAG: ${{ vars.ARGYLL_RELEASE_TAG }}
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npm run fetch-argyll -- --force --platform ${{ matrix.platform.binary_dir }} --server "${{ github.server_url }}"
|
|
|
|
- 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@v3
|
|
with:
|
|
name: ${{ env.PREFIX }}
|
|
path: release-assets/*
|
|
|
|
- name: Upload Release Assets to Gitea
|
|
if: !cancelled()
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SERVER_URL: ${{ github.server_url }}
|
|
REPO: ${{ github.repository }}
|
|
run: |
|
|
echo "Finding release for tag ${TAG}..."
|
|
RELEASE_RESP=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" "${SERVER_URL}/api/v1/repos/${REPO}/releases/tags/${TAG}")
|
|
RELEASE_ID=$(echo "${RELEASE_RESP}" | grep -o '"id":[0-9]*' | head -n 1 | cut -d: -f2)
|
|
if [ -n "${RELEASE_ID}" ]; then
|
|
echo "Found Release ID: ${RELEASE_ID}. Uploading macOS assets..."
|
|
for f in release-assets/*; do
|
|
if [ -f "$f" ]; then
|
|
FILENAME=$(basename "$f")
|
|
echo "Uploading $FILENAME to release ${RELEASE_ID}..."
|
|
curl -s -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: multipart/form-data" \
|
|
-F "attachment=@$f" \
|
|
"${SERVER_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
|
|
fi
|
|
done
|
|
else
|
|
echo "No existing release found for tag ${TAG}. Skipping asset upload."
|
|
fi
|