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`. diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index 4a21354..dcd3c80 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);