-
-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathazure-pipelines.yml
53 lines (43 loc) · 1.48 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
trigger:
tags:
include:
- '*'
branches:
include:
- release/*
pool:
vmImage: 'ubuntu-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- bash: |
tags=$(git describe --abbrev=0 --tags $(git rev-list --tags --max-count=1))
echo "Latest tag on main branch: $tags"
echo "##vso[task.setvariable variable=myVersion;isOutput=true]$tags"
name: createTagVariableStep
displayName: 'Get Latest Tag on Main Branch'
- script: echo "The version is $(createTagVariableStep.myVersion)"
displayName: 'Display Version'
- script: |
dotnet restore
dotnet build
dotnet pack --configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory) /p:Version=$(createTagVariableStep.myVersion) /p:ApiCompatGenerateSuppressionFile=$(ApiCompatGenerateSuppressionFile)
displayName: 'Dotnet Pack'
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'Nuget'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/src/Buildalyzer/CompatibilitySuppressions.xml'
ArtifactName: 'CompatibilitySuppressions'
publishLocation: 'Container'