Skip to content

Commit

Permalink
Fix version patching
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaex committed Jan 21, 2024
1 parent 33ef841 commit 6e7b5b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

env:
SOLUTION_FILE_PATH: ShareX.sln
ASSEMBLY_INFO_PATH: GlobalAssemblyInfo.cs
ASSEMBLY_INFO_PATH: Directory.build.props

outputs:
APP_VERSION: ${{ env.APP_VERSION }}
Expand All @@ -48,12 +48,12 @@ jobs:
- name: Set APP_VERSION
run: |
$content = Get-Content "${{ env.ASSEMBLY_INFO_PATH }}" -Raw
$pattern = 'Version\("([0-9]+(?:\.[0-9]+){1,3})"\)'
$pattern = '<Version>([0-9]+(?:\.[0-9]+){1,3})</Version>'
$match = [regex]::Match($content, $pattern)
$version = $match.Groups[1].Value
if ($env:GITHUB_REF -eq "refs/heads/develop") {
$version = "$version.$env:GITHUB_RUN_NUMBER"
$content = [regex]::Replace($content, $pattern, "Version(`"$version`")")
$content = [regex]::Replace($content, $pattern, "<Version>$version</Version>")
Set-Content -Path "${{ env.ASSEMBLY_INFO_PATH }}" -Value "$content" -NoNewline
}
echo $version
Expand Down

0 comments on commit 6e7b5b9

Please sign in to comment.