Skip to content

Commit

Permalink
Fix the build versionning
Browse files Browse the repository at this point in the history
  • Loading branch information
GillesTourreau authored Oct 10, 2023
1 parent 4ef8c62 commit d3c5ffa
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions build/azure-pipelines-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:
type: string
default: 1.0.0
- name: VersionSuffix
displayName: The version suffix of the library (rc.1)
displayName: The version suffix of the library (rc.1). Use a space ' ' if no suffix.
type: string
default: rc.1

Expand All @@ -23,7 +23,15 @@ jobs:
displayName: Update build number
inputs:
targetType: 'inline'
script: 'Write-Host "##vso[build.updatebuildnumber]${{parameters.VersionPrefix}}-${{parameters.VersionSuffix}}"'
script: '
if ("${{parameters.VersionSuffix}}".Trim() -eq "")
{
Write-Host "##vso[build.updatebuildnumber]${{parameters.VersionPrefix}}"
}
else
{
Write-Host "##vso[build.updatebuildnumber]${{parameters.VersionPrefix}}-${{parameters.VersionSuffix}}"
}'

- task: DotNetCoreCLI@2
name: BuildLibrary
Expand All @@ -36,11 +44,11 @@ jobs:
buildProperties: 'VersionPrefix=${{parameters.VersionPrefix}};VersionSuffix=${{parameters.VersionSuffix}}'
verbosityPack: 'Normal'

- task: NuGetCommand@2
name: PublishNuGetPackages
displayName: Publish to NuGet
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'nuget.org'
#- task: NuGetCommand@2
# name: PublishNuGetPackages
# displayName: Publish to NuGet
# inputs:
# command: 'push'
# packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
# nuGetFeedType: 'external'
# publishFeedCredentials: 'nuget.org'

0 comments on commit d3c5ffa

Please sign in to comment.