-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
128 lines (110 loc) · 4.15 KB
/
azure-pipelines.yml
File metadata and controls
128 lines (110 loc) · 4.15 KB
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
resources:
- repo: self
trigger:
batch: true
branches:
include:
- master
- refs/tags/*
pr:
- master
variables:
- group: 'Code Signing Certificates'
- name: BuildConfiguration
value: release
- name: BuildPlatform
value: any cpu
- name: Solution
value: 'fiskaltrust.Middleware.Interface.sln'
jobs:
- job: Build
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
displayName: "Install .NET 6 SDK"
inputs:
packageType: "sdk"
version: "6.x"
- task: VisualStudioTestPlatformInstaller@1
displayName: VsTest Platform Installer
- task: yavt@1
inputs:
mode: 'Multi'
semverVersion: 'v1'
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
vstsFeed: 'dev' # TODO Remove before merge
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '$(Solution)'
arguments: '--configuration $(BuildConfiguration)'
- task: SSMClientToolsSetup@1
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- task: SSMSigningToolsSetup@1
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
- task: DownloadSecureFile@1
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
name: clientCertificate
displayName: "Download client certificate"
inputs:
secureFile: "codesigning_client_cert.p12"
- pwsh: smctl certificate download --keypair-alias=$(KEYPAIR_ALIAS) --name=KeyCert.pem --out=$(Agent.TempDirectory)
displayName: "Download Certificate"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
env:
SM_HOST: "$(SM_HOST)"
SM_API_KEY: "$(SM_API_KEY)"
SM_CLIENT_CERT_PASSWORD: "$(SM_CLIENT_CERT_PASSWORD)"
SM_CLIENT_CERT_FILE: "$(clientCertificate.secureFilePath)"
SM_TLS_SKIP_VERIFY: false
- pwsh: |
Get-ChildItem -Path "$(Build.SourcesDirectory)" -Include fiskaltrust*.dll, fiskaltrust*.exe -Recurse | ForEach-Object {
signtool sign `
/tr http://timestamp.sectigo.com/?td=sha256 `
/td SHA256 `
/fd SHA256 `
/csp "DigiCert Signing Manager KSP" `
/kc "$(KEYPAIR_ALIAS)" `
/f $(Agent.TempDirectory)\KeyCert.pem `
$_.FullName
}
Write-Host $(Get-Content -Path "~\.signingmanager\logs\smksp.log")
displayName: "Code Signing"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
env:
SM_HOST: "$(SM_HOST)"
SM_API_KEY: "$(SM_API_KEY)"
SM_CLIENT_CERT_PASSWORD: "$(SM_CLIENT_CERT_PASSWORD)"
SM_CLIENT_CERT_FILE: "$(clientCertificate.secureFilePath)"
SM_TLS_SKIP_VERIFY: false
- script: dotnet test --no-build --configuration $(buildConfiguration) --test-adapter-path:. --logger:nunit;LogFilePath=TestResults.xml
displayName: 'dotnet test ifPOS'
workingDirectory: 'test\fiskaltrust.ifPOS.Tests'
- script: dotnet test --no-build --configuration $(buildConfiguration) --test-adapter-path:. --logger:nunit;LogFilePath=TestResults.xml
displayName: 'dotnet test Clients'
workingDirectory: 'test\fiskaltrust.Middleware.Interface.Client.Tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: NUnit
testResultsFiles: '**/*TestResults*.xml'
mergeTestResults: true
failTaskOnFailedTests: true
buildConfiguration: $(buildConfiguration)
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: 'pack'
packagesToPack: 'src/**/*.csproj'
nobuild: true
versioningScheme: 'off'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'