This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
125 lines (108 loc) · 3.01 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
trigger:
- main
pr:
- main
variables:
- group: docfx-v2-pipeline-kv
- name: version
value: 1.0.0
jobs:
- job: build
strategy:
matrix:
linux:
os: 'ubuntu-latest'
mac:
os: 'macos-latest'
windows:
os: 'windows-latest'
pool:
vmImage: $(os)
steps:
- template: install-rust.yml
- task: UseDotNet@2
inputs:
packageType: sdk
version: 6.0.x
- script: cargo build --release
displayName: cargo build
workingDirectory: rust
- script: dotnet test -c Release
displayName: dotnet test
workingDirectory: dotnet
- publish: rust/target/release/
artifact: lib-$(os)
- job: publish
dependsOn: build
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
pool:
vmImage: windows-latest
steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: lib-ubuntu-latest
path: $(Build.SourcesDirectory)/rust/target/release
- task: DownloadPipelineArtifact@2
inputs:
artifact: lib-macos-latest
path: $(Build.SourcesDirectory)/rust/target/release
- task: DownloadPipelineArtifact@2
inputs:
artifact: lib-windows-latest
path: $(Build.SourcesDirectory)/rust/target/release
- task: UseDotNet@2
inputs:
packageType: sdk
version: 6.0.x
- task: UseDotNet@2
inputs:
packageType: sdk
version: 2.1.x # for ESRPCodeSigning
- script: dotnet test -c Release
displayName: dotnet test
workingDirectory: dotnet
- script: >
dotnet pack -c Release -o $(Agent.TempDirectory)/nuget
/p:Version=$(version) /p:InformationalVersion=$(version)-$(Build.SourceVersion)
displayName: dotnet pack
workingDirectory: dotnet
- task: EsrpCodeSigning@1
displayName: 'Sign NuGet packages'
inputs:
ConnectedServiceName: 'CodeSigning-APEX'
FolderPath: '$(Agent.TempDirectory)/nuget'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
SessionTimeout: 20
inlineOperation: |
[
{
"KeyCode" : "CP-401405",
"OperationSetCode" : "NuGetSign",
"Parameters" : [
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
}
],
"ToolName" : "sign",
"ToolVersion" : "1.0"
},
{
"KeyCode" : "CP-401405",
"OperationSetCode" : "NuGetVerify",
"Parameters" : [],
"ToolName" : "sign",
"ToolVersion" : "1.0"
}
]
- publish: $(Agent.TempDirectory)/nuget
artifact: nuget
- powershell: dotnet nuget push $(Agent.TempDirectory)\nuget\*.nupkg --api-key $env:NUGETAPIKEY --source https://nuget.org
displayName: dotnet nuget push
env:
NUGETAPIKEY: $(NugetAPIKey)