Split CI workflows into per-OS files for independent re-runs
All checks were successful
Release / Bump version and tag (push) Successful in 3s
All checks were successful
Release / Bump version and tag (push) Successful in 3s
Refactored from 2 monolithic workflows into 8 targeted ones: Coordinators (version bump + tag + release creation): - release.yml: bumps app version, tags v*, creates Gitea release - sidecar-release.yml: bumps sidecar version, tags sidecar-v* Per-OS app builds (triggered by v* tags or workflow_dispatch): - build-app-linux.yml: .deb, .rpm, .AppImage - build-app-windows.yml: .msi, -setup.exe - build-app-macos.yml: .dmg Per-OS sidecar builds (triggered by sidecar-v* tags or workflow_dispatch): - build-sidecar-linux.yml: CUDA + CPU variants - build-sidecar-windows.yml: CUDA + CPU variants - build-sidecar-macos.yml: CPU only Each build workflow can be re-triggered independently without re-running the version bump or rebuilding other platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
112
.gitea/workflows/build-sidecar-macos.yml
Normal file
112
.gitea/workflows/build-sidecar-macos.yml
Normal file
@@ -0,0 +1,112 @@
|
||||
name: Build Sidecar (macOS)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'sidecar-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
build-sidecar-macos:
|
||||
name: Build Sidecar (macOS)
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
PYTHON_VERSION: "3.11"
|
||||
steps:
|
||||
- name: Determine tag
|
||||
id: tag
|
||||
run: |
|
||||
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
||||
TAG="${{ github.ref_name }}"
|
||||
else
|
||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
||||
fi
|
||||
echo "Building for tag: ${TAG}"
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ steps.tag.outputs.tag }}
|
||||
|
||||
- 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: Set up Python
|
||||
run: uv python install ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Install system dependencies
|
||||
run: brew install portaudio
|
||||
|
||||
- name: Build sidecar (CPU)
|
||||
env:
|
||||
UV_NO_SOURCES: "1"
|
||||
run: |
|
||||
# UV_NO_SOURCES bypasses pyproject.toml's [tool.uv.sources] which forces
|
||||
# torch from the CUDA index (no macOS ARM wheels there).
|
||||
# Default PyPI torch includes MPS (Apple Silicon GPU) support.
|
||||
uv sync
|
||||
.venv/bin/pyinstaller local-transcription-headless.spec
|
||||
|
||||
- name: Package sidecar (CPU)
|
||||
run: |
|
||||
cd dist/local-transcription-backend && zip -r ../../sidecar-macos-aarch64-cpu.zip .
|
||||
|
||||
- name: Upload to sidecar release
|
||||
env:
|
||||
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||
run: |
|
||||
which jq || brew install jq
|
||||
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
TAG="${{ steps.tag.outputs.tag }}"
|
||||
|
||||
echo "Waiting for sidecar release ${TAG} to be available..."
|
||||
for i in $(seq 1 30); do
|
||||
RELEASE_JSON=$(curl -s -H "Authorization: token ${BUILD_TOKEN}" \
|
||||
"${REPO_API}/releases/tags/${TAG}")
|
||||
RELEASE_ID=$(echo "$RELEASE_JSON" | jq -r '.id // empty')
|
||||
|
||||
if [ -n "${RELEASE_ID}" ] && [ "${RELEASE_ID}" != "null" ]; then
|
||||
echo "Found sidecar release: ${TAG} (ID: ${RELEASE_ID})"
|
||||
break
|
||||
fi
|
||||
|
||||
echo "Attempt ${i}/30: Release not ready yet, retrying in 10s..."
|
||||
sleep 10
|
||||
done
|
||||
|
||||
if [ -z "${RELEASE_ID}" ] || [ "${RELEASE_ID}" = "null" ]; then
|
||||
echo "ERROR: Failed to find sidecar release for tag ${TAG} after 30 attempts."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in sidecar-*.zip; do
|
||||
filename=$(basename "$file")
|
||||
encoded_name=$(echo "$filename" | sed 's/ /%20/g')
|
||||
echo "Uploading ${filename} ($(du -h "$file" | cut -f1))..."
|
||||
|
||||
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
|
||||
|
||||
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
|
||||
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
-T "$file" \
|
||||
"${REPO_API}/releases/${RELEASE_ID}/assets?name=${encoded_name}")
|
||||
echo "Upload response: HTTP ${HTTP_CODE}"
|
||||
done
|
||||
Reference in New Issue
Block a user