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)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. v1.4.5)'
|
||||
required: false
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -20,11 +17,8 @@ jobs:
|
||||
- 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="${{ github.event.inputs.tag }}"
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||
fi
|
||||
echo "Building for tag: ${TAG}"
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Build App (macOS)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. v1.4.5)'
|
||||
required: false
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
@@ -20,11 +17,8 @@ jobs:
|
||||
- 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="${{ github.event.inputs.tag }}"
|
||||
if [ -z "$TAG" ]; then
|
||||
TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||')
|
||||
fi
|
||||
echo "Building for tag: ${TAG}"
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Build App (Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. v1.4.5)'
|
||||
required: false
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
@@ -21,20 +18,12 @@ jobs:
|
||||
id: tag
|
||||
shell: powershell
|
||||
run: |
|
||||
$inputTag = "${{ github.event.inputs.tag }}"
|
||||
$ref = "${{ github.ref }}"
|
||||
$refName = "${{ github.ref_name }}"
|
||||
|
||||
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/', ''
|
||||
$TAG = "${{ github.event.inputs.tag }}"
|
||||
if (-not $TAG) {
|
||||
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
||||
}
|
||||
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
|
||||
with:
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Build Sidecar (Linux)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'sidecar-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: false
|
||||
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-sidecar-linux:
|
||||
@@ -20,11 +17,8 @@ jobs:
|
||||
- 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="${{ github.event.inputs.tag }}"
|
||||
if [ -z "$TAG" ]; then
|
||||
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}"
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
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
|
||||
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-sidecar-macos:
|
||||
@@ -20,11 +17,8 @@ jobs:
|
||||
- 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="${{ github.event.inputs.tag }}"
|
||||
if [ -z "$TAG" ]; then
|
||||
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}"
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Build Sidecar (Windows)
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'sidecar-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: false
|
||||
description: 'Sidecar release tag to build (e.g. sidecar-v1.0.3)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
build-sidecar-windows:
|
||||
@@ -21,20 +18,12 @@ jobs:
|
||||
id: tag
|
||||
shell: powershell
|
||||
run: |
|
||||
$inputTag = "${{ github.event.inputs.tag }}"
|
||||
$ref = "${{ github.ref }}"
|
||||
$refName = "${{ github.ref_name }}"
|
||||
|
||||
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/', ''
|
||||
$TAG = "${{ github.event.inputs.tag }}"
|
||||
if (-not $TAG) {
|
||||
$TAG = (git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | Select-Object -First 1) -replace '.*refs/tags/', ''
|
||||
}
|
||||
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
|
||||
with:
|
||||
|
||||
@@ -25,11 +25,9 @@ jobs:
|
||||
- name: Bump patch version
|
||||
id: bump
|
||||
run: |
|
||||
# Read current version from package.json
|
||||
CURRENT=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||
echo "Current version: ${CURRENT}"
|
||||
|
||||
# Increment patch number
|
||||
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
||||
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
||||
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
||||
@@ -37,16 +35,9 @@ jobs:
|
||||
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
echo "New version: ${NEW_VERSION}"
|
||||
|
||||
# Update 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
|
||||
|
||||
# Update 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_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}" \
|
||||
"${REPO_API}/releases"
|
||||
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
|
||||
id: check_changes
|
||||
run: |
|
||||
# If triggered by workflow_dispatch, always build
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
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 "")
|
||||
if [ -n "$CHANGED" ]; then
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
@@ -53,11 +51,9 @@ jobs:
|
||||
if: steps.check_changes.outputs.has_changes == 'true'
|
||||
id: bump
|
||||
run: |
|
||||
# Read current version from pyproject.toml
|
||||
CURRENT=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
|
||||
echo "Current sidecar version: ${CURRENT}"
|
||||
|
||||
# Increment patch number
|
||||
MAJOR=$(echo "${CURRENT}" | cut -d. -f1)
|
||||
MINOR=$(echo "${CURRENT}" | cut -d. -f2)
|
||||
PATCH=$(echo "${CURRENT}" | cut -d. -f3)
|
||||
@@ -65,10 +61,7 @@ jobs:
|
||||
NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}"
|
||||
echo "New sidecar version: ${NEW_VERSION}"
|
||||
|
||||
# Update 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_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}" \
|
||||
"${REPO_API}/releases"
|
||||
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