-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathazure-pipelines.yml
86 lines (75 loc) · 2.23 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
trigger:
branches:
include:
- master
tags:
include:
- v*
variables:
isGitHubTag: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/v')]
buildConfiguration: 'Release'
stages:
- stage: Build
jobs:
- job: Test_Build
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
pool:
vmImage: 'windows-2019'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
- task: MSBuild@1
inputs:
solution: '**/*.csproj'
configuration: '$(buildConfiguration)'
- job: Build_Nupkg
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
pool:
vmImage: 'windows-2019'
steps:
- powershell: 'echo "##vso[task.setvariable variable=PackageVersion]$($env:Build_SourceBranchName.Substring(1))"'
displayName: 'PowerShell Script'
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
- task: MSBuild@1
inputs:
solution: '**/*.csproj'
configuration: '$(buildConfiguration)'
msbuildArguments: '/t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="..\..\build";AutoParameterizationWebConfigConnectionStrings=false;SolutionDir="src\"'
- task: NuGetCommand@2
inputs:
command: 'pack'
packagesToPack: './IISManager.nuspec'
packDestination: '$(System.DefaultWorkingDirectory)/artifacts'
versioningScheme: byEnvVar
versionEnvVar: PackageVersion
basePath: './build'
verbosityPack: 'Normal'
- publish: artifacts
artifact: nupkg
displayName: 'Publish artifacts'
- stage: Publish
dependsOn:
- Build
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'))
jobs:
- job: Publish_Nupkg
pool:
vmImage: 'windows-2019'
steps:
- checkout: none
- download: current
artifact: nupkg
displayName: 'Download artifact'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: NuGet
verbosityPush: Normal