-
Notifications
You must be signed in to change notification settings - Fork 11
/
azure-pipelines.yml
135 lines (118 loc) · 4.29 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
126
127
128
129
130
131
132
133
134
135
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
name: Azure Pipelines
vmImage: windows-latest
steps:
- task: ssplat.rust-build-release-tools.rust-installer-task.RustInstaller@1
displayName: 'Install Rust '
inputs:
rustVersion: 'ms-1.81'
additionalTargets: 'i686-pc-windows-msvc'
toolchainFeed: https://onedrive.pkgs.visualstudio.com/b52099a6-3b13-4b08-9270-a07884a10e3d/_packaging/RustTools/nuget/v3/index.json
cratesIoFeedOverride: sparse+https://onedrive.pkgs.visualstudio.com/b52099a6-3b13-4b08-9270-a07884a10e3d/_packaging/RustCratesIO/Cargo/index/
- script: |
cargo build --locked 2>&1
displayName: 'Build debug'
- script: |
cargo install junit-test
junit-test
copy junit.xml $(System.DefaultWorkingDirectory)\TEST-rust.xml
displayName: 'Test debug'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/TEST-*.xml'
inputs:
mergeTestResults: true
- script: |
set RUSTFLAGS=-Ccontrol-flow-guard -Ctarget-feature=+crt-static,+avx2,+lzcnt -Clink-args=/DYNAMICBASE/CETCOMPAT
cargo build --locked --release 2>&1
copy target\release\lepton_jpeg.dll target\release\lepton_jpeg_avx2.dll
copy target\release\lepton_jpeg.pdb target\release\lepton_jpeg_avx2.pdb
copy target\release\lepton_jpeg_util.exe target\release\lepton_jpeg_util_avx2.exe
copy target\release\lepton_jpeg_util.pdb target\release\lepton_jpeg_util_avx2.pdb
set RUSTFLAGS=-Ccontrol-flow-guard -Ctarget-feature=+crt-static -Clink-args=/DYNAMICBASE/CETCOMPAT
cargo build --locked --release 2>&1
displayName: 'Build Release'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.x'
- task: EsrpCodeSigning@5
inputs:
ConnectedServiceName: 'ESRP CodeSigningV2-OneDrive Service'
AppRegistrationClientId: 'bd3fbc52-4cf5-4cca-a25d-94160e5ed309'
AppRegistrationTenantId: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
AuthAKVName: 'ODSP-ESRP'
AuthCertName: 'ODSP-ESRP-Auth-V2'
AuthSignCertName: 'CodeSigningCertificate'
FolderPath: '$(Build.SourcesDirectory)'
Pattern: '
target\debug\lepton_jpeg.dll,
target\debug\lepton_jpeg_util.exe,
target\release\lepton_jpeg.dll,
target\release\lepton_jpeg_avx2.dll,
target\release\lepton_jpeg_util.exe,
target\release\lepton_jpeg_util_avx2.exe'
signConfigType: 'inlineSignParams'
inlineOperation: |
[
{
"KeyCode": "CP-401405",
"OperationCode": "SigntoolSign",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "https://www.microsoft.com",
"FileDigest": "/fd SHA256",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
},
{
"KeyCode": "CP-401405",
"OperationCode": "SigntoolVerify",
"ToolName": "sign",
"ToolVersion": "1.0",
"Parameters": {}
}
]
SessionTimeout: '60'
MaxConcurrency: '50'
MaxRetryAttempts: '5'
PendingAnalysisWaitTimeoutMinutes: '5'
- task: CopyFiles@2
displayName: 'Copy Rust output files to: $(Build.ArtifactStagingDirectory) copy'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
target\debug\?(*.dll|*.exe|*.pdb)
target\release\?(*.dll|*.exe|*.pdb)
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
ArtifactName: 'drop_lepton_jpeg_rust'
- task: PublishSymbols@2
displayName: 'Publish symbols copy'
inputs:
SymbolsFolder: '$(Build.ArtifactStagingDirectory)'
SearchPattern: '**\*.pdb'
SymbolServerType: TeamServices
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: package/Lepton.Jpeg.Rust.nuspec
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)\*.nupkg'
publishVstsFeed: 'b87285d9-99ab-48db-a000-cb0cc8a2a1b5'
allowPackageConflicts: true
condition: and(succeeded(), in(variables['Build.Reason'], 'Manual'), eq(variables['Build.SourceBranch'], 'main'))