Skip to content

Commit

Permalink
Rotate the NuGet tokens, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Feb 3, 2024
1 parent 6f083e0 commit ed95a06
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ jobs:

- name: Push Avalonia-Math package to NuGet
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./src/AvaloniaMath/bin/Release/AvaloniaMath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_AVALONIA }}
run: dotnet nuget push ./src/AvaloniaMath/bin/Release/AvaloniaMath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}

- name: Push WPF-Math package to NuGet
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./src/WpfMath/bin/Release/WpfMath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_WPF }}
run: dotnet nuget push ./src/WpfMath/bin/Release/WpfMath.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}

- name: Push XAML-Math package to NuGet
if: startsWith(github.ref, 'refs/tags/v')
run: dotnet nuget push ./src/XamlMath.Shared/bin/Release/XamlMath.Shared.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN_XAML }}
run: dotnet nuget push ./src/XamlMath.Shared/bin/Release/XamlMath.Shared.${{ steps.version.outputs.version }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}
26 changes: 18 additions & 8 deletions MAINTAINERSHIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,48 @@ XAML-Math Maintainership

Publish a New Version
---------------------

1. Update the copyright year in [the license file][license], if required.
2. Prepare a corresponding entry in [the changelog][changelog] (usually by renaming the "Unreleased" section).
1. Update the copyright year in the `LICENSE.md` file, if required.
2. Prepare a corresponding entry in the `CHANGELOG.md` file (usually by renaming the "Unreleased" section).
3. Set `<Version>` in the `Directory.Build.props` file.
4. Update the copyright year in `Directory.Build.props`, if required.
5. Merge the aforementioned changes via a pull request.
6. Push a tag in form of `v<VERSION>`, e.g. `v0.0.1`. GitHub Actions will do the rest (push a NuGet package).

Prepare NuGet Package Locally
-----------------------------

```console
$ dotnet pack XamlMath.All.sln --configuration Release
```

Push a NuGet Package Manually
-----------------------------

```console
$ dotnet nuget push ./src/WpfMath/bin/Release/WpfMath.<VERSION>.nupkg --source https://api.nuget.org/v3/index.json --api-key <YOUR_API_KEY>
$ dotnet nuget push ./src/AvaloniaMath/bin/Release/AvaloniaMath.<VERSION>.nupkg --source https://api.nuget.org/v3/index.json --api-key <YOUR_API_KEY>
```

Rotate Keys
-----------
CI relies on NuGet API key being added to the secrets. From time to time, this key requires maintenance: it will become obsolete and will have to be updated.

To update the keys:

1. Sign in onto nuget.org.
2. Go to the [API keys][nuget.api-keys] section.
3. Update the existing or create a new key with the following parameters: name `xaml-math.github` with a permission to **Push only new package versions** and only allowed to publish the following packages:
- **AvaloniaMath**,
- **WpfMath**,
- **XamlMath.Shared**.
4. Paste the generated key to the `NUGET_TOKEN` variable on the [action secrets][github.secrets] section of GitHub settings.

Runtime Support Policy
----------------------

Generally, XAML-Math supports the .NET runtime (.NET Framework or modern .NET) versions that are supported by Microsoft (both basic and extended support are considered), provided that the support cost for the very old versions is reasonable. We will stop support for the currently supported runtime version either after it gets unsupported, or when we consider support cost unreasonable.

Removing .NET runtime version from the list of compatible versions is a breaking change (as far as semantic versioning is concerned).

For reference, see [the .NET support dates list][dotnet-support-dates].

[changelog]: ./CHANGELOG.md
[dotnet-support-dates]: https://fornever.me/en/posts/2021-04-10.net-support-dates.html
[license]: ./LICENSE.md
[github.secrets]: https://github.com/ForNeVeR/xaml-math/settings/secrets/actions
[nuget.api-keys]: https://www.nuget.org/account/apikeys

0 comments on commit ed95a06

Please sign in to comment.