From 16cf3851f29490085dda11621f872e7605fab7be Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Wed, 22 May 2024 10:18:19 +0300 Subject: [PATCH 1/4] fix: adds release please configuration --- .github/release-please.yml | 3 +++ .github/workflows/git-release.yml | 24 ------------------ .release-please-manifest.json | 4 +++ CHANGELOG.md | 9 ------- graph_request_adapter.go | 24 +++--------------- release-please-config.json | 17 +++++++++++++ scripts/incrementMinorVersion.ps1 | 41 ------------------------------- 7 files changed, 28 insertions(+), 94 deletions(-) create mode 100644 .github/release-please.yml delete mode 100644 .github/workflows/git-release.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json delete mode 100644 scripts/incrementMinorVersion.ps1 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/.github/workflows/git-release.yml b/.github/workflows/git-release.yml deleted file mode 100644 index 31416d49920..00000000000 --- a/.github/workflows/git-release.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Git Release - -on: - push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" - workflow_dispatch: - -permissions: - contents: write - -jobs: - Git_Release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Github Release - uses: anton-yurchenko/git-release@v6.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}} - DRAFT_RELEASE: "false" - PRE_RELEASE: "false" - CHANGELOG_FILE: "CHANGELOG.md" - ALLOW_EMPTY_CHANGELOG: "true" diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000000..567f814e727 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "0.103.0" +} + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f98efdede..8ac2622fe8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,15 +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). - -## [Unreleased] - -### Added - -### Changed - ## [0.103.0]- 2024-05-16 ### Changed diff --git a/graph_request_adapter.go b/graph_request_adapter.go index e4673a76fe7..556d38015b7 100644 --- a/graph_request_adapter.go +++ b/graph_request_adapter.go @@ -9,8 +9,11 @@ import ( ) var clientOptions = core.GraphClientOptions{ - GraphServiceVersion: "beta", + GraphServiceVersion: "beta", + /** The SDK version */ + // x-release-please-start-version GraphServiceLibraryVersion: "0.103.0", + // x-release-please-end } // GetDefaultClientOptions returns the default client options used by the GraphRequestAdapterBase and the middleware. @@ -72,22 +75,3 @@ func NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndH return result, nil } - - - - - - - - - - - - - - - - - - - diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000000..94fad13e17c --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,17 @@ +{ + "release-type": "go", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-component-in-tag": false, + "packages": { + ".": { + "package-name": "github.com/microsoftgraph/msgraph-sdk-go", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + "graph_request_adapter.go" + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" + } + \ No newline at end of file diff --git a/scripts/incrementMinorVersion.ps1 b/scripts/incrementMinorVersion.ps1 deleted file mode 100644 index b5dec44eb84..00000000000 --- a/scripts/incrementMinorVersion.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. - -<# -.Synopsis - Increment the minor version string in the gradle.properties if the major, - minor, or patch version hasn't been manually updated. -.Description - Assumptions: - This script assumes it is run from the repo root. - Minor version is typically auto-incremented. - -#> - -function Update-TelemetryVersion([string]$telemetryFilePath, [version]$version) { - $telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw - $telemetryFileContent = $telemetryFileContent -replace "\d{1,}\.\d{1,}\.\d{1,}", $version.ToString() - Set-Content -Path $telemetryFilePath $telemetryFileContent -} - -function Get-CurrentTelemetryVersion([string]$telemetryFilePath) { - $telemetryFileContent = Get-Content -Path $telemetryFilePath -Raw - if($telemetryFileContent -match "(\d{1,}\.\d{1,}\.\d{1,})") { - return [version]::Parse($Matches[1]) - } else { - Write-Error "Invalid version number format" - return $null; - } -} - -function Update-MinorVersionNumber([version]$currentVersion) { - return [version]::new($currentVersion.Major, $currentVersion.Minor + 1, 0); -} - -function Update-MinorVersion() { - $telemetryFilePath = Join-Path -Path $PWD.ToString() -ChildPath "../graph_request_adapter.go" - $currentVersion = Get-CurrentTelemetryVersion -telemetryFilePath $telemetryFilePath - $nextVersion = Update-MinorVersionNumber -currentVersion $currentVersion - Update-TelemetryVersion -version $nextVersion -telemetryFilePath $telemetryFilePath -} -Update-MinorVersion \ No newline at end of file From 5b9be54738295f909060f9b13b1dc53d15e36e03 Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Wed, 22 May 2024 10:21:32 +0300 Subject: [PATCH 2/4] fix: package name --- 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 94fad13e17c..0f91fb5c56c 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -5,7 +5,7 @@ "include-component-in-tag": false, "packages": { ".": { - "package-name": "github.com/microsoftgraph/msgraph-sdk-go", + "package-name": "github.com/microsoftgraph/msgraph-beta-sdk-go", "changelog-path": "CHANGELOG.md", "extra-files": [ "graph_request_adapter.go" From 6bebfd96517dc102e39356f38384b6b2e6c94699 Mon Sep 17 00:00:00 2001 From: Ronald K <43806892+rkodev@users.noreply.github.com> Date: Wed, 22 May 2024 11:11:37 +0300 Subject: [PATCH 3/4] Update .release-please-manifest.json --- .release-please-manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 567f814e727..e9945133a45 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - ".": "0.103.0" + ".": "0.104.0" } - \ No newline at end of file + From ed63748116c15c5068e34b502dd8f4b9fe0c1572 Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Fri, 24 May 2024 13:01:22 +0300 Subject: [PATCH 4/4] Update contributing --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 292d2ac986d..b6aad0010c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,3 +19,34 @@ 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. \ No newline at end of file