Files
ICCery/.gitea/workflows/build-macos.yml
T
gronod 193e492c10
Build Windows Packages / Build Windows (push) Successful in 7m35s
Build macOS Packages / Build macOS (Apple Silicon) (push) Successful in 9m25s
Build Linux Packages / Build Linux (push) Successful in 10m52s
Build macOS Packages / Build macOS (Intel) (push) Successful in 7m14s
Update .gitea/workflows/build-macos.yml
Re-enabled arm64
2026-09-06 20:16:52 +01:00

136 lines
4.6 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
# Stage DMG package
DMG_FILE=$(find src-tauri/target -type f -path "*/release/bundle/dmg/*.dmg" | head -n 1)
if [ -n "$DMG_FILE" ] && [ -f "$DMG_FILE" ]; then
cp "$DMG_FILE" "release-assets/${PREFIX}.dmg"
fi
- 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