ci: publish src/public/ packages to github packages #34
No reviewers
Labels
No labels
bug
commercial
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jasoncouture/llama-shears!34
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/nuget-publish"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Pushes every
src/public/package to the GitHub Packages NuGet feed (https://nuget.pkg.github.com/jasoncouture/index.json) on every push tomainandrelease/**. NBGV provides the version. Idempotent on re-run.What's in here
.github/workflows/nuget-publish.yml:pushtomainandrelease/**.contents: read,packages: write(the latter is what authorizesdotnet nuget pushagainstGITHUB_TOKEN).fetch-depth: 0for NBGV) →setup-dotnet@v4(10.0.x) →dotnet restore LlamaShears.slnx→dotnet pack LlamaShears.slnx -c Release --no-restore -o ./artifacts/nuget→dotnet nuget push ./artifacts/nuget/*.nupkg --source <feed> --api-key $GITHUB_TOKEN --skip-duplicate.Why
dotnet packon the slnx instead of looping per-projectIsPackableisfalseby default and only flipped on undersrc/public/(viasrc/public/Directory.Build.props). Packing the slnx therefore packs exactly the public packages with zero per-project bookkeeping — adding a new public package later requires no workflow edit.Why
--skip-duplicateNBGV produces deterministic versions from git history, so re-running the workflow on the same commit (e.g. after editing the workflow itself) emits the same package versions. Without
--skip-duplicatethose re-runs would 409 from the feed and fail the workflow.--skip-duplicatemakes them no-ops — only genuinely new versions get pushed.Out of scope
version.jsonadjustments. The currentpublicReleaseRefSpeclists^refs/heads/main$and^refs/heads/v\d+(?:\.\d+)?$. Pushing fromrelease/**/*will produce non-public-release builds with+g<commit>metadata — that's the existing NBGV configuration speaking, not a workflow choice. If/when the release-branch convention crystallises,version.jsoncan be updated independently.Test plan
docs-api-up-to-datepre-push check passed.main— that happens after this stack lands. First run will reveal any auth / source-URL /--skip-duplicateedge cases.Stacking note
Targets
ci/pr-coverage-comment(PR #33). Will retargetmainautomatically as the chain merges.🤖 Generated with Claude Code
All committers have signed the CLA.
Pull request overview
Adds a GitHub Actions workflow to publish NuGet packages produced from
src/public/to GitHub Packages on pushes tomainandrelease/**, using Nerdbank.GitVersioning-derived versions.Changes:
.github/workflows/nuget-publish.ymlto restore, pack, and push packages on branch pushes.--skip-duplicateto make re-runs idempotent.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -0,0 +41,4 @@run: |dotnet nuget push './artifacts/nuget/*.nupkg' \--source 'https://nuget.pkg.github.com/jasoncouture/index.json' \--api-key "${{ secrets.GITHUB_TOKEN }}" \The GitHub Packages feed URL is hard-coded to
jasoncouture, which will break if the repo is transferred/renamed and will also cause this workflow to fail on forks (the fork’sGITHUB_TOKENwon’t have rights to push to that owner’s feed). Consider deriving the source from${{ github.repository_owner }}(or${{ github.repository }}) and, if you only want publishing from the canonical repo, add anif:guard on the job/step to prevent running on forks.