Skip to content

Commit 8797e48

Browse files
committed
migrating beta release
1 parent 055c3ed commit 8797e48

3 files changed

Lines changed: 236 additions & 134 deletions

File tree

.azure-pipelines/release.yml

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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+
# excluding test for now since it requires a tenant and secrets to run
63+
# TODO: create secrets to the pipeline similar to https://github.com/microsoftgraph/msgraph-sdk-typescript/settings/secrets/actions and the build.yml file
64+
# - script: npm run test
65+
# displayName: 'Run tests'
66+
# workingDirectory: '$(Build.SourcesDirectory)'
67+
68+
- task: PowerShell@2
69+
displayName: 'Copy README.md to packages'
70+
inputs:
71+
filePath: './scripts/copy-readme.ps1'
72+
73+
74+
# Pack Typescript sdk packages
75+
- script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory) --workspaces
76+
displayName: 'Generate npm packages of the Typescript msgraph sdk'
77+
workingDirectory: '$(Build.SourcesDirectory)'
78+
79+
80+
- stage: deploy
81+
displayName: 'Deploy beta Typescript SDK packages'
82+
# This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch
83+
condition: or(and(contains(variables['Build.SourceBranch'], 'refs/tags/'), succeeded()), eq(variables['Build.Reason'], 'Manual'))
84+
dependsOn:
85+
- build
86+
jobs:
87+
- deployment: deploy_npm
88+
pool:
89+
name: Azure-Pipelines-1ESPT-ExDShared
90+
image: ubuntu-latest
91+
os: linux
92+
dependsOn: []
93+
environment: msgraph-npm-org
94+
95+
templateContext:
96+
type: releaseJob
97+
isProduction: true
98+
inputs:
99+
- input: pipelineArtifact
100+
artifactName: npm_$(package_name)
101+
targetPath: '$(Build.ArtifactStagingDirectory)/npm'
102+
103+
strategy:
104+
runOnce:
105+
deploy:
106+
steps:
107+
- task: EsrpRelease@9
108+
displayName: 'Publish beta NPM package via ESRP Release'
109+
inputs:
110+
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
111+
usemanagedidentity: false
112+
keyvaultname: 'akv-prod-eastus'
113+
authcertname: 'ReferenceLibraryPrivateCert'
114+
signcertname: 'ReferencePackagePublisherCertificate'
115+
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
116+
intent: 'PackageDistribution'
117+
contenttype: 'npm'
118+
contentsource: 'Folder'
119+
folderlocation: '$(Build.ArtifactStagingDirectory)/npm'
120+
owners: 'mmainer@microsoft.com,gavinbarron@microsoft.com'
121+
approvers: 'mmainer@microsoft.com,christiano@microsoft.com,lramosvea@microsoft.com,gavinbarron@microsoft.com'
122+
serviceendpointurl: 'https://api.esrp.microsoft.com'
123+
mainpublisher: 'ESRPRELPACMAN'
124+
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)