Some checks failed
Build Linux / Build sidecar (Linux) (push) Successful in 6m8s
Build macOS / Build sidecar (macOS) (push) Successful in 7m6s
Build Linux / Build app (Linux) (push) Successful in 4m14s
Build Linux / Release (Linux) (push) Failing after 8s
Build macOS / Build app (macOS) (push) Successful in 3m48s
Build macOS / Release (macOS) (push) Failing after 3s
Build Windows / Build app (Windows) (push) Has been cancelled
Build Windows / Release (Windows) (push) Has been cancelled
Build Windows / Build sidecar (Windows) (push) Has been cancelled
Each platform (Linux, macOS, Windows) now has its own workflow file that builds the sidecar, builds the Tauri app, and uploads to a shared "latest" release independently. A failure on one platform no longer blocks releases for the others. - build-linux.yml: bash throughout, apt for deps - build-macos.yml: bash throughout, brew for deps - build-windows.yml: powershell throughout, choco for deps - All use uv for Python, upload to shared "latest" release tag - Each platform replaces its own artifacts on the release Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
148 lines
4.5 KiB
YAML
148 lines
4.5 KiB
YAML
name: Build macOS
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
PYTHON_VERSION: "3.11"
|
|
NODE_VERSION: "20"
|
|
TARGET: aarch64-apple-darwin
|
|
|
|
jobs:
|
|
build-sidecar:
|
|
name: Build sidecar (macOS)
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
run: |
|
|
if command -v uv &> /dev/null; then
|
|
echo "uv already installed: $(uv --version)"
|
|
else
|
|
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
fi
|
|
|
|
- name: Install ffmpeg
|
|
run: brew install ffmpeg
|
|
|
|
- name: Set up Python
|
|
run: uv python install ${{ env.PYTHON_VERSION }}
|
|
|
|
- name: Build sidecar
|
|
working-directory: python
|
|
run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only
|
|
|
|
- name: Upload sidecar artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: sidecar-macos
|
|
path: python/dist/voice-to-notes-sidecar/
|
|
retention-days: 7
|
|
|
|
build-app:
|
|
name: Build app (macOS)
|
|
needs: build-sidecar
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Install Rust stable
|
|
run: |
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
|
|
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install system dependencies
|
|
run: brew install --quiet create-dmg || true
|
|
|
|
- name: Download sidecar artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: sidecar-macos
|
|
path: src-tauri/binaries/
|
|
|
|
- name: Make sidecar executable
|
|
run: chmod +x src-tauri/binaries/voice-to-notes-sidecar-${{ env.TARGET }}
|
|
|
|
- name: Install npm dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Tauri app
|
|
run: npm run tauri build
|
|
env:
|
|
TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}'
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: app-macos
|
|
path: |
|
|
src-tauri/target/release/bundle/dmg/*.dmg
|
|
src-tauri/target/release/bundle/macos/*.app
|
|
retention-days: 30
|
|
|
|
release:
|
|
name: Release (macOS)
|
|
needs: build-app
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: app-macos
|
|
path: artifacts/
|
|
|
|
- name: Create or update release
|
|
env:
|
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
|
run: |
|
|
TAG="latest"
|
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
|
|
|
# Check if release exists
|
|
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
|
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
|
|
|
|
if [ -z "${RELEASE_ID}" ]; then
|
|
RELEASE_ID=$(curl -s -X POST \
|
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"Voice to Notes (Latest Build)\", \"body\": \"Latest automated build from main branch.\", \"draft\": false, \"prerelease\": true}" \
|
|
"${REPO_API}/releases" | jq -r '.id')
|
|
fi
|
|
|
|
echo "Release ID: ${RELEASE_ID}"
|
|
if [ "${RELEASE_ID}" = "null" ] || [ -z "${RELEASE_ID}" ]; then
|
|
echo "ERROR: Failed to create/find release."
|
|
exit 1
|
|
fi
|
|
|
|
find artifacts/ -type f -name "*.dmg" | while read file; do
|
|
filename=$(basename "$file")
|
|
echo "Uploading ${filename}..."
|
|
|
|
ASSET_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
|
"${REPO_API}/releases/${RELEASE_ID}/assets" | jq -r ".[] | select(.name == \"${filename}\") | .id // empty")
|
|
if [ -n "${ASSET_ID}" ]; then
|
|
curl -s -X DELETE -H "Authorization: token ${BUILD_TOKEN}" \
|
|
"${REPO_API}/releases/${RELEASE_ID}/assets/${ASSET_ID}"
|
|
fi
|
|
|
|
curl -s -X POST \
|
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
|
-H "Content-Type: application/octet-stream" \
|
|
--data-binary "@${file}" \
|
|
"${REPO_API}/releases/${RELEASE_ID}/assets?name=${filename}"
|
|
done
|