Skip to content

Commit e10f412

Browse files
Use GitHub Environments for Nuget Publish (#285)
* Fix nuget publish * Update library's README
1 parent 755f63a commit e10f412

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Content/Library/.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
# Sets permissions of the GITHUB_TOKEN to allow release creating
1212
permissions:
1313
contents: write
14+
environment:
15+
name: nuget
1416
runs-on: ubuntu-latest
1517
steps:
1618
- uses: actions/checkout@v3

Content/Library/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ git remote add origin https://github.com/MyGithubUsername/MyLib.1.git
103103
git push -u origin MyReleaseBranch
104104
```
105105

106-
- [Create your NuGeT API key](https://docs.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-api-keys)
107-
- Add your NuGet API key as repository secret NUGET_TOKEN to [Actions secrets](https://github.com/MyGithubUsername/MyLib.1/settings/secrets/actions)
108-
106+
- [Create an Environment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#creating-an-environment) on your repository named `nuget`.
107+
- [Create a NuGet API key](https://learn.microsoft.com/en-us/nuget/nuget-org/publish-a-package#create-an-api-key)
108+
- Add your `NUGET_TOKEN` to the [Environment Secrets](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets) of your newly created environment.
109109
- Then update the `CHANGELOG.md` with an "Unreleased" section containing release notes for this version, in [KeepAChangelog](https://keepachangelog.com/en/1.1.0/) format.
110110

111111
NOTE: Its highly recommend to add a link to the Pull Request next to the release note that it affects. The reason for this is when the `RELEASE` target is run, it will add these new notes into the body of git commit. GitHub will notice the links and will update the Pull Request with what commit referenced it saying ["added a commit that referenced this pull request"](https://github.com/TheAngryByrd/MiniScaffold/pull/179#ref-commit-837ad59). Since the build script automates the commit message, it will say "Bump Version to x.y.z". The benefit of this is when users goto a Pull Request, it will be clear when and which version those code changes released. Also when reading the `CHANGELOG`, if someone is curious about how or why those changes were made, they can easily discover the work and discussions.

0 commit comments

Comments
 (0)