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] 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