Skip to content

Commit

Permalink
feat: Use dotnet-releaser to automate releases
Browse files Browse the repository at this point in the history
- Update doco to reflect changes
- Configure dotnet-releaser and add to tools
- Update release action to use dotnet-release
- Add description to package, and packageid

Signed-off-by: Benjamin Evenson <[email protected]>
  • Loading branch information
benjiro committed Aug 14, 2022
1 parent 73fd72e commit afe02d6
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 42 deletions.
14 changes: 7 additions & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"version": 1,
"isRoot": true,
"tools": {
"minver-cli": {
"version": "4.1.0",
"commands": [
"minver"
]
},
"dotnet-format": {
"version": "5.1.250801",
"commands": [
"dotnet-format"
]
},
"dotnet-releaser": {
"version": "0.4.2",
"commands": [
"dotnet-releaser"
]
}
}
}
}
15 changes: 2 additions & 13 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,5 @@ jobs:
- name: Restore Tools
run: dotnet tool restore

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore -p:Deterministic=true

- name: Pack
run: dotnet pack OpenFeature.SDK.proj --configuration Release --no-build -p:PackageID=OpenFeature

- name: Publish to Nuget
run: |
VERSION=$(dotnet minver -t v -v e)
dotnet nuget push OpenFeature.{VERSION}.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
- name: Build, Tests, Pack and Publish
run: dotnet releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" build/dotnet-releaser.toml
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,7 @@ ASALocalRun/
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/extensions.json

# dotnet releaser artifacts
/build/artifacts-dotnet-releaser
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ on each other), the owner should try to get people aligned by:
* If none of the above worked and the PR has been stuck for more than 2 weeks,
the owner should bring it to the OpenFeatures [meeting](README.md#contributing).

## Automated Changelog

Each time a release is published the changelogs will be generated automatically using [dotnet-releaser](https://github.com/xoofx/dotnet-releaser/blob/main/doc/changelog_user_guide.md#13-categories). The tool will organise the changes based on the PR labels.

- 🚨 Breaking Changes = `breaking-change`
- ✨ New Features = `feature`
- 🐛 Bug Fixes = `bug`
- 🚀 Enhancements = `enhancement`
- 🧰 Maintenance = `maintenance`
- 🏭 Tests = `tests`, `test`
- 🛠 Examples = `examples`
- 📚 Documentation = `documentation`
- 🌎 Accessibility = `translations`
- 📦 Dependencies = `dependencies`
- 🧰 Misc = `misc`

## Design Choices

As with other OpenFeature SDKs, dotnet-sdk follows the
Expand Down
1 change: 1 addition & 0 deletions OpenFeature.SDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60
.github\workflows\windows-ci.yml = .github\workflows\windows-ci.yml
README.md = README.md
CONTRIBUTING.md = CONTRIBUTING.md
build\dotnet-releaser.toml = build\dotnet-releaser.toml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C97E9975-E10A-4817-AE2C-4DD69C3C02D4}"
Expand Down
2 changes: 2 additions & 0 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<PropertyGroup>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk</RepositoryUrl>
<Description>OpenFeature is an open standard for feature flag management, created to support a robust feature flag ecosystem using cloud native technologies. OpenFeature will provide a unified API and SDK, and a developer-first, cloud-native implementation, with extensibility for open source and commercial offerings.</Description>
<PackageTags>Feature;OpenFeature;Flags;</PackageTags>
<PackageId>OpenFeature</PackageId>
<PackageIcon>openfeature-icon.png</PackageIcon>
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
Expand Down
19 changes: 2 additions & 17 deletions build/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,7 @@
Only for release managers

1. Decide on the version name to be released. e.g. 0.1.0, 0.1.1 etc
2. Tag the commit with the version number
2. Create tag via github ui
3. Release package action will fire on tag creation that will build, pack and publish and create the github release

```shell
git tag -a 0.1.0 -m "0.1.0"
git push origin 0.1.0
```

3. Build and pack the code

```shell
dotnet build --configuration Release --no-restore -p:Deterministic=true
dotnet pack OpenFeature.SDK.proj --configuration Release --no-build
```

4. Push up the package to nuget

```shell
dotnet nuget push OpenFeature.{VERSION}.nupkg --api-key {API_KEY} --source https://api.nuget.org/v3/index.json
```
22 changes: 22 additions & 0 deletions build/dotnet-releaser.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# configuration file for dotnet-releaser
[msbuild]
project = "../OpenFeature.SDK.sln"
configuration = "Release"
[msbuild.properties]
Deterministic = true
[github]
user = "open-feature"
repo = "dotnet-sdk"
version_prefix = "v"
[test]
enable = false
[coverage]
enable = false
[coveralls]
publish = false
[brew]
publish = false
[service]
publish = false
[changelog]
publish = true
4 changes: 0 additions & 4 deletions test/OpenFeature.SDK.Tests/OpenFeature.SDK.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.msbuild" Version="$(CoverletCollectorVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVer)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
<PackageReference Include="Moq" Version="$(MoqVer)" />
Expand Down

0 comments on commit afe02d6

Please sign in to comment.