|
2 | 2 |
|
3 | 3 | ## System Requirements
|
4 | 4 |
|
5 |
| -Dotnet 6+ is recommended. |
6 |
| - |
7 |
| -## Compilation target(s) |
8 |
| - |
9 |
| -As in the Dotnet-SDK, we target C# LangVersion 7.3. The `Common.props` configures this automatically. |
| 5 | +Dotnet 8+ is recommended. |
10 | 6 |
|
11 | 7 | ## Adding a project
|
12 | 8 |
|
13 |
| -1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent --langVersion 7.3` |
| 9 | +1. Create a new library project under `src/`: `dotnet new classlib -o src/OpenFeature.Contrib.MyComponent` |
14 | 10 | 2. Create a new test project under `test/`: `dotnet new xunit -o test/OpenFeature.Contrib.MyComponent.Test`
|
15 | 11 | 3. Add the library project to the solution: `dotnet sln DotnetSdkContrib.sln add src/OpenFeature.Contrib.MyComponent/OpenFeature.Contrib.MyComponent.csproj`
|
16 | 12 | 4. Add the test project to the solution: `dotnet sln DotnetSdkContrib.sln add test/OpenFeature.Contrib.MyComponent.Test/OpenFeature.Contrib.MyComponent.Test.csproj`
|
17 | 13 | 5. Add the desired properties to your library's `.csproj` file (see example below).
|
18 |
| -5. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited). |
19 |
| -6. Add the new library project to `release-please-config.json`. |
20 |
| -7. Add a `version.txt` file to the root of your library with a version matching that in your new `.csproj` file, e.g. `0.0.1`. |
21 |
| -8. If you care to release a pre `1.0.0` version, add the same version above to `.release-please-manifest.json`. Failing to do this will release a `1.0.0` initial release. |
| 14 | +6. Remove all content besides the root element from your test project's `.csproj` file (all settings will be inherited). |
| 15 | +7. Add the new library project to `release-please-config.json`. |
| 16 | +8. Add a `version.txt` file to the root of your library with a version matching that in your new `.csproj` file, e.g. `0.0.1`. |
| 17 | +9. If you care to release a pre `1.0.0` version, add the same version above to `.release-please-manifest.json`. Failing to do this will release a `1.0.0` initial release. |
22 | 18 |
|
23 | 19 | Sample `.csproj` file:
|
24 | 20 |
|
@@ -62,34 +58,37 @@ Dependencies used only for building and testing should have a `<PrivateAssets>al
|
62 | 58 | ## Consuming pre-release packages
|
63 | 59 |
|
64 | 60 | 1. Acquire a [GitHub personal access token (PAT)](https://docs.github.com/github/authenticating-to-github/creating-a-personal-access-token) scoped for `read:packages` and verify the permissions:
|
65 |
| - ```console |
66 |
| - $ gh auth login --scopes read:packages |
67 |
| - |
68 |
| - ? What account do you want to log into? GitHub.com |
69 |
| - ? What is your preferred protocol for Git operations? HTTPS |
70 |
| - ? How would you like to authenticate GitHub CLI? Login with a web browser |
71 |
| - |
72 |
| - ! First copy your one-time code: ****-**** |
73 |
| - Press Enter to open github.com in your browser... |
74 |
| - |
75 |
| - ✓ Authentication complete. |
76 |
| - - gh config set -h github.com git_protocol https |
77 |
| - ✓ Configured git protocol |
78 |
| - ✓ Logged in as ******** |
79 |
| - ``` |
80 |
| - |
81 |
| - ```console |
82 |
| - $ gh auth status |
83 |
| - |
84 |
| - github.com |
85 |
| - ✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml) |
86 |
| - ✓ Git operations for github.com configured to use https protocol. |
87 |
| - ✓ Token: gho_************************************ |
88 |
| - ✓ Token scopes: gist, read:org, read:packages, repo, workflow |
89 |
| - ``` |
| 61 | + |
| 62 | + ```console |
| 63 | + $ gh auth login --scopes read:packages |
| 64 | + |
| 65 | + ? What account do you want to log into? GitHub.com |
| 66 | + ? What is your preferred protocol for Git operations? HTTPS |
| 67 | + ? How would you like to authenticate GitHub CLI? Login with a web browser |
| 68 | + |
| 69 | + ! First copy your one-time code: ****-**** |
| 70 | + Press Enter to open github.com in your browser... |
| 71 | + |
| 72 | + ✓ Authentication complete. |
| 73 | + - gh config set -h github.com git_protocol https |
| 74 | + ✓ Configured git protocol |
| 75 | + ✓ Logged in as ******** |
| 76 | + ``` |
| 77 | + |
| 78 | + ```console |
| 79 | + $ gh auth status |
| 80 | + |
| 81 | + github.com |
| 82 | + ✓ Logged in to github.com as ******** (~/.config/gh/hosts.yml) |
| 83 | + ✓ Git operations for github.com configured to use https protocol. |
| 84 | + ✓ Token: gho_************************************ |
| 85 | + ✓ Token scopes: gist, read:org, read:packages, repo, workflow |
| 86 | + ``` |
| 87 | + |
90 | 88 | 2. Run the following command to configure your local environment to consume packages from GitHub Packages:
|
91 |
| - ```console |
92 |
| - $ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text |
93 | 89 |
|
94 |
| - Package source "github-open-feature" was successfully updated. |
95 |
| - ``` |
| 90 | + ```console |
| 91 | + $ dotnet nuget update source github-open-feature --username $(gh api user --jq .email) --password $(gh auth token) --store-password-in-clear-text |
| 92 | + |
| 93 | + Package source "github-open-feature" was successfully updated. |
| 94 | + ``` |
0 commit comments