forked from microsoft/powerplatform-build-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding Azure DevOps official build with ESRP signing (microsoft#61)
* adding Azure DevOps official build with ESRP signing * need to bootstrap GH package authN before npm install Co-authored-by: david@DAVID-PC <[email protected]>
- Loading branch information
1 parent
0f2b469
commit 1cb4701
Showing
9 changed files
with
721 additions
and
746 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# https://aka.ms/yaml | ||
# | ||
# Official build to produce versioned and signed VSIX | ||
|
||
variables: | ||
# https://aka.ms/gdn-injection | ||
GDN_CODESIGN_TARGETDIRECTORY: "$(Build.SourcesDirectory)\\out\\packages" | ||
# no codesigning for JavaScript: | ||
GDN_CODESIGN_EXCLUSIONS: "f|**/*.js" | ||
runCodesignValidationInjection: true | ||
breakCodesignValidationInjection: true | ||
# | ||
# set the following in the pipeline's web UI editor: | ||
# GITHUB_TOKEN # GitHub PAT with scopes: repo; must have SSO enabled for GH org 'microsoft' for corp user | ||
# AZ_DevOps_Read_PAT # PAT to read from AzDO feed in msazure | ||
# VSIX_PATCH_VERSION # VSIX package's patch version; must be manually managed for now! | ||
|
||
trigger: none | ||
# - release/* | ||
|
||
# PR loops only via GH workflows | ||
pr: none | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
steps: | ||
- script: echo "##vso[build.updatebuildnumber]0.1.$(VSIX_PATCH_VERSION) | ||
displayName: Set AzDO Job/Build version | ||
|
||
# - script: mkdir package && echo $(VSIX_VERSION),$(Build.SourceVersion) > package/version.csv | ||
# displayName: Capture build version in package/version.csv | ||
|
||
- task: NodeTool@0 | ||
displayName: 'Use nodejs 16.x' | ||
inputs: | ||
versionSpec: '16.x' | ||
|
||
# need to authenticate to npm package feed in microsoft/powerplatform-cli-wrapper (see also README.md) | ||
- task: npmAuthenticate@0 | ||
displayName: 'setup package feed authN with github' | ||
inputs: | ||
workingFile: .npmrc | ||
customEndpoint: github.com_npm_davidjenni | ||
|
||
- task: Npm@1 | ||
displayName: 'set git repo authN' | ||
inputs: | ||
command: custom | ||
customCommand: run set-git-authn -- "$(GITHUB_TOKEN)" | ||
|
||
- task: Npm@1 | ||
displayName: 'Restore (npm install)' | ||
inputs: | ||
command: custom | ||
customCommand: ci | ||
|
||
# - task: Npm@1 | ||
# displayName: 'auto-increment version' | ||
# inputs: | ||
# command: custom | ||
# customCommand: run increment-version | ||
|
||
- task: Npm@1 | ||
displayName: 'Build' | ||
inputs: | ||
command: custom | ||
customCommand: run prepare-pack -- --feedPAT $(AZ_DevOps_Read_PAT) | ||
|
||
- task: Npm@1 | ||
displayName: 'Package VSIX' | ||
inputs: | ||
command: custom | ||
customCommand: run pack -- --patch $(VSIX_PATCH_VERSION) --isOfficial | ||
|
||
# https://microsoft.sharepoint.com/teams/prss/esrp/info/ESRP%20Onboarding%20Wiki/Generating%20Signing%20JSON.aspx | ||
# https://microsoft.sharepoint.com/teams/prss/esrp/info/ESRP%20Onboarding%20Wiki/Selecting%20CodeSign%20Certificates.aspx | ||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 | ||
displayName: 'ESRP sign vsix packages' | ||
inputs: | ||
ConnectedServiceName: ESRPCodeSigningConnection | ||
FolderPath: 'out/packages' | ||
Pattern: '*.vsix' | ||
signConfigType: inlineSignParams | ||
inlineOperation: | | ||
[ | ||
{ | ||
"KeyCode": "CP-233016", | ||
"OperationCode": "OpcSign", | ||
"Parameters": { | ||
"FileDigest": "/fd SHA256" | ||
}, | ||
"ToolName": "sign", | ||
"ToolVersion": "1.0" | ||
}, | ||
{ | ||
"KeyCode": "CP-233016", | ||
"OperationCode": "OpcVerify", | ||
"Parameters": {}, | ||
"ToolName": "sign", | ||
"ToolVersion": "1.0" | ||
} | ||
] | ||
ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v1' | ||
|
||
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 | ||
displayName: 'SBOM Generation Task' | ||
inputs: | ||
BuildDropPath: out/packages | ||
|
||
- task: PublishBuildArtifacts@1 | ||
displayName: 'Publish packages' | ||
condition: always() | ||
inputs: | ||
PathtoPublish: out/packages | ||
ArtifactName: packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.