Skip to content
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.

Commit

Permalink
Update msptool.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hzarki authored Sep 10, 2024
1 parent 53ce0c4 commit 2f4c796
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions .github/workflows/msptool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,21 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Update version number
shell: pwsh
run: |
version=$(cat ${{ env.Version_File }})
IFS='.' read -r -a version_parts <<< "$version"
major=${version_parts[0]}
minor=${version_parts[1]}
patch=${version_parts[2]}
build=${version_parts[3]}
build=$((build + 1))
new_version="$major.$minor.$patch.$build"
echo "$new_version" > ${{ env.Version_File }}
sed -i "s/private static readonly string vloc1 = \".*\";/private static readonly string vloc1 = \"$new_version\";/" ${{ env.Program_File }}
$version = Get-Content $env:Version_File
$version_parts = $version -split '\.'
$major = $version_parts[0]
$minor = $version_parts[1]
$patch = $version_parts[2]
$build = [int]$version_parts[3] + 1
$new_version = "$major.$minor.$patch.$build"
Set-Content -Path $env:Version_File -Value $new_version
(Get-Content $env:Program_File) -replace 'private static readonly string vloc1 = ".*";', "private static readonly string vloc1 = `"$new_version`";" | Set-Content -Path $env:Program_File
- name: Commit version updates
run: |
Expand All @@ -75,7 +74,7 @@ jobs:
with:
files: ${{ env.Solution_Directory }}/**/bin/${{ matrix.configuration }}/**
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 2f4c796

Please sign in to comment.