forked from dotnet/ResXResourceManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
134 lines (116 loc) · 4.72 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
name: $(Build.DefinitionName) $(date:yyyyMMdd)$(rev:.r)
stages:
- stage: Build
jobs:
- job: Build
pool:
vmImage: windows-2022
variables:
BuildPlatform: 'any cpu'
BuildConfiguration: 'release'
steps:
- task: PowerShell@1
displayName: 'Set build version'
inputs:
scriptType: inlineScript
inlineScript: |
(new-object Net.WebClient).DownloadString("https://raw.github.com/tom-englert/BuildScripts/master/BuildScripts.ps1") | iex
$version = Project-SetVersion "src\Directory.Build.props"
$version | Build-AppendVersionToBuildNumber
$version | File-PatchVersion "src\ResXManager\ResXManager.csproj"
$version | File-PatchVersion "src\ResXManager\Properties\AssemblyInfo.cs"
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: NuGetToolInstaller@1
inputs:
versionSpec: '>= 5.8'
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'config'
- task: MSBuild@1
displayName: 'Build solution'
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
logProjectEvents: true
createLogFile: true
- task: MSBuild@1
displayName: 'Publish Click Once'
inputs:
solution: 'src\ResxManager\ResxManager.csproj'
platform: AnyCPU
configuration: release
msbuildArguments: '/target:publish'
logProjectEvents: true
createLogFile: true
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(build.sourcesdirectory)\src\Deploy'
Contents: '*.*'
TargetFolder: '$(build.artifactstagingdirectory)'
CleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: BuildPackages'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: BuildPackages
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: signing scripts'
inputs:
PathtoPublish: 'signing'
ArtifactName: signing
- stage: CodeSign
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
jobs:
- deployment: CodeSign
displayName: Code Signing
pool:
vmImage: windows-latest
environment: Code Signing
strategy:
runOnce:
deploy:
steps:
- task: CmdLine@2
displayName: "AntiMalware Scan"
inputs:
script: |
Dir "$(Pipeline.Workspace)\BuildPackages"
"%ProgramFiles%\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "$(Pipeline.Workspace)\BuildPackages"
failOnStderr: true
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . SignClient
displayName: Install SignTool tool
- pwsh: Rename-Item -Path "$(Pipeline.Workspace)\BuildPackages\Publish.zip" -NewName Publish.clickonce
displayName: 'Rename click-once archive to .clickonce'
- pwsh: |
.\SignClient "Sign" `
--baseDirectory "$(Pipeline.Workspace)\BuildPackages" `
--input "**/*.*" `
--config "$(Pipeline.Workspace)\signing\SignClient.json" `
--filelist "$(Pipeline.Workspace)\signing\filelist.txt" `
--user "$(SignClientUser)" `
--secret "$(SignClientSecret)" `
--name "ResX Resource Manager" `
--description "ResX Resource Manager" `
--descriptionUrl "https://github.com/dotnet/ResXResourceManager"
displayName: Sign packages
- pwsh: Rename-Item -Path "$(Pipeline.Workspace)\BuildPackages\Publish.clickonce" -NewName Publish.zip
displayName: 'Rename click-once archive back to .zip'
- task: PowerShell@1
displayName: 'Publish to vsix-gallery'
inputs:
scriptType: inlineScript
inlineScript: |
(new-object Net.WebClient).DownloadString("https://raw.github.com/tom-englert/BuildScripts/master/BuildScripts.ps1") | iex
Vsix-PublishToGallery "$(Pipeline.Workspace)\BuildPackages\ResXManager.Vsix.vsix"
continueOnError: true
- publish: $(Pipeline.Workspace)\BuildPackages
displayName: Publish Signed Packages
artifact: SignedPackages