From 1c3a1f411eb99e69cbfceea0078852d30705a153 Mon Sep 17 00:00:00 2001 From: atingmicrosoft <115047461+atingmicrosoft@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:56:45 -0700 Subject: [PATCH] init changes from npm publish to esrp --- .../azure-pipelines/npm-publish-rush.yaml | 8 +++++ .../config/azure-pipelines/npm-publish.yaml | 7 +++++ .../azure-pipelines/templates/publish.yaml | 29 ++++++++++++++++--- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/common/config/azure-pipelines/npm-publish-rush.yaml b/common/config/azure-pipelines/npm-publish-rush.yaml index 4ac6559321a..b52514918b8 100644 --- a/common/config/azure-pipelines/npm-publish-rush.yaml +++ b/common/config/azure-pipelines/npm-publish-rush.yaml @@ -1,3 +1,9 @@ +parameters: + - name: TestRun + displayName: 'Test Run (Will Not Publish Tests)' + type: boolean + default: true + variables: - name: FORCE_COLOR value: 1 @@ -52,11 +58,13 @@ extends: - template: /common/config/azure-pipelines/templates/publish.yaml@self parameters: + TestRun: ${{ parameters.TestRun }} VersionPolicyName: noRush BranchName: $(SourceBranch) - template: /common/config/azure-pipelines/templates/publish.yaml@self parameters: + TestRun: ${{ parameters.TestRun }} VersionPolicyName: rush BranchName: $(SourceBranch) diff --git a/common/config/azure-pipelines/npm-publish.yaml b/common/config/azure-pipelines/npm-publish.yaml index e71295fae66..9c28cf09baf 100644 --- a/common/config/azure-pipelines/npm-publish.yaml +++ b/common/config/azure-pipelines/npm-publish.yaml @@ -1,3 +1,9 @@ +parameters: + - name: TestRun + displayName: 'Test Run (Will Not Publish Tests)' + type: boolean + default: true + variables: - name: FORCE_COLOR value: 1 @@ -47,6 +53,7 @@ extends: - template: /common/config/azure-pipelines/templates/publish.yaml@self parameters: + TestRun: ${{ parameters.TestRun }} VersionPolicyName: noRush BranchName: $(SourceBranch) diff --git a/common/config/azure-pipelines/templates/publish.yaml b/common/config/azure-pipelines/templates/publish.yaml index 281d7edae9b..765da90efd4 100644 --- a/common/config/azure-pipelines/templates/publish.yaml +++ b/common/config/azure-pipelines/templates/publish.yaml @@ -4,9 +4,30 @@ parameters: - name: BranchName type: string default: $(Build.SourceBranchName) + - name: TestRun + type: boolean + default: true steps: - - script: 'node common/scripts/install-run-rush.js publish --apply --publish --include-all --target-branch ${{ parameters.BranchName }} --add-commit-details --set-access-level public' - displayName: 'Rush Publish (Policy: ${{ parameters.VersionPolicyName }})' - env: - NPM_AUTH_TOKEN: $(npmToken) + - script: 'node common/scripts/install-run-rush.js publish --publish --pack --include-all --release-folder esrp-release' + displayName: 'Create TarBallz folder for Rush packages' + + - task: EsrpRelease@7 + inputs: + connectedservicename: 'ODSP-Web-NPM-ESRP' + keyvaultname: 'odsp-web-esrp' + signcertname: 'be2088dc-be24-46c8-b0b1-aa555603f375' + authcertname: 'be2088dc-odsp-web-ESRP' + clientid: 'be2088dc-be24-46c8-b0b1-aa555603f375' + intent: 'PackageDistribution' + folderlocation: '$(Pipeline.Workspace)/esrp-release' + waitforreleasecompletion: true + owners: 'jonguy@microsoft.com' + approvers: 'aterentiev@microsoft.com' + serviceendpointurl: 'https://api.esrp.microsoft.com' + mainpublisher: 'ESRPPACMAN' + domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2' + ${{ if eq(parameters.TestRun, false) }}: + contenttype: 'npm' + ${{ else }}: + contenttype: 'maven'