From cabe4f9ccd894d7d189e3273d8e15af8552884d6 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 12:19:44 +0300 Subject: [PATCH 1/8] Add release please yaml file --- .github/release-please.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/release-please.yml diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000000..54c715a494c --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +manifest: true +primaryBranch: main +handleGHRelease: true From cd00b1cadb2b4f8c40233f960f8ac07007b1fbe4 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 14:38:13 +0300 Subject: [PATCH 2/8] Add the manifest file with current version --- .release-please-manifest.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000000..40a86afff80 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.0.0-preview.30" +} \ No newline at end of file From 5008dd7926137e6f8546aad97d6315f18943ca82 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 14:38:34 +0300 Subject: [PATCH 3/8] Update the contributing guidelines for commit messages --- CONTRIBUTING.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 25561230cb1..103386ecae3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,40 @@ The best way to get started with a contribution is to start a dialog with us. Sometimes features will be under development or out of scope for this library and it's best to check before starting work on contribution, especially for large work items. ## Pull requests -All pull requests should be submitted against the **main** branch or a specific feature branch. +All pull requests should be submitted against the **main** branch or a specific feature branch. The `main` branch is intended to represent the code released in the most-recent npm package. + +When a new package is about to be released, the release PR will be merged into `main`. The package will be generated from `main`. + +## Commit message format + +To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) +format. + +Each commit message consists of a **header**, an optional **body** and an optional **footer**. The header is the first line of the commit and +MUST have a **type** (see below for a list of types) and a **description**. An optional **scope** can be added to the header to give extra context. + +``` +[optional scope]: + + + + +``` + +The recommended commit types used are: + + - **feat** for feature updates (increments the _minor_ version) + - **fix** for bug fixes (increments the _patch_ version) + - **perf** for performance related changes e.g. optimizing an algorithm + - **refactor** for code refactoring changes + - **test** for test suite updates e.g. adding a test or fixing a test + - **style** for changes that don't affect the meaning of code. e.g. formatting changes + - **docs** for documentation updates e.g. ReadMe update or code documentation updates + - **build** for build system changes (gradle updates, external dependency updates) + - **ci** for CI configuration file changes e.g. updating a pipeline + - **chore** for miscellaneous non-sdk changes in the repo e.g. removing an unused file + +Adding a footer with the prefix **BREAKING CHANGE:** will cause an increment of the _major_ version. Some things to note about this project: From 6fa8ac02ff8884416deee9c9c6ddb9cd576bb975 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 14:38:50 +0300 Subject: [PATCH 4/8] Add the config --- .github/workflows/build.yml | 2 +- packages/msgraph-sdk/version.ts | 2 ++ release-please-config.json | 29 +++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 release-please-config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59f92fc7bc5..b9ffb251937 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: run: exit 1 publish-npm: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'auto dependabot') }} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.before == 'release-please--branches--main--components--msgraph-ts-sdk')}} needs: build environment: name: production_feed diff --git a/packages/msgraph-sdk/version.ts b/packages/msgraph-sdk/version.ts index 75829d4315d..c2bfbed2967 100644 --- a/packages/msgraph-sdk/version.ts +++ b/packages/msgraph-sdk/version.ts @@ -1 +1,3 @@ +// x-release-please-start-version export const version = "1.0.0-preview.13"; +// x-release-please-end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000000..6fbd53e350a --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,29 @@ +{ + "bootstrap-sha": "73cd29789d538494d3b9d7a7922c26aad7243ddd", + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "pull-request-header": ":rocket: A new MSGraph TypeScript SDK release is coming up!", + "include-component-in-tag": false, + "versioning": "prerelease", + "packages": { + ".": { + "package-name": "msgraph-ts-sdk", + "changelog-path": "CHANGELOG.md", + "release-type": "node", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "include-v-in-tag": true, + "draft": false, + "prerelease": true + } + }, + "extra-files": [ + "lerna.json", + { + "type": "json", + "path": "packages/*/package.json", + "glob": true, + "jsonpath": "$.version" + }, + "packages/msgraph-sdk/version.ts" + ] +} \ No newline at end of file From 90ca3898493d611390c9d4236cfd06abb00da582 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 14:39:50 +0300 Subject: [PATCH 5/8] Update the bootstrap sha --- release-please-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index 6fbd53e350a..72b25270122 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,5 @@ { - "bootstrap-sha": "73cd29789d538494d3b9d7a7922c26aad7243ddd", + "bootstrap-sha": "722436d5c5202b7dd10f048c1cdf6946cd67fff6", "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", "pull-request-header": ":rocket: A new MSGraph TypeScript SDK release is coming up!", "include-component-in-tag": false, From 333d53a6cb4fb198c16f97319b4da17c5f811246 Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Tue, 15 Oct 2024 14:48:40 +0300 Subject: [PATCH 6/8] Delete script --- scripts/incrementMinorVersion.ps1 | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 scripts/incrementMinorVersion.ps1 diff --git a/scripts/incrementMinorVersion.ps1 b/scripts/incrementMinorVersion.ps1 deleted file mode 100644 index f09705144e1..00000000000 --- a/scripts/incrementMinorVersion.ps1 +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -<# -.Synopsis - Placeholder to Increment the minor version string in package.json if the major, - minor, or patch version hasn't been manually updated. -.Description - Assumptions: - Targets package.json - This script assumes it is run from the repo root. - Minor version is typically auto-incremented. - - TODO: Version number will be incremented after first release of the SDK -#> From 2cb90b4155a96d04756bd875bf3487a72cfb664e Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Wed, 16 Oct 2024 18:10:39 +0300 Subject: [PATCH 7/8] Update publishing condition to use actor --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9ffb251937..671fe92dc6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,7 @@ jobs: run: exit 1 publish-npm: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.before == 'release-please--branches--main--components--msgraph-ts-sdk')}} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.actor == 'release-please[bot]'}} needs: build environment: name: production_feed From e4788f7b844afabb19c7722fc46b3aac241be5bf Mon Sep 17 00:00:00 2001 From: Musale Martin Date: Wed, 16 Oct 2024 18:11:10 +0300 Subject: [PATCH 8/8] Infer package name from the project --- release-please-config.json | 1 - 1 file changed, 1 deletion(-) diff --git a/release-please-config.json b/release-please-config.json index 72b25270122..3a6e805ba5d 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -6,7 +6,6 @@ "versioning": "prerelease", "packages": { ".": { - "package-name": "msgraph-ts-sdk", "changelog-path": "CHANGELOG.md", "release-type": "node", "bump-minor-pre-major": false,