Skip to content

Commit fe327a6

Browse files
author
Sahil Lagwal (MAQ LLC)
committed
Merged PR 662506: YAML pipeline for powerbi-javascript NPM release
### PR Classification This PR involves the migration of the powerbi-javascript NPM release process from a classical pipeline to a YAML-based pipeline. ### PR Summary This pull request introduces a YAML pipeline for the release of the `powerbi-javascript` NPM package. - Added `/.pipelines/powerbi-javascript-npm-release.yml` to define the stages and jobs for internal and external NPM publishing, approval processes, and marking the latest version. This PR introduces a new pipeline for the powerbi-javascript. The pipeline is designed to: - Publish the NPM package internally. - Manually trigger and obtain approval to release the package to the external feed. - Release the package externally upon approval, using the esrpRelease task. - Manually trigger and obtain approval to mark the external release as the latest version. - Mark the released package as the latest version after verifying external release success and approval. Test run with verbose logging: https://dev.azure.com/powerbi/Embedded/_build/results?buildId=12736900&view=results ### Pipeline stage execution snapshot ![image (10).png](https://dev.azure.com/powerbi/4c7b5adb-c2d0-4f18-b23c-edc4ac30f4e1/_apis/git/repositories/1dd63332-e003-46a3-ac6f-70213a1bcc2e/pullRequests/662506/attachments/image%20%2810%29.png) Related work items: #1516697
1 parent cfeafe9 commit fe327a6

1 file changed

Lines changed: 199 additions & 0 deletions

