Coordinators now dispatch per-OS builds via API
All checks were successful
Release / Bump version and tag (push) Successful in 7s
All checks were successful
Release / Bump version and tag (push) Successful in 7s
Previously per-OS build workflows triggered on tag push events, but
Gitea doesn't fire events for tags pushed by other workflows. Now:
- release.yml dispatches build-app-{linux,windows,macos}.yml via
the Gitea API after creating the tag and release
- sidecar-release.yml dispatches build-sidecar-{linux,windows,macos}.yml
Per-OS workflows changed from push+dispatch triggers to dispatch-only
with tag as a required input. To re-run a failed build for the same
version, just dispatch the specific OS workflow with the same tag --
upload logic replaces existing assets automatically.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,11 @@
|
|||||||
name: Build App (Linux)
|
name: Build App (Linux)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. v1.4.5)'
|
description: 'Release tag to build (e.g. v1.4.5)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-linux:
|
build-linux:
|
||||||
@@ -20,11 +17,8 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG="${{ github.ref_name }}"
|
|
||||||
else
|
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
echo "Building for tag: ${TAG}"
|
echo "Building for tag: ${TAG}"
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
name: Build App (macOS)
|
name: Build App (macOS)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. v1.4.5)'
|
description: 'Release tag to build (e.g. v1.4.5)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
@@ -20,11 +17,8 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [ -z "$TAG" ]; then
|
||||||
TAG="${{ github.ref_name }}"
|
|
||||||
else
|
|
||||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
echo "Building for tag: ${TAG}"
|
echo "Building for tag: ${TAG}"
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
name: Build App (Windows)
|
name: Build App (Windows)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. v1.4.5)'
|
description: 'Release tag to build (e.g. v1.4.5)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows:
|
build-windows:
|
||||||
@@ -21,20 +18,12 @@ jobs:
|
|||||||
id: tag
|
id: tag
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$inputTag = "${{ github.event.inputs.tag }}"
|
$TAG = "${{ github.event.inputs.tag }}"
|
||||||
$ref = "${{ github.ref }}"
|
if (-not $TAG) {
|
||||||
$refName = "${{ github.ref_name }}"
|
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
||||||
|
|
||||||
if ($inputTag) {
|
|
||||||
$TAG = $inputTag
|
|
||||||
} elseif ($ref -like "refs/tags/*") {
|
|
||||||
$TAG = $refName
|
|
||||||
} else {
|
|
||||||
$tags = git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' 2>&1
|
|
||||||
$TAG = ($tags | Select-Object -First 1) -replace '.*refs/tags/', ''
|
|
||||||
}
|
}
|
||||||
Write-Host "Building for tag: ${TAG}"
|
Write-Host "Building for tag: ${TAG}"
|
||||||
echo "tag=${TAG}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
echo "tag=${TAG}" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
name: Build Sidecar (Linux)
|
name: Build Sidecar (Linux)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'sidecar-v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-sidecar-linux:
|
build-sidecar-linux:
|
||||||
@@ -20,11 +17,8 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [ -z "$TAG" ]; 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/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
echo "Building for tag: ${TAG}"
|
echo "Building for tag: ${TAG}"
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
name: Build Sidecar (macOS)
|
name: Build Sidecar (macOS)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'sidecar-v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-sidecar-macos:
|
build-sidecar-macos:
|
||||||
@@ -20,11 +17,8 @@ jobs:
|
|||||||
- name: Determine tag
|
- name: Determine tag
|
||||||
id: tag
|
id: tag
|
||||||
run: |
|
run: |
|
||||||
if [ -n "${{ github.event.inputs.tag }}" ]; then
|
|
||||||
TAG="${{ github.event.inputs.tag }}"
|
TAG="${{ github.event.inputs.tag }}"
|
||||||
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
|
if [ -z "$TAG" ]; 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/||')
|
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||')
|
||||||
fi
|
fi
|
||||||
echo "Building for tag: ${TAG}"
|
echo "Building for tag: ${TAG}"
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
name: Build Sidecar (Windows)
|
name: Build Sidecar (Windows)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'sidecar-v*'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
tag:
|
tag:
|
||||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||||
required: false
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-sidecar-windows:
|
build-sidecar-windows:
|
||||||
@@ -21,20 +18,12 @@ jobs:
|
|||||||
id: tag
|
id: tag
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$inputTag = "${{ github.event.inputs.tag }}"
|
$TAG = "${{ github.event.inputs.tag }}"
|
||||||
$ref = "${{ github.ref }}"
|
if (-not $TAG) {
|
||||||
$refName = "${{ github.ref_name }}"
|
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
||||||
|
|
||||||
if ($inputTag) {
|
|
||||||
$TAG = $inputTag
|
|
||||||
} elseif ($ref -like "refs/tags/*") {
|
|
||||||
$TAG = $refName
|
|
||||||
} else {
|
|
||||||
$tags = git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' 2>&1
|
|
||||||
$TAG = ($tags | Select-Object -First 1) -replace '.*refs/tags/', ''
|
|
||||||
}
|
}
|
||||||
Write-Host "Building for tag: ${TAG}"
|
Write-Host "Building for tag: ${TAG}"
|
||||||
echo "tag=${TAG}" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
echo "tag=${TAG}" >> $env:GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -25,11 +25,9 @@ jobs:
|
|||||||
- name: Bump patch version
|
- name: Bump patch version
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
# Read current version from package.json
|
|
||||||
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||||
echo "Current version: ${CURRENT}"
|
echo "Current version: ${CURRENT}"
|
||||||
|
|
||||||
# Increment patch number
|
|
||||||
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
||||||
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
||||||
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
||||||
@@ -37,16 +35,9 @@ jobs:
|
|||||||
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||||
echo "New version: ${NEW_VERSION}"
|
echo "New version: ${NEW_VERSION}"
|
||||||
|
|
||||||
# Update package.json
|
|
||||||
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" package.json
|
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" package.json
|
||||||
|
|
||||||
# Update src-tauri/tauri.conf.json
|
|
||||||
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" src-tauri/tauri.conf.json
|
sed -i "s/\"version\": \"${CURRENT}\"/\"version\": \"${NEW_VERSION}\"/" src-tauri/tauri.conf.json
|
||||||
|
|
||||||
# Update src-tauri/Cargo.toml
|
|
||||||
sed -i "s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/" src-tauri/Cargo.toml
|
sed -i "s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/" src-tauri/Cargo.toml
|
||||||
|
|
||||||
# Update version.py
|
|
||||||
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
||||||
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
||||||
|
|
||||||
@@ -81,3 +72,20 @@ jobs:
|
|||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"${REPO_API}/releases"
|
"${REPO_API}/releases"
|
||||||
echo "Created release: ${RELEASE_NAME}"
|
echo "Created release: ${RELEASE_NAME}"
|
||||||
|
|
||||||
|
- name: Trigger per-OS app builds
|
||||||
|
env:
|
||||||
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
|
run: |
|
||||||
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
TAG="${{ steps.bump.outputs.tag }}"
|
||||||
|
|
||||||
|
for workflow in build-app-linux.yml build-app-windows.yml build-app-macos.yml; do
|
||||||
|
echo "Dispatching ${workflow} for ${TAG}..."
|
||||||
|
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
|
||||||
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${TAG}\"}}" \
|
||||||
|
"${REPO_API}/actions/workflows/${workflow}/dispatches")
|
||||||
|
echo " -> HTTP ${HTTP_CODE}"
|
||||||
|
done
|
||||||
|
|||||||
@@ -28,12 +28,10 @@ jobs:
|
|||||||
- name: Check for backend changes
|
- name: Check for backend changes
|
||||||
id: check_changes
|
id: check_changes
|
||||||
run: |
|
run: |
|
||||||
# If triggered by workflow_dispatch, always build
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Check if relevant files changed in this commit
|
|
||||||
CHANGED=$(git diff --name-only HEAD~1 HEAD -- client/ server/ backend/ pyproject.toml local-transcription-headless.spec 2>/dev/null || echo "")
|
CHANGED=$(git diff --name-only HEAD~1 HEAD -- client/ server/ backend/ pyproject.toml local-transcription-headless.spec 2>/dev/null || echo "")
|
||||||
if [ -n "$CHANGED" ]; then
|
if [ -n "$CHANGED" ]; then
|
||||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||||
@@ -53,11 +51,9 @@ jobs:
|
|||||||
if: steps.check_changes.outputs.has_changes == 'true'
|
if: steps.check_changes.outputs.has_changes == 'true'
|
||||||
id: bump
|
id: bump
|
||||||
run: |
|
run: |
|
||||||
# Read current version from pyproject.toml
|
|
||||||
CURRENT=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
CURRENT=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||||
echo "Current sidecar version: ${CURRENT}"
|
echo "Current sidecar version: ${CURRENT}"
|
||||||
|
|
||||||
# Increment patch number
|
|
||||||
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
||||||
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
||||||
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
||||||
@@ -65,10 +61,7 @@ jobs:
|
|||||||
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||||
echo "New sidecar version: ${NEW_VERSION}"
|
echo "New sidecar version: ${NEW_VERSION}"
|
||||||
|
|
||||||
# Update pyproject.toml
|
|
||||||
sed -i "s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/" pyproject.toml
|
sed -i "s/^version = \"${CURRENT}\"/version = \"${NEW_VERSION}\"/" pyproject.toml
|
||||||
|
|
||||||
# Update version.py
|
|
||||||
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
sed -i "s/__version__ = \"${CURRENT}\"/__version__ = \"${NEW_VERSION}\"/" version.py
|
||||||
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
sed -i "s/__version_info__ = .*/__version_info__ = (${MAJOR}, ${MINOR}, ${NEW_PATCH})/" version.py
|
||||||
|
|
||||||
@@ -107,3 +100,21 @@ jobs:
|
|||||||
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated sidecar build.\", \"draft\": false, \"prerelease\": false}" \
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated sidecar build.\", \"draft\": false, \"prerelease\": false}" \
|
||||||
"${REPO_API}/releases"
|
"${REPO_API}/releases"
|
||||||
echo "Created release: ${RELEASE_NAME}"
|
echo "Created release: ${RELEASE_NAME}"
|
||||||
|
|
||||||
|
- name: Trigger per-OS sidecar builds
|
||||||
|
if: steps.check_changes.outputs.has_changes == 'true'
|
||||||
|
env:
|
||||||
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
|
run: |
|
||||||
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
TAG="${{ steps.bump.outputs.tag }}"
|
||||||
|
|
||||||
|
for workflow in build-sidecar-linux.yml build-sidecar-windows.yml build-sidecar-macos.yml; do
|
||||||
|
echo "Dispatching ${workflow} for ${TAG}..."
|
||||||
|
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" -X POST \
|
||||||
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"ref\": \"main\", \"inputs\": {\"tag\": \"${TAG}\"}}" \
|
||||||
|
"${REPO_API}/actions/workflows/${workflow}/dispatches")
|
||||||
|
echo " -> HTTP ${HTTP_CODE}"
|
||||||
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user