Skip to content

Commit f5da584

Browse files
jshigetomiJustin Chung
andauthored
Migrate MacOS Signing to OneBranch (PowerShell#25295)
Co-authored-by: Justin Chung <chungjustin@microsoft.com>
1 parent 1a30245 commit f5da584

1 file changed

Lines changed: 23 additions & 36 deletions

File tree

.pipelines/templates/mac-package-build.yml

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -173,56 +173,43 @@ jobs:
173173
Get-ChildItem -Path $(Pipeline.Workspace) -Filter "*.zip" -File | Write-Verbose -Verbose
174174
displayName: Compress package files for signing
175175
176-
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@5
177-
displayName: 'ESRP CodeSigning'
176+
- task: onebranch.pipeline.signing@1
177+
displayName: 'OneBranch CodeSigning Package'
178178
inputs:
179-
ConnectedServiceName: 'ESRPMacOSSigning'
180-
AppRegistrationClientId: '$(AppRegistrationClientId)'
181-
AppRegistrationTenantId: '$(AppRegistrationTenantId)'
182-
AuthAKVName: 'pwsh-CICD-Keyvault'
183-
AuthCertName: 'PS-macos-signing'
184-
AuthSignCertName: 'ESRP-OneCert' # this is not needed for pkg signing
185-
FolderPath: $(Pipeline.Workspace)
186-
Pattern: '*.zip'
187-
signConfigType: inlineSignParams
188-
inlineOperation: |
189-
[{
179+
command: 'sign'
180+
files_to_sign: '**/*-osx-*.zip'
181+
search_root: '$(Pipeline.Workspace)'
182+
inline_operation: |
183+
[
184+
{
190185
"KeyCode": "$(KeyCode)",
191-
"OperationSetCode": "MacAppDeveloperSign",
192-
"parameters": [
193-
{
194-
"parameterName": "hardening",
195-
"parameterValue": "enable"
196-
},
197-
{
198-
"parameterName": "OpusInfo",
199-
"parameterValue": "http://Microsoft.com"
200-
}
201-
],
186+
"OperationCode": "MacAppDeveloperSign",
202187
"ToolName": "sign",
203-
"ToolVersion": "1.0"
204-
}]
205-
SessionTimeout: 90
206-
ServiceEndpointUrl: '$(ServiceEndpointUrl)'
207-
MaxConcurrency: 25
188+
"ToolVersion": "1.0",
189+
"Parameters": {
190+
"Hardening": "Enable",
191+
"OpusInfo": "http://microsoft.com"
192+
}
193+
}
194+
]
208195
209196
- pwsh: |
210197
$signedPkg = Get-ChildItem -Path $(Pipeline.Workspace) -Filter "*osx*.zip" -File
211-
198+
212199
$signedPkg | ForEach-Object {
213200
Write-Verbose -Verbose "Signed package zip: $_"
214-
201+
215202
if (-not (Test-Path $_)) {
216203
throw "Package not found: $_"
217204
}
218-
219-
if (-not (Test-Path $env:ob_outputDirectory)) {
220-
$null = New-Item -Path $env:ob_outputDirectory -ItemType Directory
205+
206+
if (-not (Test-Path $(ob_outputDirectory))) {
207+
$null = New-Item -Path $(ob_outputDirectory) -ItemType Directory
221208
}
222209
223-
Expand-Archive -Path $_ -DestinationPath $env:ob_outputDirectory -Verbose
210+
Expand-Archive -Path $_ -DestinationPath $(ob_outputDirectory) -Verbose
224211
}
225212
226213
Write-Verbose -Verbose "Expanded pkg file:"
227-
Get-ChildItem -Path $env:ob_outputDirectory | Write-Verbose -Verbose
214+
Get-ChildItem -Path $(ob_outputDirectory) | Write-Verbose -Verbose
228215
displayName: Expand signed file

0 commit comments

Comments
 (0)