Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .azure-pipelines/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# 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.
# This pipeline will be extended to the OneESPT template
# 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
# This publishes to https://www.npmjs.com/package/@microsoft/microsoft-graph-types

name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
tags:
include:
- '*'

pr: none

variables:
package_name: 'typescript-msgraph-sdk-beta'

resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
vmImage: windows-latest
stages:
- stage: build
jobs:
- job: build_sdk
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: ubuntu-latest
os: linux
displayName: Build, Test, and Package beta SDK
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifact drop'
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: npm_$(package_name)
steps:
- task: UseNode@1
displayName: 'Install Node.js'
inputs:
version: '22.x'

- task: Npm@1
inputs:
command: 'ci'
verbose: true
displayName: 'Install npm dependencies with retry'

- script: npm run build
displayName: 'Build project'
workingDirectory: '$(Build.SourcesDirectory)'

- task: PowerShell@2
displayName: 'Copy README.md to packages'
inputs:
filePath: './scripts/copy-readme.ps1'


# Pack Typescript sdk packages
- script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory) --workspaces
displayName: 'Generate npm packages of the Typescript msgraph sdk'
workingDirectory: '$(Build.SourcesDirectory)'


- stage: deploy
displayName: 'Deploy beta Typescript SDK packages'
# This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch
condition: or(and(contains(variables['Build.SourceBranch'], 'refs/tags/'), succeeded()), eq(variables['Build.Reason'], 'Manual'))
dependsOn:
- build
jobs:
- deployment: deploy_npm
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: ubuntu-latest
os: linux
dependsOn: []
environment: msgraph-npm-org

templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: npm_$(package_name)
targetPath: '$(Build.ArtifactStagingDirectory)/npm'

strategy:
runOnce:
deploy:
steps:
- task: EsrpRelease@9
displayName: 'Publish beta NPM package via ESRP Release'
inputs:
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
usemanagedidentity: false
keyvaultname: 'akv-prod-eastus'
authcertname: 'ReferenceLibraryPrivateCert'
signcertname: 'ReferencePackagePublisherCertificate'
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
intent: 'PackageDistribution'
contenttype: 'npm'
contentsource: 'Folder'
folderlocation: '$(Build.ArtifactStagingDirectory)/npm'
owners: 'mmainer@microsoft.com,gavinbarron@microsoft.com'
approvers: 'mmainer@microsoft.com,christiano@microsoft.com,lramosvea@microsoft.com,gavinbarron@microsoft.com'
serviceendpointurl: 'https://api.esrp.microsoft.com'
mainpublisher: 'ESRPRELPACMAN'
domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
22 changes: 0 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,3 @@ jobs:
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

publish-npm:
if: startsWith(github.ref, 'refs/tags/')
needs: build
environment:
name: production_feed
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v5
- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Copy README.md to packages
shell: pwsh
run: ./scripts/copy-readme.ps1
- run: npm ci
- run: npm run build
- run: npx lerna publish from-package --no-push --yes
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Loading