Make windows build cooperate better

This commit is contained in:
skykooler 2024-12-18 22:48:55 -05:00 committed by GitHub
parent da4797bdc8
commit 1081de2b30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 6 deletions

View File

@ -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