From ebc0aa4b8336013bb8af257ccd81cd757b82307d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Wed, 27 Nov 2024 12:57:37 +0800 Subject: [PATCH 1/2] ci(tauri): fix tauri version --- .../workflows/covector-version-or-publish.yml | 3 +++ scripts/bump.mjs | 22 ++++++++++++++++++- src-tauri/Cargo.lock | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 2bb35fc..6c74eec 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -131,6 +131,9 @@ jobs: - name: Build TailwindCSS run: pnpx tailwindcss -i ./input.css -o ./src/assets/tailwind.css + - name: Bump Tauri version + run: pnpm version:bump tauri --version ${{ needs.version-or-publish.outputs.version }} + - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/bump.mjs b/scripts/bump.mjs index e22bc0c..01acce7 100644 --- a/scripts/bump.mjs +++ b/scripts/bump.mjs @@ -1,5 +1,5 @@ import { defineCommand, run } from "archons"; -import { writeFileSync } from "fs"; +import { readFileSync, writeFileSync } from "fs"; const bump = defineCommand({ meta: { @@ -10,11 +10,31 @@ const bump = defineCommand({ version: { type: "option", parser: "string", + global: true, }, }, callback: (ctx) => { writeFileSync(".version", ctx.args.version); }, + subcommands: { + tauri: { + meta: { + name: "tauri", + styled: true, + }, + options: {}, + callback: (ctx) => { + const tauriConfig = JSON.parse( + readFileSync("./src-tauri/tauri.conf.json", "utf-8") + ); + tauriConfig.version = ctx.args.version; + writeFileSync( + "./src-tauri/tauri.conf.json", + JSON.stringify(tauriConfig, null, 2) + ); + }, + }, + }, }); run(bump); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 06b0e9d..9a3ab46 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -28,7 +28,7 @@ dependencies = [ [[package]] name = "algohub" -version = "0.1.1-nightly.10" +version = "0.1.1-nightly.11" dependencies = [ "serde", "serde_json", From 52dc917d8702552da109a3cd012da3caef46257d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=90=91=E5=A4=9C?= Date: Wed, 27 Nov 2024 12:59:38 +0800 Subject: [PATCH 2/2] chore: bump version --- .changes/fix-tauri-version.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/fix-tauri-version.md diff --git a/.changes/fix-tauri-version.md b/.changes/fix-tauri-version.md new file mode 100644 index 0000000..31cf383 --- /dev/null +++ b/.changes/fix-tauri-version.md @@ -0,0 +1,5 @@ +--- +"algohub": patch:fix +--- + +Automatic update of version for `tauri.conf.json`.