forked from rabobank-nederland/omnikassa-dotnet-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-release.yml
78 lines (75 loc) · 2.66 KB
/
azure-pipelines-release.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
trigger: none
pr: none
name: $(date:yyyyMMdd)$(rev:.r)
resources:
repositories:
- repository: self
type: git
ref: master
variables:
- group: omnikassa-net-sdk-release
- name: buildConfiguration
value: Release
jobs:
- job: NETSDK_Release
displayName: .NET SDK Release
pool:
name: Rabo-Windows-Production
steps:
- checkout: self
persistCredentials: True
- task: NuGetToolInstaller@0
displayName: Use NuGet 6.2.0
inputs:
versionSpec: 6.2.0
- task: DownloadSecureFile@1
name: OmniKassaPFX
displayName: 'Download CA certificate'
inputs:
secureFile: 'omnikassa.netsdk.rabobank.nl.pfx'
- task: PowerShell@2
displayName: Add certificates
inputs:
targetType: 'inline'
script: |
Write-Host "Start adding the PFX file to the certificate store."
$pfxpath = '$(OmniKassaPFX.secureFilePath)'
$password = '$(cert.password)'
Add-Type -AssemblyName System.Security
$certCollection = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2Collection
$certCollection.Import($pfxpath, $password, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]"PersistKeySet")
$store = new-object system.security.cryptography.X509Certificates.X509Store -argumentlist "My", "LocalMachine"
$store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]"ReadWrite")
$store.AddRange($certCollection)
$store.Close()
- task: NuGetCommand@2
displayName: NuGet restore
inputs:
solution: $(BuildParameters.solution)
- task: DotNetCoreCLI@2
displayName: Build Omnikassa SDK
inputs:
projects: OmniKassa.sln
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Test Assemblies
inputs:
command: test
projects: OmniKassa.sln
publishTestResults: true
arguments: '--collect "Code coverage"'
- task: DotNetCoreCLI@2
displayName: 'Create nuget package'
inputs:
command: 'pack'
packagesToPack: 'src/OmniKassa/OmniKassa.csproj'
packDirectory: '$(Build.ArtifactStagingDirectory)'
nobuild: true
versioningScheme: 'off'
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)\*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'nuget-omnikassa-net-sdk-connection'