Skip to content

Commit e4fc7d9

Browse files
authored
Merge pull request #649 from microsoft/ci/release-please
ci: adds release please configuration
2 parents b9a2b06 + 25455b4 commit e4fc7d9

File tree

8 files changed

+128
-44
lines changed

8 files changed

+128
-44
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ trigger:
88
include:
99
- main
1010
- support/v1
11+
tags:
12+
include:
13+
- 'v*'
1114
pr:
1215
branches:
1316
include:
@@ -147,7 +150,7 @@ extends:
147150

148151
- task: PowerShell@2
149152
displayName: 'Validate project version has been incremented'
150-
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
153+
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
151154
inputs:
152155
targetType: 'filePath'
153156
filePath: $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1
@@ -188,7 +191,7 @@ extends:
188191
PendingAnalysisWaitTimeoutMinutes: '5'
189192

190193
- stage: deploy
191-
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'), contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
194+
condition: and(contains(variables['build.sourceBranch'], 'refs/tags/v'), succeeded())
192195
dependsOn: build
193196
jobs:
194197
- deployment: deploy
@@ -232,7 +235,7 @@ extends:
232235
steps:
233236
- pwsh: |
234237
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace) -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
235-
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData", "" -replace ".nupkg", ""
238+
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.OData.", "" -replace ".nupkg", ""
236239
#Set Variable $artifactName and $artifactVersion
237240
Write-Host "##vso[task.setvariable variable=artifactVersion; isSecret=false;]$artifactVersion"
238241
echo "$artifactVersion"
@@ -242,18 +245,10 @@ extends:
242245
condition: succeededOrFailed()
243246
inputs:
244247
gitHubConnection: 'Github-MaggieKimani1'
245-
action: create
248+
action: edit
246249
tagSource: userSpecifiedTag
247250
tag: 'v$(artifactVersion)'
248251
title: 'v$(artifactVersion)'
249252
releaseNotesSource: inline
250-
assets: '$(Pipeline.Workspace)\**\*.nupkg'
251-
changeLogType: issueBased
252-
changeLogLabels: '[
253-
{ "label" : "feature-work", "feature", "displayName" : "New Features", "state" : "closed" },
254-
{ "label" : "enhancement", "V2-Enhancement", "displayName" : "Enhancements", "state" : "closed" },
255-
{ "label" : "bug", "bug-fix", "displayName" : "Bugs", "state" : "closed" },
256-
{ "label" : "documentation", "doc", "displayName" : "Documentation", "state" : "closed"},
257-
{ "label" : "dependencies", "displayName" : "Package Updates", "state" : "closed" }
258-
]'
259-
253+
assets: '$(Pipeline.Workspace)\**\*.nupkg'
254+
addChangeLog: false

.github/release-please.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
manifest: true
2+
primaryBranch: main
3+
handleGHRelease: true
4+
branches:
5+
- branch: support/v1
6+
manifest: true
7+
handleGHRelease: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "2.0.0-preview7"
3+
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing to OpenAPI.net.OData
2+
3+
OpenAPI.net.OData is a mono-repo containing source code for the following packages:
4+
5+
## Libraries
6+
7+
| Library | NuGet Release |
8+
|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9+
| [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/) |
10+
11+
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.
12+
13+
__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.
14+
15+
## File issues
16+
17+
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.
18+
19+
## Submit pull requests for bug fixes and features
20+
21+
Feel free to submit a pull request with a linked issue against the __main__ branch. The main branch will be updated frequently.
22+
## Commit message format
23+
24+
To support our automated release process, pull requests are required to follow the [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/)
25+
format.
26+
Each commit message consists of a __header__, an optional __body__ and an optional __footer__. The header is the first line of the commit and
27+
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.
28+
29+
```
30+
<type>[optional scope]: <short description>
31+
<BLANK LINE>
32+
<optional body>
33+
<BLANK LINE>
34+
<optional footer(s)>
35+
```
36+
37+
The recommended commit types used are:
38+
39+
- __feat__ for feature updates (increments the _minor_ version)
40+
- __fix__ for bug fixes (increments the _patch_ version)
41+
- __perf__ for performance related changes e.g. optimizing an algorithm
42+
- __refactor__ for code refactoring changes
43+
- __test__ for test suite updates e.g. adding a test or fixing a test
44+
- __style__ for changes that don't affect the meaning of code. e.g. formatting changes
45+
- __docs__ for documentation updates e.g. ReadMe update or code documentation updates
46+
- __build__ for build system changes (gradle updates, external dependency updates)
47+
- __ci__ for CI configuration file changes e.g. updating a pipeline
48+
- __chore__ for miscallaneous non-sdk changesin the repo e.g. removing an unused file
49+
50+
Adding an exclamation mark after the commit type (`feat!`) or footer with the prefix __BREAKING CHANGE:__ will cause an increment of the _major_ version.

