Skip to content

Commit

Permalink
windows get semver version
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Dec 12, 2023
1 parent 082b9ad commit b98068d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/tauri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,24 @@ jobs:
sudo npm install -g pxt
npm ci
- name: Update Tauri version in tauri.conf.json
- name: Update Tauri version in tauri.conf.json (ubuntu & macos)
if: matrix.platform != 'windows-latest'
run: |
# Extract version without 'v' prefix
VERSION=$(echo "v6.0.27.6" | sed 's/v//; s/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/')
echo $VERSION
# Extract semver version
VERSION=$(echo "${{ github.ref_name }}" | sed 's/v//; s/^\([0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/')
# Update tauri.conf.json with the new version
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" src-tauri/tauri.conf.json
- name: Update Tauri version in tauri.conf.json (windows)
if: matrix.platform == 'windows-latest'
run: |
# Extract semver version
$version = "${{ github.ref_name }}" -replace '^v(\d+\.\d+\.\d+).*$', '$1'
# Update tauri.conf.json with the new version
(Get-Content -Path "src-tauri/tauri.conf.json") -replace '"version": ".*"', "`"version`": `"$version`"" | Set-Content -Path "src-tauri/tauri.conf.json"
- name: Build the app
uses: tauri-apps/tauri-action@v0

Expand Down

0 comments on commit b98068d

Please sign in to comment.