Skip to content

Commit e11bd90

Browse files
authored
Merge pull request #938 from microsoftgraph/chore/update-pipeline-to-azure
Chore: update pipeline to azure
2 parents e48c875 + 36d8bd8 commit e11bd90

File tree

1 file changed

+117
-0
lines changed

1 file changed

+117
-0
lines changed

.azure-pipelines/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
2+
# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected.
3+
# This pipeline will be extended to the OneESPT template
4+
# The pool section has been filled with placeholder values, replace the pool section with your hosted pool, os, and image name. If you are using a Linux image, you must specify an additional windows image for SDL: https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sdlanalysis/overview#how-to-specify-a-windows-pool-for-the-sdl-source-analysis-stage
5+
# This publishes to https://www.npmjs.com/package/@microsoft/microsoft-graph-types
6+
7+
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
8+
trigger:
9+
tags:
10+
include:
11+
- '*'
12+
13+
pr: none
14+
15+
variables:
16+
package_name: 'typescript-msgraph-sdk-v1.0'
17+
18+
resources:
19+
repositories:
20+
- repository: 1ESPipelineTemplates
21+
type: git
22+
name: 1ESPipelineTemplates/1ESPipelineTemplates
23+
ref: refs/tags/release
24+
25+
extends:
26+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
27+
parameters:
28+
pool:
29+
name: Azure-Pipelines-1ESPT-ExDShared
30+
image: windows-latest
31+
os: windows
32+
stages:
33+
- stage: build
34+
jobs:
35+
- job: build_v1_0_typings
36+
displayName: Pack v1.0 typings
37+
templateContext:
38+
outputs:
39+
- output: pipelineArtifact
40+
displayName: 'Publish Artifact drop'
41+
targetPath: '$(Build.ArtifactStagingDirectory)/npm'
42+
artifactName: npm_$(package_name)
43+
steps:
44+
- checkout: self
45+
displayName: checkout main
46+
47+
- task: UseNode@1
48+
displayName: 'Install Node.js'
49+
inputs:
50+
version: '22.x'
51+
52+
- script: npm ci
53+
displayName: 'Install npm dependencies'
54+
workingDirectory: '$(Build.SourcesDirectory)'
55+
56+
- script: npm run build
57+
displayName: 'Build project'
58+
59+
- script: npm run test
60+
displayName: 'Run tests'
61+
62+
- task: PowerShell@2
63+
displayName: 'Copy README.md to packages'
64+
inputs:
65+
filePath: './scripts/copy-readme.ps1'
66+
67+
# Pack Typescript sdk packages
68+
- script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory)/npm --workspaces
69+
displayName: 'Generate npm packages of the Typescript msgraph sdk'
70+
workingDirectory: '$(Build.SourcesDirectory)'
71+
72+
73+
- stage: deploy
74+
displayName: 'Deploy v1.0 Typescript SDK packages'
75+
# This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch
76+
condition: or(and(contains(variables['Build.SourceBranch'], 'refs/tags/'), succeeded()), eq(variables['Build.Reason'], 'Manual'))
77+
dependsOn:
78+
- build
79+
jobs:
80+
- deployment: deploy_npm
81+
pool:
82+
name: Azure-Pipelines-1ESPT-ExDShared
83+
os: windows
84+
image: windows-latest
85+
dependsOn: []
86+
environment: msgraph-npm-org
87+
88+
templateContext:
89+
type: releaseJob
90+
isProduction: true
91+
inputs:
92+
- input: pipelineArtifact
93+
artifactName: npm_$(package_name)
94+
targetPath: '$(Build.ArtifactStagingDirectory)/npm'
95+
96+
strategy:
97+
runOnce:
98+
deploy:
99+
steps:
100+
- task: EsrpRelease@9
101+
displayName: 'Publish V1.0 NPM package via ESRP Release'
102+
inputs:
103+
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
104+
usemanagedidentity: false
105+
keyvaultname: 'akv-prod-eastus'
106+
authcertname: 'ReferenceLibraryPrivateCert'
107+
signcertname: 'ReferencePackagePublisherCertificate'
108+
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
109+
intent: 'PackageDistribution'
110+
contenttype: 'npm'
111+
contentsource: 'Folder'
112+
folderlocation: '$(Build.ArtifactStagingDirectory)/npm'
113+
owners: 'mmainer@microsoft.com,gavinbarron@microsoft.com'
114+
approvers: 'mmainer@microsoft.com,christiano@microsoft.com,lramosvea@microsoft.com,gavinbarron@microsoft.com'
115+
serviceendpointurl: 'https://api.esrp.microsoft.com'
116+
mainpublisher: 'ESRPRELPACMAN'
117+
domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'

0 commit comments

Comments
 (0)