Skip to content

Commit

Permalink
Rename build name to say the version being built (#7)
Browse files Browse the repository at this point in the history
Rename build name to say the version being built
  • Loading branch information
evilpilaf authored Dec 9, 2019
2 parents 1cb276b + 90eb98c commit dc300d3
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# https://aka.ms/yaml

trigger:
branches:
include:
- master
paths:
exclude:
- .editorconfig
Expand All @@ -20,7 +23,16 @@ jobs:
pool:
vmImage: 'windows-2019'

variables:
buildConfiguration: Release

steps:
- powershell: |
[string]$latestTag=iex 'git describe --tags --abbrev=0'
[string]$version="v$latestTag.$(BUILD.BUILDNUMBER)"
Write-Output "##vso[build.updatebuildnumber]$version"
displayName: "Get latest git tag"
- task: UseDotNet@2
displayName: "Add dotnet core 2.1"
inputs:
Expand Down Expand Up @@ -49,32 +61,30 @@ jobs:
inputs:
command: "build"
projects: "HoneycombSerilogSink.sln"
arguments: '-c Release'
arguments: '-c $(buildConfiguration)'

- task: DotNetCoreCLI@2
displayName: 'Test'
inputs:
command: 'test'
projects: 'HoneycombSerilogSink.sln'
arguments: '--no-restore --no-build -c Release --collect "Code coverage"'
arguments: '--no-restore --no-build -c $(buildConfiguration) --collect "Code coverage"'

- task: DotNetCoreCLI@2
displayName: 'Package'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
env:
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)
inputs:
command: 'pack'
arguments: '--output $(Build.ArtifactStagingDirectory) --configuration $(buildConfiguration) --no-build'
arguments: '.\src\Honeycomb.Serilog.Sink\Honeycomb.Serilog.Sink.csproj --output $(Build.ArtifactStagingDirectory) --configuration $(buildConfiguration) --no-build'

- task: PublishBuildArtifacts@1
displayName: 'Publish built artifacts'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
env:
BUILD_PR: $(SYSTEM.PULLREQUEST.PULLREQUESTNUMBER)
BUILD_ID: $(BUILD.BUILDNUMBER)
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
ArtifactName: 'nuget'
publishLocation: 'Container'

0 comments on commit dc300d3

Please sign in to comment.