Skip to content

Commit afe02d6

Browse files
committed
feat: Use dotnet-releaser to automate releases
- 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]>
1 parent 73fd72e commit afe02d6

File tree

9 files changed

+56
-42
lines changed

9 files changed

+56
-42
lines changed

.config/dotnet-tools.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"version": 1,
33
"isRoot": true,
44
"tools": {
5-
"minver-cli": {
6-
"version": "4.1.0",
7-
"commands": [
8-
"minver"
9-
]
10-
},
115
"dotnet-format": {
126
"version": "5.1.250801",
137
"commands": [
148
"dotnet-format"
159
]
10+
},
11+
"dotnet-releaser": {
12+
"version": "0.4.2",
13+
"commands": [
14+
"dotnet-releaser"
15+
]
1616
}
1717
}
18-
}
18+
}

.github/workflows/release-package.yml

+2-13
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,5 @@ jobs:
1717
- name: Restore Tools
1818
run: dotnet tool restore
1919

20-
- name: Install dependencies
21-
run: dotnet restore
22-
23-
- name: Build
24-
run: dotnet build --configuration Release --no-restore -p:Deterministic=true
25-
26-
- name: Pack
27-
run: dotnet pack OpenFeature.SDK.proj --configuration Release --no-build -p:PackageID=OpenFeature
28-
29-
- name: Publish to Nuget
30-
run: |
31-
VERSION=$(dotnet minver -t v -v e)
32-
dotnet nuget push OpenFeature.{VERSION}.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
20+
- name: Build, Tests, Pack and Publish
21+
run: dotnet releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" build/dotnet-releaser.toml

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -347,4 +347,7 @@ ASALocalRun/
347347
!.vscode/settings.json
348348
!.vscode/tasks.json
349349
!.vscode/launch.json
350-
!.vscode/extensions.json
350+
!.vscode/extensions.json
351+
352+
# dotnet releaser artifacts
353+
/build/artifacts-dotnet-releaser

CONTRIBUTING.md

+16
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,22 @@ on each other), the owner should try to get people aligned by:
9393
* If none of the above worked and the PR has been stuck for more than 2 weeks,
9494
the owner should bring it to the OpenFeatures [meeting](README.md#contributing).
9595

96+
## Automated Changelog
97+
98+
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.
99+
100+
- 🚨 Breaking Changes = `breaking-change`
101+
- ✨ New Features = `feature`
102+
- 🐛 Bug Fixes = `bug`
103+
- 🚀 Enhancements = `enhancement`
104+
- 🧰 Maintenance = `maintenance`
105+
- 🏭 Tests = `tests`, `test`
106+
- 🛠 Examples = `examples`
107+
- 📚 Documentation = `documentation`
108+
- 🌎 Accessibility = `translations`
109+
- 📦 Dependencies = `dependencies`
110+
- 🧰 Misc = `misc`
111+
96112
## Design Choices
97113

98114
As with other OpenFeature SDKs, dotnet-sdk follows the

OpenFeature.SDK.sln

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{72005F60
1616
.github\workflows\windows-ci.yml = .github\workflows\windows-ci.yml
1717
README.md = README.md
1818
CONTRIBUTING.md = CONTRIBUTING.md
19+
build\dotnet-releaser.toml = build\dotnet-releaser.toml
1920
EndProjectSection
2021
EndProject
2122
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C97E9975-E10A-4817-AE2C-4DD69C3C02D4}"

build/Common.prod.props

+2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
<PropertyGroup>
2121
<RepositoryType>git</RepositoryType>
2222
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk</RepositoryUrl>
23+
<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>
2324
<PackageTags>Feature;OpenFeature;Flags;</PackageTags>
25+
<PackageId>OpenFeature</PackageId>
2426
<PackageIcon>openfeature-icon.png</PackageIcon>
2527
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
2628
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>

build/RELEASING.md

+2-17
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,7 @@
33
Only for release managers
44

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

8-
```shell
9-
git tag -a 0.1.0 -m "0.1.0"
10-
git push origin 0.1.0
11-
```
129

13-
3. Build and pack the code
14-
15-
```shell
16-
dotnet build --configuration Release --no-restore -p:Deterministic=true
17-
dotnet pack OpenFeature.SDK.proj --configuration Release --no-build
18-
```
19-
20-
4. Push up the package to nuget
21-
22-
```shell
23-
dotnet nuget push OpenFeature.{VERSION}.nupkg --api-key {API_KEY} --source https://api.nuget.org/v3/index.json
24-
```

build/dotnet-releaser.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# configuration file for dotnet-releaser
2+
[msbuild]
3+
project = "../OpenFeature.SDK.sln"
4+
configuration = "Release"
5+
[msbuild.properties]
6+
Deterministic = true
7+
[github]
8+
user = "open-feature"
9+
repo = "dotnet-sdk"
10+
version_prefix = "v"
11+
[test]
12+
enable = false
13+
[coverage]
14+
enable = false
15+
[coveralls]
16+
publish = false
17+
[brew]
18+
publish = false
19+
[service]
20+
publish = false
21+
[changelog]
22+
publish = true

test/OpenFeature.SDK.Tests/OpenFeature.SDK.Tests.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
<PrivateAssets>all</PrivateAssets>
1313
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1414
</PackageReference>
15-
<PackageReference Include="coverlet.msbuild" Version="$(CoverletCollectorVer)">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
</PackageReference>
1915
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVer)" />
2016
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
2117
<PackageReference Include="Moq" Version="$(MoqVer)" />

0 commit comments

Comments
 (0)