Skip to content

Commit a43674d

Browse files
TrueNineclaude
andcommitted
fix(ci): replace tag trigger with workflow_call for GUI release
CLI workflow now directly calls GUI workflow via workflow_call with explicit version input, eliminating the indirect tag-based chaining and the redundant check-version job. Closes #3 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c15f387 commit a43674d

File tree

2 files changed

+31
-46
lines changed

2 files changed

+31
-46
lines changed

.github/workflows/release-cli.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ on:
1010
- main
1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: write
15+
1316
jobs:
1417
release-cli:
1518
runs-on: ubuntu-24.04
19+
outputs:
20+
publish: ${{ steps.check.outputs.publish }}
21+
version: ${{ steps.check.outputs.version }}
1622
steps:
1723
- uses: actions/checkout@v4
1824
with:
@@ -95,3 +101,11 @@ jobs:
95101
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
96102
git tag "v${version}"
97103
git push origin "v${version}"
104+
105+
release-gui:
106+
needs: release-cli
107+
if: needs.release-cli.outputs.publish == 'true'
108+
uses: ./.github/workflows/release-gui.yml
109+
with:
110+
version: ${{ needs.release-cli.outputs.version }}
111+
secrets: inherit

.github/workflows/release-gui.yml

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,27 @@
11
name: Release GUI
22

33
concurrency:
4-
group: ${{ github.workflow }}-${{ github.ref }}
4+
group: ${{ github.workflow }}-${{ inputs.version || github.run_id }}
55
cancel-in-progress: true
66

77
on:
8-
push:
9-
tags:
10-
- 'v*'
8+
workflow_call:
9+
inputs:
10+
version:
11+
required: true
12+
type: string
1113
workflow_dispatch:
14+
inputs:
15+
version:
16+
description: 'Version to release (without v prefix, e.g. 2026.10213.0)'
17+
required: true
18+
type: string
1219

1320
permissions:
1421
contents: write
1522

1623
jobs:
17-
check-version:
18-
runs-on: ubuntu-24.04
19-
outputs:
20-
version: ${{ steps.version.outputs.version }}
21-
release_exists: ${{ steps.check-release.outputs.exists }}
22-
steps:
23-
- uses: actions/checkout@v4
24-
25-
- name: Get version
26-
id: version
27-
run: |
28-
if [[ "${{ github.ref_type }}" == "tag" ]]; then
29-
version="${{ github.ref_name }}"
30-
version="${version#v}"
31-
else
32-
version=$(jq -r '.version' cli/package.json)
33-
fi
34-
echo "version=$version" >> "$GITHUB_OUTPUT"
35-
36-
- name: Check GitHub Release exists
37-
id: check-release
38-
env:
39-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
run: |
41-
version=${{ steps.version.outputs.version }}
42-
if gh release view "v${version}" &> /dev/null; then
43-
echo "Release v${version} already exists, skipping"
44-
echo "exists=true" >> "$GITHUB_OUTPUT"
45-
else
46-
echo "Release v${version} does not exist, will build and publish"
47-
echo "exists=false" >> "$GITHUB_OUTPUT"
48-
fi
49-
5024
build-gui:
51-
needs: check-version
52-
if: needs.check-version.outputs.release_exists != 'true'
5325
strategy:
5426
fail-fast: false
5527
matrix:
@@ -121,14 +93,14 @@ jobs:
12193
- name: Install workspace dependencies
12294
run: pnpm install --frozen-lockfile
12395

124-
- name: Sync Tauri version from package.json
96+
- name: Sync Tauri version from CLI
12597
shell: bash
12698
run: |
127-
version=$(jq -r '.version' cli/package.json)
99+
version="${{ inputs.version }}"
128100
sed -i.bak "s/^version = \".*\"/version = \"${version}\"/" gui/src-tauri/Cargo.toml
129101
rm -f gui/src-tauri/Cargo.toml.bak
130102
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
131-
echo "Synced Cargo.toml and tauri.conf.json version to ${version}"
103+
echo "Synced version to ${version}"
132104
133105
- name: Clean old bundle artifacts
134106
shell: bash
@@ -154,8 +126,7 @@ jobs:
154126
if-no-files-found: error
155127

156128
publish-release:
157-
needs: [check-version, build-gui]
158-
if: always() && needs.check-version.outputs.release_exists != 'true' && needs.build-gui.result == 'success'
129+
needs: build-gui
159130
runs-on: ubuntu-24.04
160131
steps:
161132
- name: Download all artifacts
@@ -172,8 +143,8 @@ jobs:
172143
- name: Publish Release
173144
uses: softprops/action-gh-release@v2.5.0
174145
with:
175-
tag_name: v${{ needs.check-version.outputs.version }}
176-
name: v${{ needs.check-version.outputs.version }}
146+
tag_name: v${{ inputs.version }}
147+
name: v${{ inputs.version }}
177148
files: |
178149
artifacts/**/*.dmg
179150
artifacts/**/*.exe

0 commit comments

Comments
 (0)