Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

59 lines (50 sloc) 1.94 KB
name: $(Date:yyyyMMdd)$(Rev:r)
stages:
- stage: Build
jobs:
- job: BuildTestAndPack
pool:
vmImage: 'Ubuntu 16.04'
variables:
buildConfiguration: 'Release'
versionMajor: 1
versionMinor: 1
versionPatch: 5
steps:
- powershell: |
$mainVersion = "$(versionMajor).$(versionMinor).$(versionPatch)"
$commitId = "$(Build.SourceVersion)".Substring(0,7)
Write-Host "##vso[task.setvariable variable=mainVersion]$mainVersion"
Write-Host "##vso[task.setvariable variable=semanticVersion]$mainVersion+$(Build.BuildNumber).$commitId"
Write-Host "##vso[task.setvariable variable=assemblyVersion]$(versionMajor).0.0"
name: SetVariables
- powershell: |
Write-Host 'mainVersion: $(mainVersion)'
Write-Host 'semanticVersion: $(semanticVersion)'
Write-Host 'assemblyVersion: $(assemblyVersion)'
name: PrintVariables
- powershell: |
dotnet build --configuration $(buildConfiguration)
dotnet test --configuration $(buildConfiguration) --logger trx
dotnet pack --configuration Release /p:AssemblyVersion='$(assemblyVersion)' /p:FileVersion='$(mainVersion)' /p:InformationalVersion='$(semanticVersion)' /p:Version='$(mainVersion)' --output '$(Build.ArtifactStagingDirectory)'
name: BuildTestAndPack
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishBuildArtifacts@1
- stage: ReleaseNugetPackage
jobs:
- deployment: ReleaseNugetPackage
environment: NuGet
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet.org'
You can’t perform that action at this time.