From 2906e77f8a196ddfcfdda22ec37fa250356907f1 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 12:45:48 -0500 Subject: [PATCH 1/5] ci: adds release please configuration Signed-off-by: Vincent Biret ci: adds missing manifest Signed-off-by: Vincent Biret ci: fixes version read for releases Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 23 ++++----- .github/release-please.yml | 7 +++ .release-please-manifest.json | 3 ++ CHANGELOG.md | 1 + CONTRIBUTING.md | 50 +++++++++++++++++++ Directory.Build.props | 25 ++++++++++ release-please-config.json | 33 ++++++++++++ .../Microsoft.OpenAPI.OData.Reader.csproj | 14 ------ 8 files changed, 128 insertions(+), 28 deletions(-) create mode 100644 .github/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 Directory.Build.props create mode 100644 release-please-config.json diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index ee410f15..3b590ba8 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -8,6 +8,9 @@ trigger: include: - main - support/v1 + tags: + include: + - 'v*' pr: branches: include: @@ -147,7 +150,7 @@ extends: - task: PowerShell@2 displayName: 'Validate project version has been incremented' - condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) + condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) inputs: targetType: 'filePath' filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1 @@ -188,7 +191,7 @@ extends: PendingAnalysisWaitTimeoutMinutes: '5' - stage: deploy - condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded()) + condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded()) dependsOn: build jobs: - deployment: deploy @@ -232,7 +235,7 @@ extends: steps: - pwsh: | $artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1 - $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", "" + $artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData.", "" -replace ".nupkg", "" #Set Variable $artifactName and $artifactVersion Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion" echo "$artifactVersion" @@ -242,18 +245,10 @@ extends: condition: succeededOrFailed() inputs: gitHubConnection: 'Github-MaggieKimani1' - action: create + action: edit tagSource: userSpecifiedTag tag: 'v$(artifactVersion)' title: 'v$(artifactVersion)' releaseNotesSource: inline - assets: '$(Pipeline.Workspace)\**\*.nupkg' - changeLogType: issueBased - changeLogLabels: '[ - { "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" }, - { "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" }, - { "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" }, - { "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"}, - { "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" } - ]' - + assets: '$(Pipeline.Workspace)\**\*.nupkg' + addChangeLog: false diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 00000000..c821fc16 --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,7 @@ +manifest: true +primaryBranch: main +handleGHRelease: true +branches: + - branch: support/v1 + manifest: true + handleGHRelease: true \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..da56a96b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.0-preview7" +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..825c32f0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..02d4e00a --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,50 @@ +# Contributing to OpenAPI.net.OData + +OpenAPI.net.OData is a mono-repo containing source code for the following packages: + +## Libraries + +| Library | NuGet Release | +|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI/) | + +OpenAPI.net.OData is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library. + +__NOTE__ A signed a contribution license agreement is required for all contributions, and is checked automatically on new pull requests. Please read and sign [the agreement](https://cla.microsoft.com/) before starting any work for this repository. + +## File issues + +The best way to get started with a contribution is to start a dialog with the owners of this repository. Sometimes features will be under development or out of scope for this SDK and it's best to check before starting work on contribution. Discussions on bugs and potential fixes could point you to the write change to make. + +## Submit pull requests for bug fixes and features + +Feel free to submit a pull request with a linked issue against the __main__ branch. The main branch will be updated frequently. +## 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 an exclamation mark after the commit type (`feat!`) or footer with the prefix __BREAKING CHANGE:__ will cause an increment of the _major_ version. \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..189e02d2 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,25 @@ + + + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + Microsoft + Microsoft + MIT + true + https://github.com/Microsoft/OpenAPI.NET + https://github.com/Microsoft/OpenAPI.NET.OData + https://github.com/microsoft/OpenAPI.NET.OData/releases + true + http://go.microsoft.com/fwlink/?LinkID=288890 + https://github.com/Microsoft/OpenAPI.NET.OData + © Microsoft Corporation. All rights reserved. + Microsoft OpenApi OData EDM + 2.0.0-preview7 + + + + true + + + + + \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..b2a06400 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,33 @@ +{ + "bootstrap-sha": "4f9bad6ea7d25e8596c0ca214975e690d925e6e7", + "exclude-paths": [ + ".azure-pipelines", + ".github", + ".idea", + ".vs", + ".vscode" + ], + "release-type": "simple", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-component-in-tag": false, + "include-v-in-tag": true, + "draft": false, + "prerelease": true, + "versioning": "prerelease", + "prerelease-type": "preview", + "packages": { + ".": { + "package-name": "Microsoft.OpenApi.OData", + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "xml", + "path": "Directory.Build.props", + "xpath": "//Project/PropertyGroup/Version" + } + ] + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index 441a9d88..fb4cde3b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -4,25 +4,12 @@ Microsoft.OpenApi.OData.Reader Latest true - icon.png - https://github.com/Microsoft/OpenAPI.NET.OData - MIT - true - Microsoft - Microsoft Microsoft Open API OData Reader Microsoft.OpenApi.OData netstandard2.0 Microsoft.OpenApi.OData true - 1.7.4 This package contains the codes you need to convert OData CSDL to Open API Document of Model. - © Microsoft Corporation. All rights reserved. - Microsoft OpenApi OData EDM - https://github.com/Microsoft/OpenAPI.NET.OData - - - Sync changes from https://github.com/microsoft/OpenAPI.NET.OData/pull/567 to V1 of the library - Microsoft.OpenApi.OData.Reader ..\..\tool\Microsoft.OpenApi.OData.snk ..\..\bin\Debug\ @@ -51,7 +38,6 @@ - True True From 9fbc0607531c2caea0a2702f4fe3e64fa3d2c2bf Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:05:48 -0500 Subject: [PATCH 2/5] ci: updates configuration for support branch Signed-off-by: Vincent Biret --- .release-please-manifest.json | 2 +- Directory.Build.props | 2 +- release-please-config.json | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index da56a96b..0537754e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.0.0-preview7" + ".": "1.7.4" } \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 189e02d2..41b1c0f4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ https://github.com/Microsoft/OpenAPI.NET.OData © Microsoft Corporation. All rights reserved. Microsoft OpenApi OData EDM - 2.0.0-preview7 + 1.7.4 diff --git a/release-please-config.json b/release-please-config.json index b2a06400..96a36472 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1,5 +1,5 @@ { - "bootstrap-sha": "4f9bad6ea7d25e8596c0ca214975e690d925e6e7", + "bootstrap-sha": "f69fea0e056e6de5a76b128e31ab580ec13356fa", "exclude-paths": [ ".azure-pipelines", ".github", @@ -13,9 +13,6 @@ "include-component-in-tag": false, "include-v-in-tag": true, "draft": false, - "prerelease": true, - "versioning": "prerelease", - "prerelease-type": "preview", "packages": { ".": { "package-name": "Microsoft.OpenApi.OData", From 98dd06576dc8131a6bdb134c63c857df13df11a2 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:09:20 -0500 Subject: [PATCH 3/5] ci: removes duplicated package reference Signed-off-by: Vincent Biret --- .../Microsoft.OpenAPI.OData.Reader.csproj | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj index fb4cde3b..193a738b 100644 --- a/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj +++ b/src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj @@ -30,10 +30,6 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - From a1116b0085a7920c34d7d16785e1a3ad1d044ebb Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:16:41 -0500 Subject: [PATCH 4/5] ci: disables treat warnings as errors Signed-off-by: Vincent Biret --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 41b1c0f4..1c0004b1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -8,7 +8,7 @@ https://github.com/Microsoft/OpenAPI.NET https://github.com/Microsoft/OpenAPI.NET.OData https://github.com/microsoft/OpenAPI.NET.OData/releases - true + false http://go.microsoft.com/fwlink/?LinkID=288890 https://github.com/Microsoft/OpenAPI.NET.OData © Microsoft Corporation. All rights reserved. From f07f4caeb5969f47ccb2a901af24bebb36234e3c Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 7 Feb 2025 13:28:49 -0500 Subject: [PATCH 5/5] docs: fixes package link --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 02d4e00a..334509be 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ OpenAPI.net.OData is a mono-repo containing source code for the following packag | Library | NuGet Release | |----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI/) | +| [Microsoft.OpenAPI.OData](./README.md) | [![NuGet Version](https://img.shields.io/nuget/vpre/Microsoft.OpenAPI.OData?label=Latest&logo=nuget)](https://www.nuget.org/packages/Microsoft.OpenAPI.OData/) | OpenAPI.net.OData is open to contributions. There are a couple of different recommended paths to get contributions into the released version of this library.