Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ on:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
release-cli:
runs-on: ubuntu-24.04
outputs:
publish: ${{ steps.check.outputs.publish }}
version: ${{ steps.check.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -95,3 +101,11 @@ jobs:
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag "v${version}"
git push origin "v${version}"

release-gui:
needs: release-cli
if: needs.release-cli.outputs.publish == 'true'
uses: ./.github/workflows/release-gui.yml
with:
version: ${{ needs.release-cli.outputs.version }}
secrets: inherit
63 changes: 17 additions & 46 deletions .github/workflows/release-gui.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
name: Release GUI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ inputs.version || github.run_id }}
cancel-in-progress: true

on:
push:
tags:
- 'v*'
workflow_call:
inputs:
version:
required: true
type: string
workflow_dispatch:
inputs:
version:
description: 'Version to release (without v prefix, e.g. 2026.10213.0)'
required: true
type: string

permissions:
contents: write

jobs:
check-version:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.version.outputs.version }}
release_exists: ${{ steps.check-release.outputs.exists }}
steps:
- uses: actions/checkout@v4

- name: Get version
id: version
run: |
if [[ "${{ github.ref_type }}" == "tag" ]]; then
version="${{ github.ref_name }}"
version="${version#v}"
else
version=$(jq -r '.version' cli/package.json)
fi
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Check GitHub Release exists
id: check-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version=${{ steps.version.outputs.version }}
if gh release view "v${version}" &> /dev/null; then
echo "Release v${version} already exists, skipping"
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "Release v${version} does not exist, will build and publish"
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

build-gui:
needs: check-version
if: needs.check-version.outputs.release_exists != 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -121,14 +93,14 @@ jobs:
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile

- name: Sync Tauri version from package.json
- name: Sync Tauri version from CLI
shell: bash
run: |
version=$(jq -r '.version' cli/package.json)
version="${{ inputs.version }}"
sed -i.bak "s/^version = \".*\"/version = \"${version}\"/" gui/src-tauri/Cargo.toml
rm -f gui/src-tauri/Cargo.toml.bak
jq --arg v "$version" '.version = $v' gui/src-tauri/tauri.conf.json > gui/src-tauri/tauri.conf.tmp && mv gui/src-tauri/tauri.conf.tmp gui/src-tauri/tauri.conf.json
echo "Synced Cargo.toml and tauri.conf.json version to ${version}"
echo "Synced version to ${version}"

- name: Clean old bundle artifacts
shell: bash
Expand All @@ -154,8 +126,7 @@ jobs:
if-no-files-found: error

publish-release:
needs: [check-version, build-gui]
if: always() && needs.check-version.outputs.release_exists != 'true' && needs.build-gui.result == 'success'
needs: build-gui
runs-on: ubuntu-24.04
steps:
- name: Download all artifacts
Expand All @@ -172,8 +143,8 @@ jobs:
- name: Publish Release
uses: softprops/action-gh-release@v2.5.0
with:
tag_name: v${{ needs.check-version.outputs.version }}
name: v${{ needs.check-version.outputs.version }}
tag_name: v${{ inputs.version }}
name: v${{ inputs.version }}
files: |
artifacts/**/*.dmg
artifacts/**/*.exe
Expand Down
Loading