Skip to content

Instantly share code, notes, and snippets.

@appcoreopc
Created July 29, 2021 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appcoreopc/4fe8a68162530656c3af6f1a5e06e0df to your computer and use it in GitHub Desktop.
Save appcoreopc/4fe8a68162530656c3af6f1a5e06e0df to your computer and use it in GitHub Desktop.
- task: PowerShell@2
displayName: 'Setting packageVersion environment to versioning value.'
inputs:
targetType: 'inline'
script: |
$packageVersion = '$(majorVersion).$(minorVersion).$(Build.BuildId)'
Write-Host "##vso[task.setvariable variable=PackageVersion;]$packageVersion"
- task: NuGetCommand@2
displayName: Package Api
condition: and(succeeded(), eq(variables.isMasterOrReleasableBranch, true))
inputs:
command: "pack" # Options: restore, pack, push, custom
packagesToPack: "**/*.Api.nuspec" # Required when command == pack
packDestination: "$(Build.ArtifactStagingDirectory)" # Optional
basePath: "$(Build.ArtifactStagingDirectory)/PaymentManager.Api" # Optional
versioningScheme: 'byEnvVar'
versionEnvVar: 'packageVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment