From 22268fc94592b86f7e004cf30979b7a1177e6e2c Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Fri, 30 Sep 2022 21:57:28 +0100 Subject: [PATCH] CI - Allow for non-master nugets, manually. --- .github/workflows/nuget.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nuget.yml b/.github/workflows/nuget.yml index 2ee196d62..b6fe9fb50 100644 --- a/.github/workflows/nuget.yml +++ b/.github/workflows/nuget.yml @@ -21,9 +21,12 @@ jobs: shell: pwsh run: | $MidnightUtc = [DateTime]::UtcNow.Date + $BranchName = "${{ github.ref_name }}".replace('/','-').replace('.','-') $ApiVersion = (Select-Xml -Path 'src/Artemis.Core/Artemis.Core.csproj' -XPath '//PluginApiVersion').Node.InnerText $NumberOfCommitsToday = (git log --after=$($MidnightUtc.ToString("o")) --oneline | Measure-Object -Line).Lines $VersionNumber = "$ApiVersion.$($MidnightUtc.ToString("yyyy.MMdd")).$NumberOfCommitsToday" + # If we're not in master, add the branch name to the version so it counts as prerelease + if ($BranchName -ne "master") { $VersionNumber += "-$BranchName" } Write-Output "::set-output name=version-number::$VersionNumber" nuget: