-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathreleaseBuild.yml
More file actions
185 lines (165 loc) · 4.76 KB
/
releaseBuild.yml
File metadata and controls
185 lines (165 loc) · 4.76 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
trigger: none
variables:
AuthenticodeSignType: '400'
BuildConfiguration: 'Release'
NuGetPackagePath: '$(System.ArtifactsDirectory)/NuGetRelease'
PackageRoot: '$(System.ArtifactsDirectory)/Packages'
resources:
repositories:
- repository: ComplianceRepo
type: github
endpoint: ComplianceGHRepo
name: PowerShell/compliance
stages:
- stage: Build
displayName: Build Native Binaries
dependsOn: []
jobs:
- job: BuildWin
pool:
vmImage: vs2017-win2016
displayName: Windows
strategy:
matrix:
x64:
ARCHITECTURE: x64
x86:
ARCHITECTURE: x86
x64ARM:
ARCHITECTURE: x64_arm
x64ARM64:
ARCHITECTURE: x64_arm64
steps:
- template: windows-build.yml
- job: SignWin
pool: Package ES Standard Build
displayName: Sign Windows
variables:
- group: ESRP
dependsOn: BuildWin
strategy:
matrix:
x64:
ARCHITECTURE: x64
x86:
ARCHITECTURE: x86
x64ARM:
ARCHITECTURE: x64_arm
x64ARM64:
ARCHITECTURE: x64_arm64
steps:
- template: windows-sign.yml
- job: BuildLinux
displayName: Linux
pool:
vmImage: ubuntu-16.04
strategy:
matrix:
UbuntuArm:
LINUX_BUILDNAME: 'ubuntu.16.04-arm'
CentOS:
LINUX_BUILDNAME: 'centos.7'
Alpine:
LINUX_BUILDNAME: 'alpine'
UbuntuArm64:
LINUX_BUILDNAME: 'ubuntu.16.04-arm64'
AlpineArm:
LINUX_BUILDNAME: 'alpine-arm'
AlpineArm64:
LINUX_BUILDNAME: 'alpine-arm64'
steps:
- template: linux.yml
- job: BuildMac
displayName: Build Native Binaries on macOS
pool:
vmImage: macOS-Latest
steps:
- template: mac.yml
- job: BuildNuGetPkg
displayName: Build NuGet Package
dependsOn:
- SignWin
- BuildLinux
- BuildMac
pool: Package ES Standard Build
variables:
- group: ESRP
steps:
- template: nuget.yml
- stage: compliance
displayName: Compliance
dependsOn: Build
jobs:
- job: Compliance_Job
pool:
name: Package ES Standard Build
steps:
- checkout: self
clean: true
- checkout: ComplianceRepo
clean: true
- download: current
artifact: release
- download: current
artifact: signed
- template: setVersion.yml
- pwsh: |
Get-ChildItem -Path 'ENV:'
displayName: Capture environment
- powershell: |
$null = New-Item $(PackageRoot) -ItemType Directory -Force -Verbose
if(-not (Test-Path '$(Pipeline.Workspace)/release' ))
{
New-Item -ItemType Directory -Path '$(Pipeline.Workspace)/release' -Force
}
Invoke-WebRequest -Uri '$(PSRPBlobUrl)' -OutFile $(Pipeline.Workspace)/release/psrp.zip -Verbose
displayName: 'Download PSRP package'
- powershell: 'Get-ChildItem $(Pipeline.Workspace)/release'
displayName: 'Capture downloaded zips'
- powershell: |
$extractedRoot = New-Item $(Pipeline.Workspace)/uncompressed -ItemType Directory -Force -Verbose
Get-ChildItem $(Pipeline.Workspace)/release/*.zip | ForEach-Object {
$baseName = $_.BaseName
if($baseName -match 'x64_arm') {
Write-Verbose "Skipping expanding file $_.Name" -Verbose
}
else {
$folderPath = Join-Path $extractedRoot $baseName
Expand-Archive $_.FullName -DestinationPath $folderPath -Force
}
}
Write-Host "Extracted files:"
Get-ChildItem -Recurse $extractedRoot -File
displayName: 'Extract All Zips'
- pwsh: |
Write-Verbose -Verbose "$(PackageVersion)"
displayName: 'Write the package version'
- template: assembly-module-compliance.yml@ComplianceRepo
parameters:
# binskim
AnalyzeTarget: '$(Pipeline.Workspace)/uncompressed/*.dll'
AnalyzeSymPath: 'SRV*'
# component-governance
sourceScanPath: '$(Build.SourcesDirectory)/powershell-native'
# credscan
suppressionsFile: ''
# TermCheck
optionsRulesDBPath: ''
optionsFTPath: ''
# tsa-upload
codeBaseName: 'PowerShellNative'
# selections
softwareName: 'PowerShellNative'
softwareNameFolder: '$(Pipeline.Workspace)/uncompressed'
softwareVersion: '$(PackageVersion)'
APIScan: true # set to false when not using Windows APIs.
- template: publish.yml
parameters:
stageName: AzArtifactsFeed
environmentName: PSNativeAzArtifactApproval
feedCredential: AzArtifactsFeed
- template: publish.yml
parameters:
stageName: NuGet
environmentName: PSNativeNuGetApproval
feedCredential: PowerShellNuGetOrgPush