-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
50 lines (43 loc) · 1.42 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
trigger:
- main
- feature/*
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildConfiguration: 'Release'
packageProject: 'Wholething.FallbackImagePickerProperty/Wholething.FallbackImagePickerProperty.csproj'
major: 1
minor: 0
patch: $[counter(format('{0}.{1}', variables['Major'], variables['Minor']), 0)] # this will reset when major/minor changes
${{ if eq(variables['Build.SourceBranchName'], 'main') }}:
NugetVersion: $(major).$(minor).$(patch)
${{ if ne(variables['Build.SourceBranchName'], 'main') }}:
NugetVersion: $(major).$(minor).$(patch)-pre
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet nuget restore'
inputs:
command: 'restore'
projects: '$(packageProject)'
feedsToUse: 'select'
vstsFeed: 'eb3f777d-48d0-4898-932f-35673efacabd/d102e843-1008-4562-bc96-dd1f1a8632c4'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '$(packageProject)'
- task: DotNetCoreCLI@2
displayName: 'dotnet nuget pack'
inputs:
command: 'pack'
packagesToPack: '$(packageProject)'
versioningScheme: 'byEnvVar'
versionEnvVar: 'NugetVersion'
- task: DotNetCoreCLI@2
displayName: 'dotnet nuget push'
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'eb3f777d-48d0-4898-932f-35673efacabd/d102e843-1008-4562-bc96-dd1f1a8632c4'