From f5a35458a3b3bd07d011502cca5930d8e6817742 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 11 Jun 2024 11:34:00 +0300 Subject: [PATCH 1/8] Add release please base configuration --- .github/release-please.yml | 3 +++ .release-please-manifest.json | 3 +++ release-please-config.json | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 .github/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000000..9d1d1d9c7b1 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +manifest: true +primaryBranch: main +handleGHRelease: true diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000000..73d3293b98f --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.4.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000000..eb0bac6025a --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,24 @@ +{ + "bootstrap-sha": "69079661c12dbfe6bf0c7cc379597d0c6c49e6f8", + "exclude-paths": [ + ".git", + ".idea", + ".github", + ".vscode" + ], + "release-type": "python", + "include-component-in-tag": false, + "include-v-in-tag": true, + "packages": { + ".": { + "package-name": "msgraph", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + "README.md", + "pyproject.toml", + "msgraph/_version.py" + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" + } \ No newline at end of file From b220e871204abde029f0aa7433aaad285b47b2e6 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Thu, 13 Jun 2024 15:49:15 +0300 Subject: [PATCH 2/8] update changelog -to enable updates by release please --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b5a84272c5..7f54514ba34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,6 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.5.0] - 2024-05-23 From 99f5a8024c4b460b9a41255b09b76bc7925a9473 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Thu, 13 Jun 2024 15:53:16 +0300 Subject: [PATCH 3/8] update contributing to give guideline on commit message format --- CONTRIBUTING.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f45154af313..79daa10b857 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,3 +19,35 @@ Revisions of this nature will result in a 0.0.X change of the version number. If major functionality is being added, or there will need to be gestation time for a change, it should be submitted against the __feature__ branch. Revisions of this nature will result in a 0.X.X change of the version number. + +## 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 miscallaneous non-sdk changesin the repo e.g. removing an unused file + +Adding a footer with the prefix **BREAKING CHANGE:** will cause an increment of the _major_ version. + From cc24a4d7653344631e2abcb2fb86bf008850d67a Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Thu, 13 Jun 2024 15:59:05 +0300 Subject: [PATCH 4/8] remove version update code to allow version updates be done by release-please --- .github/workflows/publish.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ba4ecdbd8e7..65b5b692fe2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,32 +9,6 @@ permissions: contents: write jobs: - version: - name: Update version - runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.12 - - name: Install poetry - run: | - pip install --upgrade poetry - - name: Update version - run: | - VERSION=${GITHUB_REF#refs/tags/v} - poetry version $VERSION - - name: Commit changes - run: | - git config --local user.email "${{ secrets.GIT_USER_EMAIL }}" - git config --local user.name "${{ secrets.GIT_USER_NAME }}" - git commit -am "Update version" - git push origin ${{ github.ref }} - - build: needs: [version] uses: ./.github/workflows/build.yml From bc830e145fe0f57f27cf70c693bb88f63f33a843 Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Thu, 13 Jun 2024 16:08:03 +0300 Subject: [PATCH 5/8] add comments around version to allow release please update version numbers --- msgraph/_version.py | 3 +++ pyproject.toml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/msgraph/_version.py b/msgraph/_version.py index e4f18370fa2..f6025298651 100644 --- a/msgraph/_version.py +++ b/msgraph/_version.py @@ -1 +1,4 @@ +# The SDK version +# x-release-please-start-version VERSION: str = '1.5.0' +# x-release-please-end diff --git a/pyproject.toml b/pyproject.toml index 28cd17fc13c..bda6de317a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,10 @@ build-backend = "setuptools.build_meta" [project] name = "msgraph-sdk" +# The SDK version +# x-release-please-start-version version = "1.5.0" +# x-release-please-end authors = [{name = "Microsoft", email = "graphtooling+python@microsoft.com"}] description = "The Microsoft Graph Python SDK" dependencies = [ From 954a864260c141231b222e9bd1f1fd83fdc585ab Mon Sep 17 00:00:00 2001 From: shemogumbe Date: Tue, 18 Jun 2024 11:06:16 +0300 Subject: [PATCH 6/8] update publich configuration --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 65b5b692fe2..43b30362813 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,6 @@ permissions: jobs: build: - needs: [version] uses: ./.github/workflows/build.yml publish: From 38a74495b135a31dacfbfa1627c0093ffe4703cb Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 18 Jun 2024 08:40:56 -0400 Subject: [PATCH 7/8] Apply suggestions from code review --- .release-please-manifest.json | 2 +- release-please-config.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 73d3293b98f..6180eb92ed1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.0" + ".": "1.5.0" } diff --git a/release-please-config.json b/release-please-config.json index eb0bac6025a..6a2d34dd894 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -14,7 +14,6 @@ "package-name": "msgraph", "changelog-path": "CHANGELOG.md", "extra-files": [ - "README.md", "pyproject.toml", "msgraph/_version.py" ] From 0b68d56e01cb7b1906f94584e723a92f31a5502c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 18 Jun 2024 08:44:05 -0400 Subject: [PATCH 8/8] Delete scripts directory --- scripts/incrementMinorVersion.ps1 | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 scripts/incrementMinorVersion.ps1 diff --git a/scripts/incrementMinorVersion.ps1 b/scripts/incrementMinorVersion.ps1 deleted file mode 100644 index dabc719ecea..00000000000 --- a/scripts/incrementMinorVersion.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -Push-Location -Path (Join-Path -Path $PSScriptRoot -ChildPath "..") -$versionFileContent = Get-Content -Path "msgraph/_version.py" -Raw -$version = $versionFileContent.Split("`r`n")[0] -replace "VERSION: str = '", '' -replace "'", '' -$versionParts = $version -split "\." -$versionParts[1] = [int]$versionParts[1] + 1 -$versionParts[2] = 0 -$newVersion = $versionParts -join "." -$versionFileContent -replace $version, $newVersion | Set-Content -Path "msgraph/_version.py" -NoNewline -$pyprojectFileContent = Get-Content -Path "pyproject.toml" -Raw -$pyprojectFileContent -replace $version, $newVersion | Set-Content -Path "pyproject.toml" -NoNewline -Pop-Location \ No newline at end of file