Merge sidecar and app builds into single jobs per platform
Removes the artifact upload/download overhead between sidecar and app build steps. Each platform now runs as a single job: build sidecar, copy it into src-tauri/binaries, build Tauri app, upload to release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,12 +13,13 @@ env:
|
||||
TARGET: aarch64-apple-darwin
|
||||
|
||||
jobs:
|
||||
build-sidecar:
|
||||
name: Build sidecar (macOS)
|
||||
build:
|
||||
name: Build (macOS)
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# ── Python sidecar ──
|
||||
- name: Install uv
|
||||
run: |
|
||||
if command -v uv &> /dev/null; then
|
||||
@@ -38,20 +39,13 @@ jobs:
|
||||
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: Place sidecar for Tauri
|
||||
run: |
|
||||
mkdir -p src-tauri/binaries
|
||||
cp -r python/dist/voice-to-notes-sidecar/* src-tauri/binaries/
|
||||
chmod +x src-tauri/binaries/voice-to-notes-sidecar-${{ env.TARGET }}
|
||||
|
||||
# ── Tauri app ──
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
@@ -65,15 +59,6 @@ jobs:
|
||||
- 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
|
||||
|
||||
@@ -82,35 +67,15 @@ jobs:
|
||||
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
|
||||
# ── Release ──
|
||||
- name: Upload to release
|
||||
if: github.ref == 'refs/heads/main'
|
||||
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')
|
||||
|
||||
@@ -128,7 +93,7 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
find artifacts/ -type f -name "*.dmg" | while IFS= read -r file; do
|
||||
find src-tauri/target/release/bundle -type f -name "*.dmg" | while IFS= read -r file; do
|
||||
filename=$(basename "$file")
|
||||
encoded_name=$(echo "$filename" | sed 's/ /%20/g')
|
||||
echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..."
|
||||
|
||||
Reference in New Issue
Block a user