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>
84 lines
3.1 KiB
YAML
84 lines
3.1 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
bump-version:
|
|
name: Bump version and tag
|
|
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
new_version: ${{ steps.bump.outputs.new_version }}
|
|
tag: ${{ steps.bump.outputs.tag }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config user.name "Gitea Actions"
|
|
git config user.email "actions@gitea.local"
|
|
|
|
- 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)
|
|
NEW_PATCH=$((PATCH + 1))
|
|
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
|
|
|
|
echo "new_version=${NEW_VERSION}" >> $GITHUB_OUTPUT
|
|
echo "tag=v${NEW_VERSION}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit and tag
|
|
env:
|
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
|
run: |
|
|
NEW_VERSION="${{ steps.bump.outputs.new_version }}"
|
|
git add package.json src-tauri/tauri.conf.json src-tauri/Cargo.toml version.py
|
|
git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
|
|
git tag "v${NEW_VERSION}"
|
|
|
|
REMOTE_URL=$(git remote get-url origin | sed "s|://|://gitea-actions:${BUILD_TOKEN}@|")
|
|
git pull --rebase "${REMOTE_URL}" main || true
|
|
git push "${REMOTE_URL}" HEAD:main
|
|
git push "${REMOTE_URL}" "v${NEW_VERSION}"
|
|
|
|
- name: Create Gitea release
|
|
env:
|
|
BUILD_TOKEN: ${{ secrets.BUILD_TOKEN }}
|
|
run: |
|
|
REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
|
TAG="${{ steps.bump.outputs.tag }}"
|
|
RELEASE_NAME="Local Transcription ${TAG}"
|
|
|
|
curl -s -X POST \
|
|
-H "Authorization: token ${BUILD_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${RELEASE_NAME}\", \"body\": \"Automated build.\", \"draft\": false, \"prerelease\": false}" \
|
|
"${REPO_API}/releases"
|
|
echo "Created release: ${RELEASE_NAME}"
|