diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef68e0d..1849461 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,20 @@ jobs: node-version: 'lts/*' cache: 'npm' + # get part of the tag after the `v` + - name: Extract tag version number + id: get_version + uses: battila7/get-version-action@v2 + + - name: Change package.json version to the tag version + id: info + uses: jaywcjlove/github-action-package@main + with: + version: ${{steps.get_version.outputs.version-without-v}} + - name: Install frontend dependencies + env: + VERSION: ${{steps.get_version.outputs.version-without-v}} run: npm install - name: Build the app diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 40079e3..e06f83c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,8 @@ "distDir": "../build" }, "package": { - "productName": "pf2ools" + "productName": "pf2ools", + "version": "../package.json" }, "tauri": { "allowlist": { diff --git a/svelte.config.js b/svelte.config.js index 2310c51..4ca288e 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -22,6 +22,13 @@ const config = { }, kit: { + version: { + // Not sure whether I should reverse the logic here. + // Currently we are using the version from the environment variable, which has to be set outside. + // This is meant to allow to have "no version" as per debug builds (next.pf2oo.ls) and "version" as per release builds + // But we might want to instead have the versions by default and build timestamp with a debug flag. But then this can cause issues in terms of what version is what. + name: process.env.VERSION ?? undefined, + }, adapter: adapter({ fallback: '404.html', }),