From 2a55a757d4d84051b056a955187be75c3dec97d3 Mon Sep 17 00:00:00 2001 From: "Michael Mainer (from Dev Box)" <8527305+MIchaelMainer@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:51:45 -0700 Subject: [PATCH] chore: add release please, update release pipeline --- .azure-pipelines/ci-build-production.yml | 47 ++++++++++++++++-------- .github/release-please.yml | 3 ++ .github/workflows/release-please-gha.yml | 37 +++++++++++++++++++ .release-please-manifest.json | 3 ++ microsoft-graph.d.ts | 7 +--- release-please-config.json | 11 ++++++ 6 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 .github/release-please.yml create mode 100644 .github/workflows/release-please-gha.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.azure-pipelines/ci-build-production.yml b/.azure-pipelines/ci-build-production.yml index 5ea279a..012934f 100644 --- a/.azure-pipelines/ci-build-production.yml +++ b/.azure-pipelines/ci-build-production.yml @@ -2,6 +2,8 @@ # 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: branches: @@ -10,13 +12,22 @@ trigger: paths: include: - microsoft-graph.d.ts + tags: + include: + - '*' + pr: none + +variables: + package_name_v1_0: 'microsoft-graph-types' + resources: repositories: - repository: 1ESPipelineTemplates type: git name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/release + extends: template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates parameters: @@ -29,7 +40,8 @@ extends: stages: - stage: build jobs: - - job: job + - job: build_v1_0_typings + displayName: Pack v1.0 typings templateContext: outputs: - output: pipelineArtifact @@ -39,23 +51,28 @@ extends: steps: - checkout: self displayName: checkout main - - task: CopyFiles@2 - displayName: 'Copy Files to staging directory' + + - task: UseNode@1 + displayName: 'Install Node.js' inputs: - SourceFolder: '$(System.DefaultWorkingDirectory)' - Contents: | - **/* - !spec/** - !.azure-pipelines/** - !.github/** - !.git/** - !.vscode/** - !typings-demo.gif - TargetFolder: '$(Build.ArtifactStagingDirectory)' + version: '22.x' + + - script: npm ci + displayName: 'Install npm dependencies' + workingDirectory: '$(Build.SourcesDirectory)' + + # Pack and stage Beta TypeScript package + - script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory) + displayName: 'Generate npm package $(package_name_v1_0)' + workingDirectory: '$(Build.SourcesDirectory)' - stage: deploy - condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded()) + displayName: 'Deploy v1.0 Typings' + # This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch + condition: succeeded() + dependsOn: + - build jobs: - deployment: deploy_npm pool: @@ -78,7 +95,7 @@ extends: deploy: steps: - task: EsrpRelease@9 - displayName: 'Publish Beta NPM package via ESRP Release' + displayName: 'Publish V1.0 NPM package via ESRP Release' inputs: connectedservicename: "Federated DevX ESRP Managed Identity Connection" usemanagedidentity: false diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 0000000..9d1d1d9 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +manifest: true +primaryBranch: main +handleGHRelease: true diff --git a/.github/workflows/release-please-gha.yml b/.github/workflows/release-please-gha.yml new file mode 100644 index 0000000..5ba98e4 --- /dev/null +++ b/.github/workflows/release-please-gha.yml @@ -0,0 +1,37 @@ +## ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See LICENSE.txt in the project root for license information. +## ----------------------------------------------------------------------------- +# +# Summary: +# This GitHub Actions workflow automates the release process using Release Please. +# It triggers on pushes to the main branch, generates a GitHub App token using organization +# variables and secrets, and then runs the release-please-action to manage versioning and changelogs. + +name: Release Please + +on: + push: + branches: + - main + paths: + - microsoft-graph.d.ts +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.RELEASE_PLEASE_TOKEN_PROVIDER_APP_ID }} + private-key: ${{ secrets.RELEASE_PLEASE_TOKEN_PROVIDER_PEM }} + + - name: Release Please + uses: googleapis/release-please-action@v4 + with: + token: ${{ steps.app-token.outputs.token }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..18959fe --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.43.0" +} \ No newline at end of file diff --git a/microsoft-graph.d.ts b/microsoft-graph.d.ts index 62882a4..1f9cae0 100644 --- a/microsoft-graph.d.ts +++ b/microsoft-graph.d.ts @@ -1,11 +1,8 @@ // Project: https://github.com/microsoftgraph/msgraph-typescript-typings // Definitions by: Microsoft Graph Team // Michael Mainer -// Peter Ombwa -// Mustafa Zengin -// DeVere Dyett -// Nikitha Udaykumar Chettiar -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Gavin Barron +// Adrian Obando // TypeScript Version: 2.1 export as namespace microsoftgraph; diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..29dd167 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "pull-request-header": ":rocket: A new MSGraph v1.0 typings release is coming up!", + "bump-patch-for-minor-pre-major" : false, + "include-component-in-tag": false, + "packages": { + ".": { + "release-type": "node" + } + } +} \ No newline at end of file