diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 96fec32..49e0fb2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,7 @@ jobs: $buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0'); $versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)"; $branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_",""); - $versionSuffixBRANCH = "$branchName.$buildId"; + $versionSuffixBRANCH = "$branchName-$buildId"; $isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/'); $isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne "" $versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } }; @@ -27,21 +27,22 @@ jobs: inputs: pathtoPublish: 'bin' artifactName: 'nupkgs' - - task: NuGetCommand@2 - condition: succeeded() - inputs: - command: push - nuGetFeedType: external - publishFeedCredentials: 'Jet-MyGet' - versioningScheme: byEnvVar - versionEnvVar: Version - packagesToPush: 'bin/*.nupkg;bin/*.symbols.nupkg' - job: Linux pool: - vmImage: 'ubuntu-16.04' + vmImage: 'ubuntu-16.04' steps: - script: echo "##vso[task.setvariable variable=FrameworkPathOverride]$(dirname $(which mono))/../lib/mono/4.5/" displayName: Workaround .NET reference assemblies on linux + - powershell: | + $buildId = $env:BUILD_BUILDNUMBER.PadLeft(7, '0'); + $versionSuffixPR = "ci-$buildId-pr$($env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER)"; + $branchName = "$env:BUILD_SOURCEBRANCHNAME".Replace("_",""); + $versionSuffixBRANCH = "$branchName-$buildId"; + $isTag = "$env:BUILD_SOURCEBRANCH".StartsWith('refs/tags/'); + $isPR = "$env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" -ne "" + $versionSuffix = if ($isTag) { "" } else { if ($isPR) { $versionSuffixPR } else { $versionSuffixBRANCH } }; + Write-Host "##vso[task.setvariable variable=VersionSuffix]$versionSuffix"; + displayName: compute VersionSuffix - script: dotnet msbuild build.proj displayName: Test + Build - task: PublishTestResults@2 @@ -49,6 +50,15 @@ jobs: testResultsFormat: 'VSTest' testResultsFiles: 'tests/**/*.trx' condition: succeededOrFailed() + - task: NuGetCommand@2 + condition: succeededOrFailed() + inputs: + command: push + nuGetFeedType: external + publishFeedCredentials: 'Jet-MyGet' + versioningScheme: byEnvVar + versionEnvVar: Version + packagesToPush: 'bin/*.nupkg;bin/*.symbols.nupkg' - job: MacOS pool: vmImage: 'macOS-10.13'