1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

CI - Allow for non-master nugets, manually.

This commit is contained in:
Diogo Trindade 2022-09-30 21:57:28 +01:00 committed by RobertBeekman
parent 3758275b71
commit 22268fc945

View File

@ -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: