Skip to content

Commit bd61470

Browse files
authored
Merge pull request #436 from microsoftgraph/chore/migrating-deployment-to-azure
Chore: Migrating beta release to Azure
2 parents 055c3ed + 8357130 commit bd61470

3 files changed

Lines changed: 230 additions & 134 deletions

File tree

.azure-pipelines/release.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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-beta'
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+
vmImage: windows-latest
31+
stages:
32+
- stage: build
33+
jobs:
34+
- job: build_sdk
35+
pool:
36+
name: Azure-Pipelines-1ESPT-ExDShared
37+
image: ubuntu-latest
38+
os: linux
39+
displayName: Build, Test, and Package beta SDK
40+
templateContext:
41+
outputs:
42+
- output: pipelineArtifact
43+
displayName: 'Publish Artifact drop'
44+
targetPath: '$(Build.ArtifactStagingDirectory)'
45+
artifactName: npm_$(package_name)
46+
steps:
47+
- task: UseNode@1
48+
displayName: 'Install Node.js'
49+
inputs:
50+
version: '22.x'
51+
52+
- task: Npm@1
53+
inputs:
54+
command: 'ci'
55+
verbose: true
56+
displayName: 'Install npm dependencies with retry'
57+
58+
- script: npm run build
59+
displayName: 'Build project'
60+
workingDirectory: '$(Build.SourcesDirectory)'
61+
62+
- task: PowerShell@2
63+
displayName: 'Copy README.md to packages'
64+
inputs:
65+
filePath: './scripts/copy-readme.ps1'
66+
67+
68+
# Pack Typescript sdk packages
69+
- script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory) --workspaces
70+
displayName: 'Generate npm packages of the Typescript msgraph sdk'
71+
workingDirectory: '$(Build.SourcesDirectory)'
72+
73+
74+
- stage: deploy
75+
displayName: 'Deploy beta Typescript SDK packages'
76+
# This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch
77+
condition: or(and(contains(variables['Build.SourceBranch'], 'refs/tags/'), succeeded()), eq(variables['Build.Reason'], 'Manual'))
78+
dependsOn:
79+
- build
80+
jobs:
81+
- deployment: deploy_npm
82+
pool:
83+
name: Azure-Pipelines-1ESPT-ExDShared
84+
image: ubuntu-latest
85+
os: linux
86+
dependsOn: []
87+
environment: msgraph-npm-org
88+
89+
templateContext:
90+
type: releaseJob
91+
isProduction: true
92+
inputs:
93+
- input: pipelineArtifact
94+
artifactName: npm_$(package_name)
95+
targetPath: '$(Build.ArtifactStagingDirectory)/npm'
96+
97+
strategy:
98+
runOnce:
99+
deploy:
100+
steps:
101+
- task: EsrpRelease@9
102+
displayName: 'Publish beta NPM package via ESRP Release'
103+
inputs:
104+
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
105+
usemanagedidentity: false
106+
keyvaultname: 'akv-prod-eastus'
107+
authcertname: 'ReferenceLibraryPrivateCert'
108+
signcertname: 'ReferencePackagePublisherCertificate'
109+
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
110+
intent: 'PackageDistribution'
111+
contenttype: 'npm'
112+
contentsource: 'Folder'
113+
folderlocation: '$(Build.ArtifactStagingDirectory)/npm'
114+
owners: 'mmainer@microsoft.com,gavinbarron@microsoft.com'
115+
approvers: 'mmainer@microsoft.com,christiano@microsoft.com,lramosvea@microsoft.com,gavinbarron@microsoft.com'
116+
serviceendpointurl: 'https://api.esrp.microsoft.com'
117+
mainpublisher: 'ESRPRELPACMAN'
118+
domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'

.github/workflows/build.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,3 @@ jobs:
6363
- name: One or more build matrix options failed
6464
if: ${{ contains(needs.*.result, 'failure') }}
6565
run: exit 1
66-
67-
publish-npm:
68-
if: startsWith(github.ref, 'refs/tags/')
69-
needs: build
70-
environment:
71-
name: production_feed
72-
runs-on: ubuntu-latest
73-
steps:
74-
75-
- uses: actions/checkout@v5
76-
- uses: actions/setup-node@v6
77-
with:
78-
node-version: 22
79-
registry-url: https://registry.npmjs.org/
80-
- name: Copy README.md to packages
81-
shell: pwsh
82-
run: ./scripts/copy-readme.ps1
83-
- run: npm ci
84-
- run: npm run build
85-
- run: npx lerna publish from-package --no-push --yes
86-
env:
87-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)