-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
91 lines (80 loc) · 2.47 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
trigger:
- master
- release/*
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
snoozleProject: '**/Snoozle.SqlServer.csproj'
isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')]
version: '0.0.0'
steps:
- task: PowerShell@2
displayName: 'Set build version variable'
name: version
condition: and(succeeded(), eq(variables['isRelease'], 'True'))
inputs:
filePath: './set-version.ps1'
- task: Assembly-Info-NetCore@2
displayName: 'Update .csproj file versions'
condition: and(succeeded(), eq(variables['isRelease'], 'True'))
inputs:
Path: '$(Build.SourcesDirectory)'
FileNames: '**/*.csproj'
InsertAttributes: false
FileEncoding: 'auto'
WriteBOM: false
PackageRequireLicenseAcceptance: true
VersionNumber: $(Version)
FileVersionNumber: $(Version)
InformationalVersion: $(Version)
PackageVersion: $(Version)
LogLevel: 'verbose'
FailOnWarning: false
DisableTelemetry: false
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'
- task: NuGetCommand@2
displayName: 'Restore solution NuGet packages'
inputs:
command: 'restore'
restoreSolution: '$(solution)'
nugetConfigPath: '$(System.DefaultWorkingDirectory)/src/NuGet.config'
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: '**/*.sln'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: '**/*Tests.csproj'
publishTestResults: true
- task: DotNetCoreCLI@2
displayName: 'Pack NuGet package'
condition: and(succeeded(), eq(variables['isRelease'], 'True'))
inputs:
command: 'pack'
packagesToPack: '$(snoozleProject)'
versioningScheme: byEnvVar
versionEnvVar: Version
- task: NuGetCommand@2
displayName: 'Push NuGet package'
condition: and(succeeded(), eq(variables['isRelease'], 'True'))
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet'
- task: GithubRelease@0
displayName: 'Create GitHub Release'
condition: and(succeeded(), eq(variables['isRelease'], 'True'))
inputs:
gitHubConnection: CharlieJKendallPAT
repositoryName: CharlieJKendall/Snoozle.SqlServer
tagSource: manual
tag: $(Version)