Skip to content

Commit 96216d4

Browse files
committed
chore: Add support for GitHub Packages
| GITHUB_REF | version format | |---------------|--------------------------------------------------| | refs/heads/* | #.#.#-ci.{%Y%m%d}T{%H%M%S}+sha.${GITHUB_SHA:0:9} | | refs/pull/* | #.#.#-pr.{%Y%m%d}T{%H%M%S}+sha.${GITHUB_SHA:0:9} | | refs/tags/v* | #.#.# | See: open-feature/dotnet-sdk#54, open-feature/dotnet-sdk#173 Signed-off-by: Austin Drenski <[email protected]>
1 parent 20aeb3a commit 96216d4

File tree

13 files changed

+108
-101
lines changed

13 files changed

+108
-101
lines changed

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
branches: [ main ]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
os: [ ubuntu-latest, windows-latest ]
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
submodules: recursive
27+
28+
- name: Setup .NET SDK
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: |
32+
6.0.x
33+
7.0.x
34+
35+
- name: Restore
36+
run: dotnet restore
37+
38+
- name: Build
39+
run: dotnet build --no-restore
40+
41+
- name: Test
42+
run: dotnet test --no-build --logger GitHubActions
43+
44+
packaging:
45+
needs: build
46+
47+
permissions:
48+
contents: read
49+
packages: write
50+
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0
58+
submodules: recursive
59+
60+
- name: Setup .NET SDK
61+
uses: actions/setup-dotnet@v4
62+
with:
63+
dotnet-version: |
64+
6.0.x
65+
7.0.x
66+
67+
- name: Restore
68+
run: dotnet restore
69+
70+
- name: Pack NuGet packages (CI versions)
71+
if: startsWith(github.ref, 'refs/heads/')
72+
run: dotnet pack --no-restore --version-suffix "ci.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}"
73+
74+
- name: Pack NuGet packages (PR versions)
75+
if: startsWith(github.ref, 'refs/pull/')
76+
run: dotnet pack --no-restore --version-suffix "pr.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}"
77+
78+
- name: Publish NuGet packages (base)
79+
if: github.event.pull_request.head.repo.fork == false
80+
run: dotnet nuget push "src/**/*.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/open-feature/index.json
81+
82+
- name: Publish NuGet packages (fork)
83+
if: github.event.pull_request.head.repo.fork == true
84+
uses: actions/[email protected]
85+
with:
86+
name: nupkgs
87+
path: src/**/*.nupkg

.github/workflows/linux-ci.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/windows-ci.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ Sample `.csproj` file:
2828
<PropertyGroup>
2929
<PackageId>OpenFeature.Contrib.MyComponent</PackageId>
3030
<VersionNumber>0.0.1</VersionNumber> <!--x-release-please-version -->
31-
<Version>$(VersionNumber)</Version>
31+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
3232
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
3333
<FileVersion>$(VersionNumber)</FileVersion>
3434
<Description>A very valuable OpenFeature contribution!</Description>
35-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
36-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
3735
<Authors>Me!</Authors>
3836
</PropertyGroup>
3937

build/Common.prod.props

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
<Import Project=".\Common.props" />
33

44
<PropertyGroup>
5+
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
6+
<Deterministic Condition="'$(CI)' == 'true'">true</Deterministic>
57
<GenerateDocumentationFile>true</GenerateDocumentationFile>
8+
<PackRelease>true</PackRelease>
69
</PropertyGroup>
710

811
<PropertyGroup>
912
<TargetFrameworks>netstandard2.0;net462;net5.0;net6.0;net7.0</TargetFrameworks>
1013
<RepositoryType>git</RepositoryType>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk</RepositoryUrl>
14+
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1215
<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>
1316
<PackageTags>Feature;OpenFeature;Flags;</PackageTags>
1417
<PackageIcon>openfeature-icon.png</PackageIcon>
@@ -28,12 +31,4 @@
2831
<IncludeSymbols>true</IncludeSymbols>
2932
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
3033
</PropertyGroup>
31-
32-
<ItemGroup Condition="'$(Deterministic)'=='true'">
33-
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
34-
</ItemGroup>
35-
36-
<PropertyGroup Condition="'$(Deterministic)'=='true'">
37-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
38-
</PropertyGroup>
3934
</Project>

build/Common.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,8 @@
2727
<!-- 0.5+ -->
2828
<OpenFeatureVer>[1.2,)</OpenFeatureVer>
2929
</PropertyGroup>
30-
</Project>
30+
31+
<ItemGroup Condition="'$(OS)' == 'Unix'">
32+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
33+
</ItemGroup>
34+
</Project>

build/Common.tests.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2929
</PackageReference>
3030
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVer)" />
31+
<PackageReference Include="GitHubActionsTestLogger" Version="$(GitHubActionsTestLoggerVer)" />
3132
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
3233
<PackageReference Include="NSubstitute" Version="$(NSubstituteVer)" />
3334
<PackageReference Include="xunit" Version="$(XUnitPkgVer)" />
@@ -45,6 +46,7 @@
4546
<AutoFixtureVer>[4.17.0]</AutoFixtureVer>
4647
<CoverletCollectorVer>[3.1.2]</CoverletCollectorVer>
4748
<FluentAssertionsVer>[6.7.0]</FluentAssertionsVer>
49+
<GitHubActionsTestLoggerVer>[2.3.3]</GitHubActionsTestLoggerVer>
4850
<MicrosoftNETTestSdkPkgVer>[17.3.2]</MicrosoftNETTestSdkPkgVer>
4951
<NSubstituteVer>[5.0.0]</NSubstituteVer>
5052
<XUnitRunnerVisualStudioPkgVer>[2.4.3,3.0)</XUnitRunnerVisualStudioPkgVer>

