From a8af3b419ef27ab7d4c0a0811881423d6d60063f Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Tue, 21 May 2024 18:28:59 +0300 Subject: [PATCH 1/6] Adds release please configuration --- .github/release-please.yml | 3 +++ .github/workflows/release-please.yml | 28 ++++++++++++++++++++++++++++ .release-please-manifest.json | 4 ++++ release-please-config.json | 14 ++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .github/release-please.yml create mode 100644 .github/workflows/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 0000000000..9d1d1d9c7b --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +manifest: true +primaryBranch: main +handleGHRelease: true diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000000..af5718cb58 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,28 @@ +# .github/workflows/release-please.yml + +name: Release Please + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: '^1.20' + + - name: Release Please + uses: google-github-actions/release-please-action@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000000..01b74c0256 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "1.42.0" +} + \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000000..b0802dcb7c --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,14 @@ +{ + "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" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" + } + \ No newline at end of file From 2709e83f97a764969f26c4f8a49b278dfdc7f2a6 Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Tue, 21 May 2024 18:34:04 +0300 Subject: [PATCH 2/6] feat: remove changelog info --- CHANGELOG.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d95fedc9a9..f064fa2439 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 - ## [1.42.0]- 2024-05-16 ### Changed From ea610bd0bd9544115f481800aa788b89240c1239 Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Tue, 21 May 2024 19:18:31 +0300 Subject: [PATCH 3/6] fix: release please format --- .github/workflows/release-please.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index af5718cb58..a04074a18f 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -25,4 +25,7 @@ jobs: - name: Release Please uses: google-github-actions/release-please-action@v3 with: + release-type: 'go' + config-file: release-please-config.json + env: token: ${{ secrets.GITHUB_TOKEN }} From a6bb6ef5d3cd7dddbda0528469c5b1041803224e Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Wed, 22 May 2024 00:53:08 +0300 Subject: [PATCH 4/6] fix: remove version script and old release files --- .github/workflows/git-release.yml | 24 --------------- .github/workflows/release-please.yml | 31 ------------------- graph_request_adapter.go | 45 +++------------------------- release-please-config.json | 5 +++- scripts/incrementMinorVersion.ps1 | 41 ------------------------- 5 files changed, 8 insertions(+), 138 deletions(-) delete mode 100644 .github/workflows/git-release.yml delete mode 100644 .github/workflows/release-please.yml delete mode 100644 scripts/incrementMinorVersion.ps1 diff --git a/.github/workflows/git-release.yml b/.github/workflows/git-release.yml deleted file mode 100644 index bdbdc1ae57..0000000000 --- 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/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index a04074a18f..0000000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,31 +0,0 @@ -# .github/workflows/release-please.yml - -name: Release Please - -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: '^1.20' - - - name: Release Please - uses: google-github-actions/release-please-action@v3 - with: - release-type: 'go' - config-file: release-please-config.json - env: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/graph_request_adapter.go b/graph_request_adapter.go index 02dd950cd3..87a1fedd1c 100644 --- a/graph_request_adapter.go +++ b/graph_request_adapter.go @@ -9,8 +9,11 @@ import ( ) var clientOptions = core.GraphClientOptions{ - GraphServiceVersion: "", //v1 doesn't include the service version in the telemetry header + GraphServiceVersion: "", //v1 doesn't include the service version in the telemetry header + /** The SDK version */ + // x-release-please-start-version GraphServiceLibraryVersion: "1.42.0", + // x-release-please-end } // GetDefaultClientOptions returns the default client options used by the GraphRequestAdapterBase and the middleware. @@ -72,43 +75,3 @@ func NewGraphRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndH return result, nil } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/release-please-config.json b/release-please-config.json index b0802dcb7c..94fad13e17 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -6,7 +6,10 @@ "packages": { ".": { "package-name": "github.com/microsoftgraph/msgraph-sdk-go", - "changelog-path": "CHANGELOG.md" + "changelog-path": "CHANGELOG.md", + "extra-files": [ + "graph_request_adapter.go" + ] } }, "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" diff --git a/scripts/incrementMinorVersion.ps1 b/scripts/incrementMinorVersion.ps1 deleted file mode 100644 index b5dec44eb8..0000000000 --- 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 305484305e81813b1809585242cf4f2ba285b946 Mon Sep 17 00:00:00 2001 From: Ronald K <43806892+rkodev@users.noreply.github.com> Date: Wed, 22 May 2024 11:12:14 +0300 Subject: [PATCH 5/6] 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 01b74c0256..bc108551f0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,4 +1,4 @@ { - ".": "1.42.0" + ".": "1.43.0" } - \ No newline at end of file + From f69ad712db572398ff92db923932eb5ab6c0a9ba Mon Sep 17 00:00:00 2001 From: rkodev <43806892+rkodev@users.noreply.github.com> Date: Fri, 24 May 2024 12:47:38 +0300 Subject: [PATCH 6/6] Update contributing --- CONTRIBUTING.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 292d2ac986..b6aad0010c 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