Patch AssemblyInfo version

This commit is contained in:
Jaex 2023-01-16 02:25:57 +03:00
parent 69ca568501
commit 99b21e47c0

View file

@ -43,11 +43,16 @@ jobs:
- name: Get app version
id: get_app_version
if: matrix.configuration == 'Release'
run: |
$content = Get-Content "${{ env.ASSEMBLY_INFO_PATH }}"
$match = [regex]::Match($content, 'AssemblyVersion\("([0-9]+(?:\.[0-9]+){1,3})"\)')
$content = Get-Content "${{ env.ASSEMBLY_INFO_PATH }}" -Raw
$pattern = 'Version\("([0-9]+(?:\.[0-9]+){1,3})"\)'
$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`")")
Set-Content -Path "${{ env.ASSEMBLY_INFO_PATH }}" -Value "$content" -NoNewline
}
echo $version
echo "APP_VERSION=$version" >> $env:GITHUB_OUTPUT
@ -191,8 +196,8 @@ jobs:
with:
repository: ${{ env.REPO_DEV_BUILDS }}
token: ${{ env.CUSTOM_GITHUB_TOKEN }}
tag_name: v${{ env.APP_VERSION }}.${{ github.run_number }}
name: ShareX ${{ env.APP_VERSION }}.${{ github.run_number }} Dev
tag_name: v${{ env.APP_VERSION }}
name: ShareX ${{ env.APP_VERSION }} Dev
body_path: ${{ env.RELEASE_BODY_PATH }}
draft: false
prerelease: false