-
-
Notifications
You must be signed in to change notification settings - Fork 851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically push the build to NuGet on a tagged release #2373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes a lot of sense to me. When I publish to multiple package feeds I typically set it up in separate tasks like this. Since you told me this is new for you I am going to explain what it looks like this does to me to ensure you got what you want.
- The step
Feedz Publish
will always publish regardless of tasks when this build runs - The step
NuGet Publish
will only publish if you add a new tag, regardless of the tag name. This would include any Release Client or preview builds that may be numbered1.0.0-rc1
or1.0.0-preview-1
.
I think this PR captures what we discussed on twitter and the description and should do what you are looking to do.
Additional Ideas
Some things that I do with this technique is tag any release including final releases and preview releases. I publish them to feeds slightly differently and need additional steps to build out the logic tree.
.github/workflows/build-and-test.yml
Outdated
dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json | ||
dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/symbols | ||
# TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org | ||
run: dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.FEEDZ_TOKEN}} -s https://f.feedz.io/sixlabors/sixlabors/nuget/index.json -ss https://f.feedz.io/sixlabors/sixlabors/symbols |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this will publish twice now once for the push on main
and one for the tag build. I'm not sure how MinVer
resolves the version on the push on main build, but theres a chance your pipeline could fail because either the CI or the tag build has already published to Feedz and you are trying a second time with the same version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MinVer is great and will actually produce 2 different tags.
- A minor for main
- The tag value for the tag build.
OK. I'm gonna give this a pop. |
Prerequisites
Description
Adds configuration to automatically push the build to NuGet on a tagged release.