Directory.Build.props

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
4+
<Authors>Microsoft</Authors>
5+
<Company>Microsoft</Company>
6+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
7+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
8+
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET</RepositoryUrl>
9+
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET.OData</PackageProjectUrl>
10+
<PackageReleaseNotes>https://github.com/microsoft/OpenAPI.NET.OData/releases</PackageReleaseNotes>
11+
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
12+
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288890</PackageIconUrl>
13+
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET.OData</PackageProjectUrl>
14+
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
15+
<PackageTags>Microsoft OpenApi OData EDM</PackageTags>
16+
<Version>2.0.0-preview7</Version>
17+
</PropertyGroup>
18+
<!-- https://github.com/clairernovotny/DeterministicBuilds#deterministic-builds -->
19+
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
20+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
21+
</PropertyGroup>
22+
<ItemGroup>
23+
<PackageReference Condition="!$(MSBuildProjectName.EndsWith('Tests'))" Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
24+
</ItemGroup>
25+
</Project>

release-please-config.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"bootstrap-sha": "4f9bad6ea7d25e8596c0ca214975e690d925e6e7",
3+
"exclude-paths": [
4+
".azure-pipelines",
5+
".github",
6+
".idea",
7+
".vs",
8+
".vscode"
9+
],
10+
"release-type": "simple",
11+
"bump-minor-pre-major": true,
12+
"bump-patch-for-minor-pre-major": true,
13+
"include-component-in-tag": false,
14+
"include-v-in-tag": true,
15+
"draft": false,
16+
"prerelease": true,
17+
"versioning": "prerelease",
18+
"prerelease-type": "preview",
19+
"packages": {
20+
".": {
21+
"package-name": "Microsoft.OpenApi.OData",
22+
"changelog-path": "CHANGELOG.md",
23+
"extra-files": [
24+
{
25+
"type": "xml",
26+
"path": "Directory.Build.props",
27+
"xpath": "//Project/PropertyGroup/Version"
28+
}
29+
]
30+
}
31+
},
32+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
33+
}

src/Microsoft.OpenApi.OData.Reader/Microsoft.OpenAPI.OData.Reader.csproj

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,12 @@
44
<AssemblyName>Microsoft.OpenApi.OData.Reader</AssemblyName>
55
<LangVersion>Latest</LangVersion>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
7-
<PackageIcon>icon.png</PackageIcon>
8-
<PackageProjectUrl>https://github.com/Microsoft/OpenAPI.NET.OData</PackageProjectUrl>
9-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
10-
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
11-
<Authors>Microsoft</Authors>
12-
<Company>Microsoft</Company>
137
<Title>Microsoft Open API OData Reader</Title>
148
<RootNamespace>Microsoft.OpenApi.OData</RootNamespace>
159
<TargetFrameworks>net8.0</TargetFrameworks>
1610
<PackageId>Microsoft.OpenApi.OData</PackageId>
1711
<SignAssembly>true</SignAssembly>
18-
<Version>2.0.0-preview.7</Version>
1912
<Description>This package contains the codes you need to convert OData CSDL to Open API Document of Model.</Description>
20-
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
21-
<PackageTags>Microsoft OpenApi OData EDM</PackageTags>
22-
<RepositoryUrl>https://github.com/Microsoft/OpenAPI.NET.OData</RepositoryUrl>
23-
<PackageReleaseNotes>
24-
- Upgraded to Microsoft.Odata.Edm 8.0.0
25-
- Cleaned up obsolete APIs
26-
- Changed target framework to net8.0
27-
- Adds support for retrieving collection of enum values from UpdateMethod property of UpdateRestrictions annotation #564
28-
- Adds nullable to double schema conversions #581
29-
- Updates tag names for actions/functions operations #585
30-
- Creates unique operation ids for paths with composable overloaded functions #580
31-
- Further fixes for double/decimal/float schema conversions #581
32-
- Replaced integer types by number types
33-
- Further fix for generating unique operation ids for paths with composable overloaded functions where all functions in path are overloaded #594
34-
- Further fix for generating unique operation ids for navigation property paths with composable overloaded functions #596
35-
- Updates PUT operation id prefix from Update to Set #600
36-
- Adds action/function suffix to tag names for actions/functions operations #641
37-
</PackageReleaseNotes>
3813
<AssemblyName>Microsoft.OpenApi.OData.Reader</AssemblyName>
3914
<AssemblyOriginatorKeyFile>..\..\tool\Microsoft.OpenApi.OData.snk</AssemblyOriginatorKeyFile>
4015
<OutputPath Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">..\..\bin\Debug\</OutputPath>
@@ -55,10 +30,6 @@
5530
</PackageReference>
5631
<PackageReference Include="Microsoft.OData.Edm" Version="8.2.3" />
5732
<PackageReference Include="Microsoft.OpenApi" Version="1.6.23" />
58-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
59-
<PrivateAssets>all</PrivateAssets>
60-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
61-
</PackageReference>
6233
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
6334
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19">
6435
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -67,7 +38,6 @@
6738
</ItemGroup>
6839

6940
<ItemGroup>
70-
<None Include="icon.png" Pack="true" PackagePath="\" />
7141
<Compile Update="Properties\SRResource.Designer.cs">
7242
<DesignTime>True</DesignTime>
7343
<AutoGen>True</AutoGen>

0 commit comments

Comments
 (0)