-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
117 lines (100 loc) · 3.53 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
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- master
- main
- refs/tags/v*
jobs:
- job: build
pool:
vmImage: windows-2022
variables:
- group: 'eryph'
- name: buildConfiguration
value: 'Release'
- name: signHash
value: ''
steps:
- checkout: self
fetchDepth: 0
clean: true
- task: DotNetCoreCLI@2
displayName: Install AzureSignTool
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install --global azuresigntool'
- task: UseGitVersion@5
inputs:
versionSpec: '5.x'
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: test
projects: '**/test/**/*.csproj'
arguments: '--configuration $(buildConfiguration) --collect "Code coverage" --no-build'
- task: DotNetCoreCLI@2
displayName: publish packer app
inputs:
command: 'publish'
publishWebProjects: false
projects: '**/apps/**/*-packer/*.csproj'
arguments: '--configuration $(buildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)\packer_build /p:SignHash=$(signHash)'
zipAfterPublish: false
- task: CmdLine@2
displayName: rename packer build
inputs:
script: 'ren eryph-packer bin'
workingDirectory: '$(Build.ArtifactStagingDirectory)\packer_build'
- task: AzureCLI@2
displayName: 'Sign eryph-packer.exe'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
scriptType: ps
scriptLocation: inlineScript
azureSubscription: 'dbosoft Azure PN'
addSpnToEnvironment: true
workingDirectory: '$(Build.ArtifactStagingDirectory)\packer_build\bin'
inlineScript: |
AzureSignTool sign -kvu "https://dbosoft-hsm-vault.vault.azure.net" -kvi $Env:servicePrincipalId -kvt $Env:tenantId -kvs $Env:servicePrincipalKey -tr http://rfc3161timestamp.globalsign.com/advanced -kvc "codesigning-2023" -v eryph-packer.exe
- task: ArchiveFiles@2
displayName: pack packer build
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\packer_build'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/apps/packer/eryph_packer_$(Build.BuildNumber)_windows_amd64.zip'
- task: PublishBuildArtifacts@1
displayName: upload packer artifact
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/apps/packer'
ArtifactName: 'packer'
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: pack
nobuild: true
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory) --no-build'
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: '59a3608a-9bed-4cb4-9467-6efaaa3cbef5/1e425ef4-e3a0-4927-b4c0-2beff753cb88'
allowPackageConflicts: true