Add action step to push package to Octopus feed#3
Add action step to push package to Octopus feed#3eddymoulton wants to merge 3 commits intooctopus/masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a release/publishing step to the CI pipeline so the built NuGet package can be pushed to an Octopus feed, and documents how to trigger releases in this fork.
Changes:
- Documented the tag-based release process for the Octopus fork in
README.md. - Updated CI packaging job to push the generated
.nupkgto a configured NuGet feed. - Refreshed the MinVer example tag/version shown in the README.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| README.md | Updates MinVer sample output and adds “Releasing this Octopus fork” tag-based release instructions. |
| .github/workflows/ci.yml | Adds a dotnet nuget push step after packaging to publish the produced NuGet package to a feed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Push package to feed 🐙 | ||
| id: push-feed | ||
| shell: bash | ||
| env: | ||
| FEED_API_KEY: ${{ secrets.FEED_API_KEY }} | ||
| FEED_SOURCE: ${{ secrets.FEED_SOURCE }} | ||
| run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" |
There was a problem hiding this comment.
The push-to-feed step currently runs for branch pushes and pull_request runs as well, which can (a) unintentionally publish packages from non-release builds and (b) fail PR builds because secrets are not provided to workflows from forks. Gate this step (or the whole package job) so it only runs on tag pushes (e.g., github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')), and optionally restrict to the canonical repo/owner.
| env: | ||
| FEED_API_KEY: ${{ secrets.FEED_API_KEY }} | ||
| FEED_SOURCE: ${{ secrets.FEED_SOURCE }} | ||
| run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" |
There was a problem hiding this comment.
dotnet nuget push without --skip-duplicate makes the workflow non-idempotent: rerunning a successful tag build (or rebuilding an existing tag) will typically fail with a conflict when the version already exists in the feed. Consider adding --skip-duplicate (and/or pushing only the intended package type) so release reruns don't fail unnecessarily.
| run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" | |
| run: dotnet nuget push ./nuget.package/*.nupkg --api-key "$FEED_API_KEY" --source "$FEED_SOURCE" --skip-duplicate |
| name: NuGet package | ||
| path: ./nuget.package/*.nupkg | ||
| - name: Push package to feed 🐙 | ||
| id: push-feed |
There was a problem hiding this comment.
The id: push-feed step id isn't referenced anywhere in this workflow. If you don't consume outputs from this step later, drop the id to reduce noise.
| id: push-feed |
| MinVer: Calculated version 2.0.313-alpha.0.3. | ||
| 2.0.313-alpha.0.3 |
There was a problem hiding this comment.
The MinVer output example is internally inconsistent: it shows Tag: '2.0.323' but then Calculated version 2.0.313-alpha.0.3 / 2.0.313-alpha.0.3 (lower than the tag). Update the example so the calculated version matches the shown tag (or adjust the tag/version pair together).
| MinVer: Calculated version 2.0.313-alpha.0.3. | |
| 2.0.313-alpha.0.3 | |
| MinVer: Calculated version 2.0.324-alpha.0.3. | |
| 2.0.324-alpha.0.3 |
|
Replaced by #7 |
This is going to need #1 to be merged before it does anything useful.
Relates to MD-1600