Skip to content

Commit

Permalink
Merge pull request #616 from knocte/nugetReleaseBeforeGitHubRelease
Browse files Browse the repository at this point in the history
CI(publish): upload to nuget before creating GitHub release.

Bonus: CI: improve some workflow/jobs/steps names.
  • Loading branch information
knocte authored Dec 7, 2023
2 parents 323223f + 56c726d commit eef61a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: .NET 5.0
on: [push, pull_request]

jobs:
build:
buildAndTest:

strategy:
matrix:
Expand All @@ -24,5 +24,5 @@ jobs:
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Run build
- name: Build and run tests
run: dotnet fake build -t Test
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ jobs:
dotnet-version: ${{ matrix.dotnet }}
- name: Restore tools
run: dotnet tool restore
- name: Run Test
- name: Build
run: dotnet fake build
- name: Run build
- name: Pack
run: dotnet fake build -t Pack
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/[email protected]
with:
version: ${{ github.ref }}
path: ./CHANGELOG.md
- name: Upload binaries to nuget
env:
nuget-key: ${{ secrets.NUGET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet fake build -t Push
- name: Create Release
id: create_release
uses: actions/create-release@latest
Expand All @@ -51,8 +56,3 @@ jobs:
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to nuget
env:
nuget-key: ${{ secrets.NUGET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet fake build -t Push
2 changes: 1 addition & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ After pushing the tag to remote, the publish pipeline will be kicked off which w
* Github secret: `NUGET_KEY`.
* This is the API key from nuget, used to push the package to nuget.
* At the moment the key lives under `knocte`'s nuget account, but maybe the `fsprojects` account should also be able to create an applicable API key.
* "Expires in 12 months" from 2023/11/23 (NOTE: if you forget to update the key after it has expired, and then pushing to nuget fails, don't forget to delete the release in github before retrying the CI workflow.)
* "Expires in 12 months" from 2023/11/23

0 comments on commit eef61a8

Please sign in to comment.