File tree

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
#################################################################################
2+
# OneBranch Pipelines - Official #
3+
# This pipeline was created by EasyStart from a sample located at: #
4+
# https://aka.ms/obpipelines/easystart/samples #
5+
# Documentation: https://aka.ms/obpipelines #
6+
# Yaml Schema: https://aka.ms/obpipelines/yaml/schema #
7+
# Retail Tasks: https://aka.ms/obpipelines/tasks #
8+
# Support: https://aka.ms/onebranchsup #
9+
#################################################################################
10+
11+
trigger: none # https://aka.ms/obpipelines/triggers
12+
13+
resources:
14+
repositories:
15+
- repository: templates
16+
type: git
17+
name: OneBranch.Pipelines/GovernedTemplates
18+
ref: refs/heads/main
19+
pipelines:
20+
- pipeline: PowerbiJavascriptOfficial
21+
source: powerbi-javascript-Official
22+
23+
variables:
24+
ENABLE_PRS_DELAYSIGN: 1
25+
ROOT: $(Build.SourcesDirectory)
26+
REPOROOT: $(Build.SourcesDirectory)
27+
OUTPUTROOT: $(REPOROOT)\out
28+
NUGET_XMLDOC_MODE: none
29+
system.debug: true
30+
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # Docker image which is used to build the project https://aka.ms/obpipelines/containers
31+
32+
extends:
33+
template: v2/OneBranch.Official.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
34+
parameters:
35+
globalSdl: # https://aka.ms/obpipelines/sdl
36+
tsa:
37+
enabled: true # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode.
38+
cg:
39+
failOnAlert: false
40+
publishLogs:
41+
enabled: false
42+
featureFlags:
43+
WindowsHostVersion: 1ESWindows2022
44+
45+
stages:
46+
- stage: Release_Internal
47+
displayName: Release NPM internal
48+
49+
jobs:
50+
- job: PublishToNPMInternal
51+
displayName: Publish to NPM Internal Feed
52+
pool:
53+
type: windows
54+
55+
variables:
56+
ob_outputDirectory: '$(OUTPUTROOT)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
57+
58+
steps:
59+
- task: Npm@1
60+
displayName: 'npm publish internal'
61+
inputs:
62+
command: publish
63+
workingDir: '$(Build.SourcesDirectory)'
64+
verbose: true
65+
publishRegistry: useFeed
66+
publishFeed: 'd95dbb95-6687-4730-b306-abe69704b45d' # PowerBI.SDKs
67+
68+
- stage: Prod_ApprovalToExternalPublish
69+
displayName: Approval to external publish
70+
trigger: manual
71+
dependsOn: []
72+
variables:
73+
ob_release_environment: Production
74+
ob_release_usedeploymentjob: true
75+
ob_deploymentjob_environment: PBIEmbed
76+
77+
jobs:
78+
- job: ApprovalToExternalPublish
79+
displayName: Approval to publish the powerbi-javascript package to external
80+
pool:
81+
type: release
82+
83+
steps:
84+
- download: PowerbiJavascriptOfficial
85+
86+
- stage: Release_External
87+
displayName: Release NPM external
88+
dependsOn:
89+
- Prod_ApprovalToExternalPublish
90+
condition: succeeded()
91+
92+
jobs:
93+
- job: PublishToNPMExternal
94+
displayName: Publish to NPM External
95+
pool:
96+
type: windows
97+
98+
variables:
99+
ob_outputDirectory: '$(OUTPUTROOT)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
100+
101+
steps:
102+
- task: DownloadPipelineArtifact@2
103+
displayName: "Download build files from the powerbi-javascript-official pipeline"
104+
inputs:
105+
buildType: 'specific'
106+
project: '4c7b5adb-c2d0-4f18-b23c-edc4ac30f4e1' # Embedded
107+
definition: '8483' # powerbi-javascript-Official
108+
buildVersionToDownload: 'latest'
109+
artifactName: 'drop'
110+
targetPath: '$(Pipeline.Workspace)\PublishedNpmArtifact'
111+
112+
- task: EsrpRelease@8
113+
inputs:
114+
keyvaultname: 'Trident-ESRP'
115+
authcertname: 'Fabric-ESRP-authentication'
116+
signcertname: 'Fabric-ESRP-signing'
117+
connectedservicename: 'Fabric ESRP-Embedded'
118+
clientid: 'f351681f-63af-4d0a-80b2-80bc2ec5cbb2'
119+
intent: 'PackageDistribution'
120+
contentType: 'NPM'
121+
contentsource: 'Folder'
122+
folderlocation: '$(Pipeline.Workspace)\PublishedNpmArtifact\outputs\package\tgz-package'
123+
waitforreleasecompletion: true
124+
owners: 'alihamud@microsoft.com'
125+
approvers: 'alonyeshurun@microsoft.com'
126+
serviceendpointurl: 'https://api.esrp.microsoft.com'
127+
mainpublisher: 'ESRPRELPACMAN'
128+
domaintenantid: '72f988bf-86f1-41af-91ab-2d7cd011db47'
129+
130+
- stage: Prod_ApprovalToAddLatestTag
131+
displayName: Approval to set the released package as latest
132+
trigger: manual
133+
dependsOn: []
134+
variables:
135+
ob_release_environment: Production
136+
ob_release_usedeploymentjob: true
137+
ob_deploymentjob_environment: PBIEmbed
138+
139+
jobs:
140+
- job: ApprovalToAddLatestTag
141+
displayName: Approval to add the latest tag
142+
pool:
143+
type: release
144+
145+
steps:
146+
- download: PowerbiJavascriptOfficial
147+
148+
- stage: MarkPowerbiJavascriptNpmPackageLatest
149+
displayName: Set as latest
150+
dependsOn:
151+
- Release_External
152+
- Prod_ApprovalToAddLatestTag
153+
condition: succeeded()
154+
155+
jobs:
156+
- job: AddLatestTag
157+
displayName: Add the latest tag on the released version
158+
pool:
159+
name: Azure Pipelines
160+
type: windows
161+
isCustom: true
162+
vmImage: 'windows-latest'
163+
164+
variables:
165+
ob_outputDirectory: '$(OUTPUTROOT)' # this directory is uploaded to pipeline artifacts, reddog and cloudvault. More info at https://aka.ms/obpipelines/artifacts
166+
167+
steps:
168+
- task: DownloadPipelineArtifact@2
169+
displayName: "Download build files from the powerbi-javascript-official pipeline"
170+
inputs:
171+
buildType: 'specific'
172+
project: '4c7b5adb-c2d0-4f18-b23c-edc4ac30f4e1' # Embedded
173+
definition: '8483' # powerbi-javascript-Official
174+
buildVersionToDownload: 'latest'
175+
artifactName: 'drop'
176+
targetPath: '$(Pipeline.Workspace)\PublishedNpmArtifact'
177+
178+
- task: PowerShell@2
179+
displayName: 'Extract powerbi-javascript latest version number'
180+
inputs:
181+
targetType: inline
182+
script: |
183+
$packagePath = "$(Pipeline.Workspace)\PublishedNpmArtifact\outputs\package\tgz-package"
184+
$file = Get-ChildItem $packagePath -Filter *.tgz | Select-Object -First 1
185+
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
186+
$version = $fileName -replace 'powerbi-client-', ''
187+
Write-Host "##vso[task.setvariable variable=packageVersion]$version"
188+
189+
- task: Npm@1
190+
displayName: 'npm mark version as latest'
191+
condition: succeeded()
192+
inputs:
193+
command: custom
194+
workingDir: '$(Pipeline.Workspace)\PublishedNpmArtifact\outputs\build\build_artifacts'
195+
verbose: true
196+
customCommand: 'dist-tag add powerbi-client@$(packageVersion) latest'
197+
customEndpoint: 'New Power BI NpmJS'
198+
publishRegistry: useFeed
199+
publishFeed: 'd95dbb95-6687-4730-b306-abe69704b45d' # PowerBI.SDKs

0 commit comments

Comments
 (0)