Skip to content

Commit

Permalink
Fix package version calculation
Browse files Browse the repository at this point in the history
Set $NUGET_PACKAGE_VERSION with the calculated value
  • Loading branch information
anaiberta authored Oct 17, 2023
1 parent 4824d6b commit 224e4ec
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 @@ -60,17 +60,17 @@ jobs:
$COMMIT_MESSAGE = $(git log -1 --pretty=%B)
$LAST_COMMITTER = $(git log -1 --pretty=format:%an)
$GetFileVersionOutput = dotnet msbuild Directory.Build.props /t:GetFileVersionForPackage /p:COMMIT_NUMBER=$COMMIT_NUMBER
$GetFileVersionOutput = dotnet msbuild ./Directory.Build.props /t:GetFileVersionForPackage /p:COMMIT_NUMBER=$COMMIT_NUMBER /p:VersionSuffix="" /p:UseDefaultSuffix=false
"$GetFileVersionOutput" -match "(?<=FileVersion:)(.*)" > $null
$GetFileVersionOutput = $Matches[0]
$NUGET_PACKAGE_VERSION = $Matches[0]
if ($IsPrerelease -eq $true) {
$VersionTag = @("trunk", "stable")[$IsMaster]
$Timestamp = (Get-Date -AsUTC).ToString("yyyyMMddHHmmss")
$NUGET_PACKAGE_VERSION = $NUGET_PACKAGE_VERSION + "-" + $VersionTag + "." + $Timestamp
}
Write-Output "Packge version to be used: $NUGET_PACKAGE_VERSION"
Write-Output "Pacakge version to be used: $NUGET_PACKAGE_VERSION"
echo "NUGET_PACKAGE_VERSION=$NUGET_PACKAGE_VERSION" >> $env:GITHUB_ENV
echo "IsPrerelease=$IsPrerelease" >> $env:GITHUB_ENV
echo "NUGET_PACKAGE_VERSION=$NUGET_PACKAGE_VERSION" >> $env:GITHUB_OUTPUT
Expand Down

0 comments on commit 224e4ec

Please sign in to comment.