Merge sidecar and app builds into single jobs per platform
All checks were successful
Build macOS / Build (macOS) (push) Successful in 3m21s
Build Linux / Build (Linux) (push) Successful in 7m40s
Build Windows / Build (Windows) (push) Successful in 9m35s

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:
Claude
2026-03-21 06:01:15 -07:00
parent 50baa7284e
commit bf6fb471d9
3 changed files with 40 additions and 157 deletions

View File

@@ -13,12 +13,13 @@ env:
TARGET: x86_64-unknown-linux-gnu TARGET: x86_64-unknown-linux-gnu
jobs: jobs:
build-sidecar: build:
name: Build sidecar (Linux) name: Build (Linux)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# ── Python sidecar ──
- name: Install uv - name: Install uv
run: | run: |
if command -v uv &> /dev/null; then if command -v uv &> /dev/null; then
@@ -38,20 +39,13 @@ jobs:
working-directory: python working-directory: python
run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only
- name: Upload sidecar artifact - name: Place sidecar for Tauri
uses: actions/upload-artifact@v3 run: |
with: mkdir -p src-tauri/binaries
name: sidecar-linux cp -r python/dist/voice-to-notes-sidecar/* src-tauri/binaries/
path: python/dist/voice-to-notes-sidecar/ chmod +x src-tauri/binaries/voice-to-notes-sidecar-${{ env.TARGET }}
retention-days: 7
build-app:
name: Build app (Linux)
needs: build-sidecar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# ── Tauri app ──
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
@@ -64,18 +58,8 @@ jobs:
- name: Install system dependencies - name: Install system dependencies
run: | run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
- name: Download sidecar artifact
uses: actions/download-artifact@v3
with:
name: sidecar-linux
path: src-tauri/binaries/
- name: Make sidecar executable
run: chmod +x src-tauri/binaries/voice-to-notes-sidecar-${{ env.TARGET }}
- name: Install npm dependencies - name: Install npm dependencies
run: npm ci run: npm ci
@@ -84,43 +68,20 @@ jobs:
env: env:
TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}' TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}'
- name: Upload artifacts # ── Release ──
uses: actions/upload-artifact@v3 - name: Upload to release
with:
name: app-linux
path: |
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/appimage/*.AppImage
retention-days: 30
release:
name: Release (Linux)
needs: build-app
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Install tools
run: sudo apt-get update && sudo apt-get install -y jq curl
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: app-linux
path: artifacts/
- name: Create or update release
env: env:
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
run: | run: |
sudo apt-get install -y jq
TAG="latest" TAG="latest"
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
# Check if release exists
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \ RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty') "${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
if [ -z "${RELEASE_ID}" ]; then if [ -z "${RELEASE_ID}" ]; then
# Create new release
RELEASE_ID=$(curl -s -X POST \ RELEASE_ID=$(curl -s -X POST \
-H "Authorization: token ${BUILD_TOKEN}" \ -H "Authorization: token ${BUILD_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
@@ -134,14 +95,11 @@ jobs:
exit 1 exit 1
fi fi
# Upload artifacts (delete existing ones with same name first) find src-tauri/target/release/bundle -type f \( -name "*.deb" -o -name "*.AppImage" \) | while IFS= read -r file; do
find artifacts/ -type f \( -name "*.deb" -o -name "*.AppImage" \) | while IFS= read -r file; do
filename=$(basename "$file") filename=$(basename "$file")
# URL-encode spaces in filename for the API
encoded_name=$(echo "$filename" | sed 's/ /%20/g') encoded_name=$(echo "$filename" | sed 's/ /%20/g')
echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..." echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..."
# Delete existing asset with same name
ASSET_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \ ASSET_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
"${REPO_API}/releases/${RELEASE_ID}/assets" | jq -r ".[] | select(.name == \"${filename}\") | .id // empty") "${REPO_API}/releases/${RELEASE_ID}/assets" | jq -r ".[] | select(.name == \"${filename}\") | .id // empty")
if [ -n "${ASSET_ID}" ]; then if [ -n "${ASSET_ID}" ]; then
@@ -149,14 +107,10 @@ jobs:
"${REPO_API}/releases/${RELEASE_ID}/assets/${ASSET_ID}" "${REPO_API}/releases/${RELEASE_ID}/assets/${ASSET_ID}"
fi fi
# Upload using -T for streaming (avoids loading entire file into memory)
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
-H "Authorization: token ${BUILD_TOKEN}" \ -H "Authorization: token ${BUILD_TOKEN}" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
-T "$file" \ -T "$file" \
"${REPO_API}/releases/${RELEASE_ID}/assets?name=${encoded_name}") "${REPO_API}/releases/${RELEASE_ID}/assets?name=${encoded_name}")
echo "Upload response: HTTP ${HTTP_CODE}" echo "Upload response: HTTP ${HTTP_CODE}"
if [ "$HTTP_CODE" -ge 400 ]; then
echo "WARNING: Upload failed for ${filename}"
fi
done done

View File

@@ -13,12 +13,13 @@ env:
TARGET: aarch64-apple-darwin TARGET: aarch64-apple-darwin
jobs: jobs:
build-sidecar: build:
name: Build sidecar (macOS) name: Build (macOS)
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# ── Python sidecar ──
- name: Install uv - name: Install uv
run: | run: |
if command -v uv &> /dev/null; then if command -v uv &> /dev/null; then
@@ -38,20 +39,13 @@ jobs:
working-directory: python working-directory: python
run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only
- name: Upload sidecar artifact - name: Place sidecar for Tauri
uses: actions/upload-artifact@v3 run: |
with: mkdir -p src-tauri/binaries
name: sidecar-macos cp -r python/dist/voice-to-notes-sidecar/* src-tauri/binaries/
path: python/dist/voice-to-notes-sidecar/ chmod +x src-tauri/binaries/voice-to-notes-sidecar-${{ env.TARGET }}
retention-days: 7
build-app:
name: Build app (macOS)
needs: build-sidecar
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
# ── Tauri app ──
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
@@ -65,15 +59,6 @@ jobs:
- name: Install system dependencies - name: Install system dependencies
run: brew install --quiet create-dmg || true 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 - name: Install npm dependencies
run: npm ci run: npm ci
@@ -82,35 +67,15 @@ jobs:
env: env:
TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}' TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}'
- name: Upload artifacts # ── Release ──
uses: actions/upload-artifact@v3 - name: Upload to release
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' 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: env:
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
run: | run: |
TAG="latest" TAG="latest"
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
# Check if release exists
RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \ RELEASE_ID=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
"${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty') "${REPO_API}/releases/tags/${TAG}" | jq -r '.id // empty')
@@ -128,7 +93,7 @@ jobs:
exit 1 exit 1
fi 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") filename=$(basename "$file")
encoded_name=$(echo "$filename" | sed 's/ /%20/g') encoded_name=$(echo "$filename" | sed 's/ /%20/g')
echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..." echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..."

View File

@@ -13,12 +13,13 @@ env:
TARGET: x86_64-pc-windows-msvc TARGET: x86_64-pc-windows-msvc
jobs: jobs:
build-sidecar: build:
name: Build sidecar (Windows) name: Build (Windows)
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
# ── Python sidecar ──
- name: Install uv - name: Install uv
shell: powershell shell: powershell
run: | run: |
@@ -42,20 +43,13 @@ jobs:
working-directory: python working-directory: python
run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only run: uv run --python ${{ env.PYTHON_VERSION }} python build_sidecar.py --cpu-only
- name: Upload sidecar artifact - name: Place sidecar for Tauri
uses: actions/upload-artifact@v3 shell: powershell
with: run: |
name: sidecar-windows New-Item -ItemType Directory -Force -Path src-tauri\binaries
path: python/dist/voice-to-notes-sidecar/ Copy-Item -Path python\dist\voice-to-notes-sidecar\* -Destination src-tauri\binaries\ -Recurse -Force
retention-days: 7
build-app:
name: Build app (Windows)
needs: build-sidecar
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# ── Tauri app ──
- name: Set up Node.js - name: Set up Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
@@ -72,12 +66,6 @@ jobs:
echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "$env:USERPROFILE\.cargo\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
} }
- name: Download sidecar artifact
uses: actions/download-artifact@v3
with:
name: sidecar-windows
path: src-tauri/binaries/
- name: Install npm dependencies - name: Install npm dependencies
shell: powershell shell: powershell
run: npm ci run: npm ci
@@ -88,28 +76,9 @@ jobs:
env: env:
TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}' TAURI_CONFIG: '{"bundle":{"externalBin":["binaries/voice-to-notes-sidecar"]}}'
- name: Upload artifacts # ── Release ──
uses: actions/upload-artifact@v3 - name: Upload to release
with:
name: app-windows
path: |
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe
retention-days: 30
release:
name: Release (Windows)
needs: build-app
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
runs-on: windows-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: app-windows
path: artifacts/
- name: Create or update release
shell: powershell shell: powershell
env: env:
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }} BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
@@ -118,12 +87,10 @@ jobs:
$REPO_API = "${{ github.server_url }}/api/v1/repos/${{ github.repository }}" $REPO_API = "${{ github.server_url }}/api/v1/repos/${{ github.repository }}"
$Headers = @{ "Authorization" = "token $env:BUILD_TOKEN" } $Headers = @{ "Authorization" = "token $env:BUILD_TOKEN" }
# Check if release exists
try { try {
$release = Invoke-RestMethod -Uri "${REPO_API}/releases/tags/${TAG}" -Headers $Headers -ErrorAction Stop $release = Invoke-RestMethod -Uri "${REPO_API}/releases/tags/${TAG}" -Headers $Headers -ErrorAction Stop
$RELEASE_ID = $release.id $RELEASE_ID = $release.id
} catch { } catch {
# Create new release
$body = @{ $body = @{
tag_name = $TAG tag_name = $TAG
name = "Voice to Notes (Latest Build)" name = "Voice to Notes (Latest Build)"
@@ -137,14 +104,12 @@ jobs:
Write-Host "Release ID: ${RELEASE_ID}" Write-Host "Release ID: ${RELEASE_ID}"
# Upload artifacts Get-ChildItem -Path src-tauri\target\release\bundle -Recurse -Include *.msi,*.exe | ForEach-Object {
Get-ChildItem -Path artifacts -Recurse -Include *.msi,*.exe | ForEach-Object {
$filename = $_.Name $filename = $_.Name
$encodedName = [System.Uri]::EscapeDataString($filename) $encodedName = [System.Uri]::EscapeDataString($filename)
$size = [math]::Round($_.Length / 1MB, 1) $size = [math]::Round($_.Length / 1MB, 1)
Write-Host "Uploading ${filename} (${size} MB)..." Write-Host "Uploading ${filename} (${size} MB)..."
# Delete existing asset with same name
try { try {
$assets = Invoke-RestMethod -Uri "${REPO_API}/releases/${RELEASE_ID}/assets" -Headers $Headers $assets = Invoke-RestMethod -Uri "${REPO_API}/releases/${RELEASE_ID}/assets" -Headers $Headers
$existing = $assets | Where-Object { $_.name -eq $filename } $existing = $assets | Where-Object { $_.name -eq $filename }
@@ -153,7 +118,6 @@ jobs:
} }
} catch {} } catch {}
# Upload
try { try {
Invoke-RestMethod -Uri "${REPO_API}/releases/${RELEASE_ID}/assets?name=${encodedName}" ` Invoke-RestMethod -Uri "${REPO_API}/releases/${RELEASE_ID}/assets?name=${encodedName}" `
-Method Post -Headers $Headers -ContentType "application/octet-stream" ` -Method Post -Headers $Headers -ContentType "application/octet-stream" `