1- name : Tauri Draft Release
1+ name : Tauri Release
22
33on :
44 push :
@@ -10,19 +10,23 @@ permissions:
1010 contents : write
1111
1212jobs :
13- publish -tauri :
13+ build -tauri :
1414 strategy :
1515 fail-fast : false
1616 matrix :
1717 include :
1818 - platform : " ubuntu-latest"
1919 args : " "
20+ artifact_name : " updater-json-linux"
2021 - platform : " windows-latest"
2122 args : " --target x86_64-pc-windows-msvc --no-sign"
23+ artifact_name : " updater-json-windows"
2224 - platform : " macos-latest"
2325 args : " --target aarch64-apple-darwin --no-sign"
26+ artifact_name : " updater-json-macos-aarch64"
2427 - platform : " macos-latest"
2528 args : " --target x86_64-apple-darwin --no-sign"
29+ artifact_name : " updater-json-macos-x64"
2630
2731 runs-on : ${{ matrix.platform }}
2832
@@ -66,10 +70,89 @@ jobs:
6670 uses : tauri-apps/tauri-action@v0
6771 env :
6872 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
73+ TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
74+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
6975 with :
7076 tagName : v__VERSION__
7177 releaseName : " DeepLab v__VERSION__"
72- releaseBody : " Draft release build for DeepLab v__VERSION__."
73- releaseDraft : true
78+ releaseBody : " Automated release build for DeepLab v__VERSION__."
79+ releaseDraft : false
7480 prerelease : false
81+ uploadUpdaterJson : false
7582 args : ${{ matrix.args }}
83+
84+ - name : Collect updater json fragments
85+ shell : bash
86+ run : |
87+ mkdir -p updater-json
88+ latest_path="$(find src-tauri/target -type f -name latest.json | head -n1)"
89+ test -n "$latest_path"
90+ cp "$latest_path" "updater-json/${{ matrix.artifact_name }}.json"
91+ ls -la updater-json
92+
93+ - name : Upload updater json fragments
94+ uses : actions/upload-artifact@v4
95+ with :
96+ name : ${{ matrix.artifact_name }}
97+ path : updater-json/${{ matrix.artifact_name }}.json
98+ if-no-files-found : error
99+
100+ merge-updater-json :
101+ needs : build-tauri
102+ runs-on : ubuntu-latest
103+ steps :
104+ - name : Download updater json fragments
105+ uses : actions/download-artifact@v4
106+ with :
107+ path : updater-json-fragments
108+ pattern : updater-json-*
109+ merge-multiple : true
110+
111+ - name : Merge latest.json from all platforms
112+ shell : bash
113+ run : |
114+ node <<'NODE'
115+ const fs = require("fs");
116+ const path = require("path");
117+ const dir = "updater-json-fragments";
118+ const files = fs.readdirSync(dir).filter((f) => f.endsWith(".json"));
119+ if (files.length === 0) {
120+ throw new Error("No updater latest.json fragments found");
121+ }
122+ let base = null;
123+ const mergedPlatforms = {};
124+ for (const file of files) {
125+ const fullPath = path.join(dir, file);
126+ const json = JSON.parse(fs.readFileSync(fullPath, "utf8"));
127+ if (!base) {
128+ base = {
129+ version: json.version,
130+ notes: json.notes ?? "",
131+ pub_date: json.pub_date,
132+ platforms: {},
133+ };
134+ }
135+ if (json.platforms && typeof json.platforms === "object") {
136+ Object.assign(mergedPlatforms, json.platforms);
137+ }
138+ }
139+ base.platforms = mergedPlatforms;
140+ if (Object.keys(base.platforms).length === 0) {
141+ throw new Error("Merged latest.json has no platforms");
142+ }
143+ fs.writeFileSync("latest.json", JSON.stringify(base, null, 2));
144+ console.log(`Merged platforms: ${Object.keys(base.platforms).join(", ")}`);
145+ NODE
146+ cat latest.json
147+
148+ - name : Upload merged latest.json to release
149+ uses : softprops/action-gh-release@v2
150+ env :
151+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
152+ with :
153+ tag_name : ${{ github.ref_name }}
154+ files : latest.json
155+ overwrite_files : true
156+ make_latest : true
157+ draft : false
158+ prerelease : false
0 commit comments