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