From 1081de2b3051ea36400be02828bfe65a921ea6ff Mon Sep 17 00:00:00 2001 From: skykooler Date: Wed, 18 Dec 2024 22:48:55 -0500 Subject: [PATCH] Make windows build cooperate better --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3726c2..4b50f1f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,25 @@ jobs: sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - name: Set version for Windows build + run: | + # Get the version from the Git tag (e.g., v0.6.3-alpha) + VERSION=$(echo ${GITHUB_REF#refs/tags/}) + + # Replace '-alpha' with '-0' and '-beta' with '-1' only for Windows version + if [[ $VERSION == *"-alpha"* ]]; then + WINDOWS_VERSION=${VERSION%-alpha}-0 + elif [[ $VERSION == *"-beta"* ]]; then + WINDOWS_VERSION=${VERSION%-beta}-1 + else + WINDOWS_VERSION=$VERSION # Keep the same version for non-alpha/beta tags + fi + + # Copy tauri.conf.json to tauri.windows.conf.json and substitute version number for Windows + cp src-tauri/tauri.conf.json src-tauri/tauri.windows.conf.json + sed -i "s/\"version\": \".*\"/\"version\": \"${WINDOWS_VERSION}\"/" src-tauri/tauri.windows.conf.json + + - name: setup pnpm uses: pnpm/action-setup@v2 with: @@ -58,13 +77,13 @@ jobs: # If you don't have `beforeBuildCommand` configured you may want to build your frontend here too. run: pnpm install # change this to npm or pnpm depending on which one you use. - - uses: tauri-apps/tauri-action@v0 + - name: Create Release with Tauri Action + uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. - releaseName: 'App v__VERSION__' + tagName: "app-v${VERSION}" # Use the original version tag for the release + releaseName: "App v${VERSION}" releaseBody: 'See the assets to download this version and install.' - releaseDraft: true - prerelease: false - args: ${{ matrix.args }} + releaseDraft: false # Set to true if you want the release to be a draft + prerelease: true