src/OpenFeature.Contrib.Hooks.Otel/OpenFeature.Contrib.Hooks.Otel.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
<PropertyGroup>
44
<PackageId>OpenFeature.Contrib.Hooks.Otel</PackageId>
55
<VersionNumber>0.1.3</VersionNumber> <!--x-release-please-version -->
6-
<Version>$(VersionNumber)</Version>
6+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
77
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
88
<FileVersion>$(VersionNumber)</FileVersion>
99
<Description>Open Telemetry Hook for .NET</Description>
10-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1210
<Authors>Florian Bacher</Authors>
1311
</PropertyGroup>
1412

src/OpenFeature.Contrib.Providers.ConfigCat/OpenFeature.Contrib.Providers.ConfigCat.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
<PropertyGroup>
44
<PackageId>OpenFeature.Contrib.Providers.ConfigCat</PackageId>
55
<VersionNumber>0.0.1</VersionNumber> <!--x-release-please-version -->
6-
<Version>$(VersionNumber)</Version>
6+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
77
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
88
<FileVersion>$(VersionNumber)</FileVersion>
99
<Description>ConfigCat provider for .NET</Description>
10-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1210
<Authors>Luiz Bon</Authors>
1311
</PropertyGroup>
1412
<ItemGroup>
@@ -20,4 +18,4 @@
2018
<ItemGroup>
2119
<PackageReference Include="ConfigCat.Client" Version="[9,)"/>
2220
</ItemGroup>
23-
</Project>
21+
</Project>

src/OpenFeature.Contrib.Providers.FeatureManagement/OpenFeature.Contrib.Providers.FeatureManagement.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
<PropertyGroup>
44
<PackageId>OpenFeature.Contrib.Provider.FeatureManagement</PackageId>
55
<VersionNumber>0.0.1</VersionNumber>
6-
<Version>$(VersionNumber)-preview</Version>
6+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
7+
<VersionSuffix>preview</VersionSuffix>
78
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
89
<FileVersion>$(VersionNumber)</FileVersion>
910
<Description>An OpenFeature Provider built on top of the standard Microsoft FeatureManagement Library</Description>
10-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1211
<Authors>Eric Pattison</Authors>
1312
</PropertyGroup>
1413

1514
<ItemGroup>
1615
<PackageReference Include="Microsoft.FeatureManagement" Version="4.0.0-preview" />
1716
</ItemGroup>
1817

19-
</Project>
18+
</Project>

src/OpenFeature.Contrib.Providers.Flagd/OpenFeature.Contrib.Providers.Flagd.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
<PropertyGroup>
44
<PackageId>OpenFeature.Contrib.Providers.Flagd</PackageId>
55
<VersionNumber>0.1.7</VersionNumber> <!--x-release-please-version -->
6-
<Version>$(VersionNumber)</Version>
6+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
77
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
88
<FileVersion>$(VersionNumber)</FileVersion>
99
<Description>flagd provider for .NET</Description>
10-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1210
<Authors>Todd Baert</Authors>
1311
</PropertyGroup>
1412

src/OpenFeature.Contrib.Providers.Flagsmith/OpenFeature.Contrib.Providers.Flagsmith.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
<TargetFrameworks>netstandard20</TargetFrameworks>
55
<PackageId>OpenFeature.Contrib.Providers.Flagsmith</PackageId>
66
<VersionNumber>0.1.5</VersionNumber> <!--x-release-please-version -->
7-
<Version>$(VersionNumber)</Version>
7+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
88
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
99
<FileVersion>$(VersionNumber)</FileVersion>
1010
<Description>Flagsmith provider for .NET</Description>
11-
<PackageProjectUrl>https://openfeature.dev</PackageProjectUrl>
12-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1311
<Authors>Vladimir Petrusevici</Authors>
1412
</PropertyGroup>
1513

src/OpenFeature.Contrib.Providers.GOFeatureFlag/OpenFeature.Contrib.Providers.GOFeatureFlag.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
<PropertyGroup>
44
<PackageId>OpenFeature.Contrib.GOFeatureFlag</PackageId>
55
<VersionNumber>0.1.5</VersionNumber> <!--x-release-please-version -->
6-
<Version>$(VersionNumber)</Version>
6+
<VersionPrefix>$(VersionNumber)</VersionPrefix>
77
<AssemblyVersion>$(VersionNumber)</AssemblyVersion>
88
<FileVersion>$(VersionNumber)</FileVersion>
99
<Description>GO Feature Flag provider for .NET</Description>
10-
<PackageProjectUrl>https://gofeatureflag.org</PackageProjectUrl>
11-
<RepositoryUrl>https://github.com/open-feature/dotnet-sdk-contrib</RepositoryUrl>
1210
<Authors>Thomas Poignant</Authors>
1311
</PropertyGroup>
1412

0 commit comments

Comments
 (0)