-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.yaml
102 lines (89 loc) · 2.72 KB
/
build.yaml
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
trigger:
batch: true
branches:
include:
- dev
- master
pool:
vmImage: windows-latest
variables:
- group: ScrAPI
- name: devent.build.configuration
value: "NuGet"
- name: devent.build.project
value: "DevEnterprise.Scrapi.Sdk"
- name: version.major
value: "1"
- name: version.minor
value: "0"
- name: version.revision
value: "0"
- name: version.build
value: "$(Build.BuildId)"
- name: version.number
value: "$(version.major).$(version.minor).$(version.revision).$(version.build)"
- name: NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS
value: 30
- name: NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS
value: 30
workspace:
clean: all
steps:
- checkout: self
lfs: false
fetchDepth: 1
- task: richardfennellBM.BM-VSTS-Versioning-Task.Version-DotNetCoreAssemblies-Task.VersionDotNetCoreAssemblies@3
displayName: "Version"
inputs:
versionNumber: "$(version.number)"
filenamePattern: ".csproj"
addDefault: true
- task: UseDotNet@2
displayName: "Use .NET Core 9.x"
inputs:
version: 9.x
- task: NuGetToolInstaller@1
displayName: "Use NuGet 6.x"
inputs:
versionSpec: 6.x
- task: DotNetCoreCLI@2
displayName: "Build Project"
inputs:
command: build
projects: |
**/$(devent.build.project).csproj
arguments: "--configuration $(devent.build.configuration)"
verbosityRestore: Normal
- task: DotNetCoreCLI@2
displayName: "Publish Project"
inputs:
command: publish
publishWebProjects: false
zipAfterPublish: false
projects: |
**/$(devent.build.project).csproj
arguments: "--no-build --configuration $(devent.build.configuration) --output $(Build.ArtifactStagingDirectory)/Publish"
verbosityRestore: Normal
enabled: false
- task: CopyFiles@2
displayName: "Copy NuGet Package to Staging"
inputs:
contents: "**/*.nupkg"
targetFolder: "$(Build.ArtifactStagingDirectory)/NuGet"
flattenFolders: true
- task: DownloadSecureFile@1
displayName: "Download Signing Certificate"
name: SigningCertificate
inputs:
secureFile: "DevEnterprise.pfx"
- task: NuGetCommand@2
displayName: "Sign NuGet Package"
inputs:
command: custom
arguments: 'sign $(Build.ArtifactStagingDirectory)\NuGet\*.nupkg -CertificatePath "$(SigningCertificate.SecureFilePath)" -CertificatePassword "$(CertificatePassword)" -Timestamper http://timestamp.sectigo.com?td=sha256'
- task: PublishBuildArtifacts@1
displayName: "Publish NuGet Package Artifact"
inputs:
pathToPublish: "$(Build.ArtifactStagingDirectory)/NuGet"
artifactName: "$(devent.build.project).$(Build.BuildNumber)"
condition: succeeded()