Skip to content

Commit 8c621ed

Browse files
chore: add release please, update release pipeline (#833)
1 parent d898d20 commit 8c621ed

File tree

6 files changed

+88
-20
lines changed

6 files changed

+88
-20
lines changed

.azure-pipelines/ci-build-production.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# 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.
33
# This pipeline will be extended to the OneESPT template
44
# 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+
57
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
68
trigger:
79
branches:
@@ -10,13 +12,22 @@ trigger:
1012
paths:
1113
include:
1214
- microsoft-graph.d.ts
15+
tags:
16+
include:
17+
- '*'
18+
1319
pr: none
20+
21+
variables:
22+
package_name_v1_0: 'microsoft-graph-types'
23+
1424
resources:
1525
repositories:
1626
- repository: 1ESPipelineTemplates
1727
type: git
1828
name: 1ESPipelineTemplates/1ESPipelineTemplates
1929
ref: refs/tags/release
30+
2031
extends:
2132
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2233
parameters:
@@ -29,7 +40,8 @@ extends:
2940
stages:
3041
- stage: build
3142
jobs:
32-
- job: job
43+
- job: build_v1_0_typings
44+
displayName: Pack v1.0 typings
3345
templateContext:
3446
outputs:
3547
- output: pipelineArtifact
@@ -39,23 +51,28 @@ extends:
3951
steps:
4052
- checkout: self
4153
displayName: checkout main
42-
- task: CopyFiles@2
43-
displayName: 'Copy Files to staging directory'
54+
55+
- task: UseNode@1
56+
displayName: 'Install Node.js'
4457
inputs:
45-
SourceFolder: '$(System.DefaultWorkingDirectory)'
46-
Contents: |
47-
**/*
48-
!spec/**
49-
!.azure-pipelines/**
50-
!.github/**
51-
!.git/**
52-
!.vscode/**
53-
!typings-demo.gif
54-
TargetFolder: '$(Build.ArtifactStagingDirectory)'
58+
version: '22.x'
59+
60+
- script: npm ci
61+
displayName: 'Install npm dependencies'
62+
workingDirectory: '$(Build.SourcesDirectory)'
63+
64+
# Pack and stage Beta TypeScript package
65+
- script: npm pack --pack-destination=$(Build.ArtifactStagingDirectory)
66+
displayName: 'Generate npm package $(package_name_v1_0)'
67+
workingDirectory: '$(Build.SourcesDirectory)'
5568

5669

5770
- stage: deploy
58-
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/main'), succeeded())
71+
displayName: 'Deploy v1.0 Typings'
72+
# This condition deploys on successful CI runs for success builds and also allows for manual deployments from an arbitrary branch
73+
condition: succeeded()
74+
dependsOn:
75+
- build
5976
jobs:
6077
- deployment: deploy_npm
6178
pool:
@@ -78,7 +95,7 @@ extends:
7895
deploy:
7996
steps:
8097
- task: EsrpRelease@9
81-
displayName: 'Publish Beta NPM package via ESRP Release'
98+
displayName: 'Publish V1.0 NPM package via ESRP Release'
8299
inputs:
83100
connectedservicename: "Federated DevX ESRP Managed Identity Connection"
84101
usemanagedidentity: false

.github/release-please.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
manifest: true
2+
primaryBranch: main
3+
handleGHRelease: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## -----------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See LICENSE.txt in the project root for license information.
4+
## -----------------------------------------------------------------------------
5+
#
6+
# Summary:
7+
# This GitHub Actions workflow automates the release process using Release Please.
8+
# It triggers on pushes to the main branch, generates a GitHub App token using organization
9+
# variables and secrets, and then runs the release-please-action to manage versioning and changelogs.
10+
11+
name: Release Please
12+
13+
on:
14+
push:
15+
branches:
16+
- main
17+
paths:
18+
- microsoft-graph.d.ts
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Generate GitHub App token
26+
id: app-token
27+
uses: actions/create-github-app-token@v2
28+
with:
29+
app-id: ${{ vars.RELEASE_PLEASE_TOKEN_PROVIDER_APP_ID }}
30+
private-key: ${{ secrets.RELEASE_PLEASE_TOKEN_PROVIDER_PEM }}
31+
32+
- name: Release Please
33+
uses: googleapis/release-please-action@v4
34+
with:
35+
token: ${{ steps.app-token.outputs.token }}
36+
config-file: release-please-config.json
37+
manifest-file: .release-please-manifest.json

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "2.43.0"
3+
}

microsoft-graph.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// Project: https://github.com/microsoftgraph/msgraph-typescript-typings
22
// Definitions by: Microsoft Graph Team <https://github.com/microsoftgraph>
33
// Michael Mainer <https://github.com/MIchaelMainer>
4-
// Peter Ombwa <https://github.com/peombwa>
5-
// Mustafa Zengin <https://github.com/zengin>
6-
// DeVere Dyett <https://github.com/ddyett>
7-
// Nikitha Udaykumar Chettiar <https://github.com/nikithauc>
8-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
4+
// Gavin Barron <https://github.com/gavinbarron>
5+
// Adrian Obando <https://github.com/adrian05-ms>
96
// TypeScript Version: 2.1
107

118
export as namespace microsoftgraph;

release-please-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"pull-request-header": ":rocket: A new MSGraph v1.0 typings release is coming up!",
4+
"bump-patch-for-minor-pre-major" : false,
5+
"include-component-in-tag": false,
6+
"packages": {
7+
".": {
8+
"release-type": "node"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)