-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
111 lines (97 loc) · 2.69 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
trigger:
branches:
include:
- v11/main
- v11/develop
- v11/release/*
- v11/hotfix
tags:
include:
- 11.*
pool:
name: Default
variables:
BuildConfiguration: 'release'
BuildPlatform: 'any cpu'
Solution: '**\*.sln'
stages:
- stage: build
displayName: Build
jobs:
- job: build
displayName: Build
steps:
- task: GitVersion@5
displayName: GitVersion
inputs:
configFilePath: GitVersion.yml
updateAssemblyInfo: true
- task: UseDotNet@2
displayName: 'Use .NET 7'
inputs:
packageType: 'sdk'
version: '7.x'
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
feedsToUse: config
nugetConfigPath: nuget.config
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: build
projects: Infocaster.Umbraco.DateFolders.sln
arguments: '--configuration $(BuildConfiguration) -p:Version=$(GitVersion.NuGetVersion)'
- task: DotNetCoreCLI@2
displayName: 'dotnet pack'
inputs:
command: pack
arguments: '--configuration $(BuildConfiguration) -p:Version=$(GitVersion.NuGetVersion)'
packagesToPack: src/**/*.csproj
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
- task: PublishBuildArtifacts@1
displayName: 'Publish build artifacts'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- stage: release
displayName: Release
dependsOn: build
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
variables:
packageGlob: '$(Pipeline.Workspace)/**/Infocaster.Umbraco.DateFolders*.nupkg'
jobs:
- job: releaseArtifact
displayName: Push to artifacts
workspace:
clean: all
steps:
- checkout: none
- download: current
patterns: '**/*.nupkg'
displayName: Download build artifact
- task: DotNetCoreCLI@2
displayName: 'dotnet push'
inputs:
command: push
publishVstsFeed: '3356baca-d7d8-497c-a5fa-ebd93f79f7c7'
versioningScheme: byBuildNumber
packagesToPush: $(packageGlob)
- job: releaseNuget
displayName: Push to nuget
workspace:
clean: all
steps:
- checkout: none
- download: current
patterns: '**/*.nupkg'
displayName: Download build artifact
- task: DotNetCoreCLI@2
displayName: 'push to nuget.org'
inputs:
command: custom
custom: nuget
arguments: 'push $(packageGlob) -s https://api.nuget.org/v3/index.json --api-key $(NuGetApiKey)'