Skip to content

Commit 7ec7fca

Browse files
authored
Migrate release pipelines to ESRP release (#3009)
* Migrate to 1ES pipeline template and ESRP release * merge * npm command * pull script from pipeline artifacts * prod pipeline
1 parent 64c9db3 commit 7ec7fca

2 files changed

Lines changed: 132 additions & 69 deletions

File tree

tools/releases/prod-release.yml

Lines changed: 69 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,108 @@
11
trigger: none
22
resources:
33
repositories:
4-
- repository: GovernedTemplates
4+
- repository: CustomPipelineTemplates
55
type: git
6-
name: OneBranch.Pipelines/GovernedTemplates
7-
ref: refs/heads/main
6+
name: 1ESPipelineTemplates/OfficePipelineTemplates
7+
ref: refs/tags/release
88
pipelines:
99
- pipeline: microsoft-teams-library-js-pipeline
1010
source: 'microsoft-teams-library-js/M365 Platform/App SDK/OfficeDev.microsoft-teams-library-js'
1111
project: ISS
1212
extends:
13-
template: v2/Microsoft.Official.yml@GovernedTemplates
13+
template: v1/Office.Official.PipelineTemplate.yml@CustomPipelineTemplates
1414
parameters:
15-
platform:
16-
name: m365
17-
workload: Substrate
18-
serviceTreeId: $(serviceTreeId)
19-
serviceGroupName: Platform
15+
pool:
16+
name: Azure-Pipelines-1ESPT-ExDShared
17+
image: windows-latest
18+
os: windows
19+
serviceTreeId: $(serviceTreeId)
20+
customBuildTags:
21+
- ES365AIMigrationTooling-Release-MOBR
2022
stages:
2123
- stage: Prod_Lockbox_Approval_Deployment
2224
displayName: Lockbox Approval/Deployment
2325
dependsOn: []
24-
variables:
25-
stage_type: deployment
26-
azure_subscription_ids: $(subscriptionId)
26+
templateContext:
27+
cloud: Public
28+
isProduction: true
29+
approval:
30+
workflow: lockbox
31+
scope:
32+
serviceGroupName: Platform
33+
subscriptionIds:
34+
- $(subscriptionId)
2735
jobs:
2836
- job: Agent_job
2937
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
30-
pool:
31-
type: release
38+
templateContext:
39+
type: releaseJob
40+
workflow: m365-custom
41+
inputs:
42+
- input: pipelineArtifact
43+
pipeline: microsoft-teams-library-js-pipeline
44+
artifactName: NPMFeed
45+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed
46+
- input: pipelineArtifact
47+
pipeline: microsoft-teams-library-js-pipeline
48+
artifactName: CDNFeed
49+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/CDNFeed
50+
- input: pipelineArtifact
51+
pipeline: microsoft-teams-library-js-pipeline
52+
artifactName: scripts
53+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/scripts
3254
steps:
33-
- download: microsoft-teams-library-js-pipeline
3455
- task: prepare-deployment@1
35-
displayName:
56+
displayName: Prepare deployment
3657
inputs:
3758
taskType: credentialFetchTaskAzureRM
3859
armserviceconnection: $(serviceConnectionId)
3960
subscriptionid: $(subscriptionId)
40-
- task: AzureKeyVault@2
41-
displayName: 'Azure Key Vault: $(keyVaultName)'
61+
- task: AssetRetention@3
62+
displayName: ARtifact Retention Orchestrator Workflow (ARROW)
4263
inputs:
43-
ConnectedServiceName: $(serviceConnectionId)
44-
KeyVaultName: $(keyVaultName)
45-
SecretsFilter: $(keyVaultSecretsFilter)
64+
ArrowServiceConnection: $(arrowServiceConnectionId)
65+
IsShipped: true
4666
- task: NodeTool@0
4767
displayName: Use Node 18.x
4868
inputs:
4969
versionSpec: 18.x
50-
- task: PowerShell@2
51-
displayName: Update npmrc with NPM-TOKEN
52-
inputs:
53-
targetType: 'filePath'
54-
filePath: 'tools/releases/powershell-commands/update-npmrc-with-npm-token.ps1'
55-
arguments: -PIPELINE_WORKSPACE $(PIPELINE.WORKSPACE) -NPM_TOKEN $(NPM-TOKEN)
5670
- task: Npm@1
57-
displayName: Publish to npm (tag latest) KV
71+
displayName: Build NPM package for release
5872
inputs:
5973
command: custom
60-
workingDir: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/NPMFeed
74+
workingDir: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed
6175
verbose: false
62-
customCommand: publish --tag latest
76+
customCommand: pack
77+
- task: EsrpRelease@10
78+
displayName: Publish to npm (tag beta) - ESRP release
79+
inputs:
80+
connectedservicename: '$(connectedServiceName)'
81+
usemanagedidentity: true
82+
keyvaultname: '$(keyVaultName)'
83+
signcertname: '$(signCertName)'
84+
clientid: '$(clientId)'
85+
intent: 'PackageDistribution'
86+
contenttype: 'npm'
87+
contentsource: 'Folder'
88+
folderlocation: '$(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed'
89+
waitforreleasecompletion: true
90+
owners: $(owners)
91+
approvers: $(approvers)
92+
serviceendpointurl: '$(serviceEndpointUrl)'
93+
mainpublisher: '$(mainPublisher)'
94+
domaintenantid: '$(domainTenantId)'
95+
productstate: 'Latest'
6396
- task: M365CdnAssetsUpload@3
6497
displayName: Push teams-js to M365 1CDN (Prod)
6598
inputs:
66-
SourcePath: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/CDNFeed/*
99+
SourcePath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/CDNFeed/*
67100
ConnectedServiceNameARM: $(serviceConnectionId)
68101
ContainerName: teams-js
69102
AdditionalArgumentsForBlobCopy: --overwrite=false --log-level=INFO --recursive
70-
- task: AssetRetention@3
71-
displayName: ARtifact Retention Orchestrator Workflow (ARROW)
103+
- task: PowerShell@2
104+
displayName: View Published Package URLs
72105
inputs:
73-
ArrowServiceConnection: $(arrowServiceConnectionId)
74-
IsShipped: true
106+
targetType: 'filePath'
107+
filePath: 'microsoft-teams-library-js-pipeline/scripts/view-published-pkg-urls.ps1'
108+
arguments: -PIPELINE_WORKSPACE $(System.DefaultWorkingDirectory)

tools/releases/sdf-release.yml

Lines changed: 63 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
trigger: none
22
resources:
33
repositories:
4-
- repository: GovernedTemplates
4+
- repository: CustomPipelineTemplates
55
type: git
6-
name: OneBranch.Pipelines/GovernedTemplates
7-
ref: refs/heads/main
6+
name: 1ESPipelineTemplates/OfficePipelineTemplates
7+
ref: refs/tags/release
88
pipelines:
99
- pipeline: microsoft-teams-library-js-pipeline
1010
source: 'microsoft-teams-library-js/M365 Platform/App SDK/OfficeDev.microsoft-teams-library-js'
@@ -13,28 +13,50 @@ variables:
1313
- name: System.Debug
1414
value: true
1515
extends:
16-
template: v2/Microsoft.Official.yml@GovernedTemplates
16+
template: v1/Office.Official.PipelineTemplate.yml@CustomPipelineTemplates
1717
parameters:
18-
platform:
19-
name: m365
20-
workload: Substrate
21-
serviceTreeId: $(serviceTreeId)
22-
serviceGroupName: Platform
18+
pool:
19+
name: Azure-Pipelines-1ESPT-ExDShared
20+
image: windows-latest
21+
os: windows
22+
serviceTreeId: $(serviceTreeId)
23+
customBuildTags:
24+
- ES365AIMigrationTooling-Release-MOBR
2325
stages:
2426
- stage: Prod_Lockbox_Approval_Deployment
2527
displayName: Lockbox Approval/Deployment
2628
dependsOn: []
27-
variables:
28-
stage_type: deployment
29-
azure_subscription_ids: $(subscriptionId)
29+
templateContext:
30+
cloud: Public
31+
isProduction: false
32+
approval:
33+
workflow: lockbox
34+
scope:
35+
serviceGroupName: Platform
36+
subscriptionIds:
37+
- $(subscriptionId)
3038
jobs:
3139
- job: Agent_job
32-
pool:
33-
type: release
40+
templateContext:
41+
type: releaseJob
42+
workflow: m365-custom
43+
inputs:
44+
- input: pipelineArtifact
45+
pipeline: microsoft-teams-library-js-pipeline
46+
artifactName: NPMFeed
47+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed
48+
- input: pipelineArtifact
49+
pipeline: microsoft-teams-library-js-pipeline
50+
artifactName: CDNFeed
51+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/CDNFeed
52+
- input: pipelineArtifact
53+
pipeline: microsoft-teams-library-js-pipeline
54+
artifactName: scripts
55+
targetPath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/scripts
56+
3457
steps:
35-
- download: microsoft-teams-library-js-pipeline
3658
- task: prepare-deployment@1
37-
displayName:
59+
displayName: Prepare deployment
3860
inputs:
3961
taskType: credentialFetchTaskAzureRM
4062
armserviceconnection: $(serviceConnectionId)
@@ -44,33 +66,40 @@ extends:
4466
inputs:
4567
ArrowServiceConnection: $(arrowServiceConnectionId)
4668
IsShipped: true
47-
- task: AzureKeyVault@2
48-
displayName: 'Azure Key Vault: $(keyVaultName)'
49-
inputs:
50-
ConnectedServiceName: $(serviceConnectionId)
51-
KeyVaultName: $(keyVaultName)
52-
SecretsFilter: $(keyVaultSecretsFilter)
5369
- task: NodeTool@0
5470
displayName: Use Node 18.x
5571
inputs:
5672
versionSpec: 18.x
57-
- task: PowerShell@2
58-
displayName: Update npmrc with NPM-TOKEN
59-
inputs:
60-
targetType: 'filePath'
61-
filePath: 'tools/releases/powershell-commands/update-npmrc-with-npm-token.ps1'
62-
arguments: -PIPELINE_WORKSPACE $(PIPELINE.WORKSPACE) -NPM_TOKEN $(NPM-TOKEN)
6373
- task: Npm@1
64-
displayName: Publish to npm (tag beta) KV
74+
displayName: Build NPM package for release
6575
inputs:
6676
command: custom
67-
workingDir: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/NPMFeed
77+
workingDir: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed
6878
verbose: false
69-
customCommand: publish --tag beta
79+
customCommand: pack
80+
- task: EsrpRelease@10
81+
displayName: Publish to npm (tag beta) - ESRP release
82+
inputs:
83+
connectedservicename: '$(connectedServiceName)'
84+
usemanagedidentity: true
85+
keyvaultname: '$(keyVaultName)'
86+
signcertname: '$(signCertName)'
87+
clientid: '$(clientId)'
88+
intent: 'PackageDistribution'
89+
contenttype: 'npm'
90+
contentsource: 'Folder'
91+
folderlocation: '$(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/NPMFeed'
92+
waitforreleasecompletion: true
93+
owners: $(owners)
94+
approvers: $(approvers)
95+
serviceendpointurl: '$(serviceEndpointUrl)'
96+
mainpublisher: '$(mainPublisher)'
97+
domaintenantid: '$(domainTenantId)'
98+
productstate: 'Beta'
7099
- task: M365CdnAssetsUpload@3
71100
displayName: Push teams-js to M365 1CDN (SDF)
72101
inputs:
73-
SourcePath: $(PIPELINE.WORKSPACE)/microsoft-teams-library-js-pipeline/CDNFeed/*
102+
SourcePath: $(System.DefaultWorkingDirectory)/microsoft-teams-library-js-pipeline/CDNFeed/*
74103
ConnectedServiceNameARM: $(serviceConnectionId)
75104
Environment: PublicCloudSDF
76105
ContainerName: teams-js
@@ -79,5 +108,5 @@ extends:
79108
displayName: View Published Package URLs
80109
inputs:
81110
targetType: 'filePath'
82-
filePath: 'tools/releases/powershell-commands/view-published-pkg-urls.ps1'
83-
arguments: -PIPELINE_WORKSPACE $(PIPELINE.WORKSPACE)
111+
filePath: 'microsoft-teams-library-js-pipeline/scripts/view-published-pkg-urls.ps1'
112+
arguments: -PIPELINE_WORKSPACE $(System.DefaultWorkingDirectory)

0 commit comments

Comments
 (0)