11name : Release GUI
22
33concurrency :
4- group : ${{ github.workflow }}-${{ github.ref }}
4+ group : ${{ github.workflow }}-${{ inputs.version || github.run_id }}
55 cancel-in-progress : true
66
77on :
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
1320permissions :
1421 contents : write
1522
1623jobs :
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