From 175f6e6fda9252e81bb79913ceccd0c61c390253 Mon Sep 17 00:00:00 2001 From: skykooler Date: Thu, 19 Dec 2024 00:00:22 -0500 Subject: [PATCH] Fix powershel --- .github/workflows/main.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18d11f6..e825a0a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,12 +34,12 @@ jobs: sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf - name: Set version for Windows build - if: matrix.platform == 'windows-latest' + if: matrix.platform == 'windows-latest' # Only run on Windows shell: pwsh # Use PowerShell on Windows runners run: | # Get the version from the Git tag (e.g., v0.6.3-alpha) $VERSION = ${GITHUB_REF.Substring('refs/tags/'.Length)} - + # Replace '-alpha' with '-0' and '-beta' with '-1' only for Windows version if ($VERSION -match "-alpha") { $WINDOWS_VERSION = $VERSION -replace "-alpha$", "-0" @@ -48,14 +48,19 @@ jobs: } else { $WINDOWS_VERSION = $VERSION } - + # Copy tauri.conf.json to tauri.windows.conf.json and substitute version number for Windows Copy-Item src-tauri/tauri.conf.json -Destination src-tauri/tauri.windows.conf.json - (Get-Content src-tauri/tauri.windows.conf.json) | ForEach-Object { $_ -replace '"version": ".*"', '"version": "' + $WINDOWS_VERSION + '"' } | Set-Content src-tauri/tauri.windows.conf.json - + + # Modify the version in tauri.windows.conf.json + (Get-Content src-tauri/tauri.windows.conf.json) | ForEach-Object { + $_ -replace '"version": ".*"', ('"version": "' + $WINDOWS_VERSION + '"') + } | Set-Content src-tauri/tauri.windows.conf.json + # Export the Windows version for use in subsequent steps echo "WINDOWS_VERSION=$WINDOWS_VERSION" >> $env:GITHUB_ENV + - name: Set version for all platforms run: | # Extract the version from the Git tag (it should be the same across platforms)