Skip to content

Use nuget.org Trusted Publishing (OIDC) + add README badges - #7

Merged
timonkrebs merged 3 commits into
mainfrom
claude/charming-bell-iq2emr
Jun 20, 2026
Merged

Use nuget.org Trusted Publishing (OIDC) + add README badges#7
timonkrebs merged 3 commits into
mainfrom
claude/charming-bell-iq2emr

Conversation

@timonkrebs

Copy link
Copy Markdown
Owner

Two changes toward shipping v0.1.0-alpha.

1. Trusted Publishing (OIDC) for releases

Replaces the long-lived NUGET_API_KEY secret with nuget.org Trusted Publishing in release.yml:

  • Adds permissions: id-token: write so the runner can request a GitHub OIDC token.
  • New NuGet/login@v1 step (user: tsharp) exchanges that token for a short-lived nuget.org key. It's gated with if: so it's skipped on dry runs — dry runs never contact nuget.org.
  • The push step now reads the key from steps.login.outputs.NUGET_API_KEY. The explicit 13-package allow-list, dry-run gating, and --skip-duplicate are unchanged.
  • RELEASING.md / ROADMAP.md updated: documents the trusted-publishing policy (owner tsharp, repo timonkrebs/BettererNet, workflow release.yml) instead of an API-key secret.

Validation: dry-run on this branch passed green — run #4 — confirming the workflow parses on GitHub and still packs all 13 (login step correctly skipped). The OIDC exchange itself is only exercised on a real v* tag publish.

2. README badges

  • CI status badge (Build & test workflow on main).
  • NuGet version badge for BettererNet.Cli, using shields' vpre so it shows prerelease versions (the project ships alphas). It'll read "no version" until the first publish, then light up.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V1phdgDossB7htzxcbZTNF


Generated by Claude Code

claude added 2 commits June 19, 2026 20:49
Authenticate the release workflow via nuget.org Trusted Publishing rather
than a long-lived NUGET_API_KEY secret:

- Add `id-token: write` and a `NuGet/login@v1` step that exchanges the
  GitHub OIDC token for a short-lived nuget.org key. The login step is
  skipped on dry runs, so dry runs never touch nuget.org.
- Source the push key from the login step's output; drop the secret.
- Update RELEASING.md (Trusted Publishing setup) and ROADMAP.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1phdgDossB7htzxcbZTNF
- CI badge tracks the Build & test workflow on main.
- NuGet badge uses shields' vpre so it shows the latest version including
  prereleases (the project ships alphas; a stable-only badge would read
  "no version" until a 1.0).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1phdgDossB7htzxcbZTNF
Copilot AI review requested due to automatic review settings June 19, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ef44dfc82

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread RELEASING.md Outdated
(OIDC) — there is **no API key secret to manage**. On nuget.org (Account → Trusted Publishing), add a
policy matching this repository:

- **Package owner:** `tsharp`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid granting this repo all tsharp package rights

Configuring the Trusted Publishing policy under tsharp widens this release credential beyond BettererNet: Microsoft’s policy ownership docs state that the policy applies to all packages owned by the selected owner, and the public tsharp profile currently owns unrelated packages such as MemoizR and PipeEx. In any non-dry release run, this repo can now mint a key with rights to those packages, whereas the previous setup explicitly asked for an API key scoped to BettererNet.*; use a BettererNet-only NuGet owner or add a protected GitHub environment and require it in the policy before removing the scoped key.

Useful? React with 👍 / 👎.

Trusted Publishing policies are owner-wide (a policy can push any package the
owner holds), so bind real releases to a protected GitHub environment that the
nuget.org policy can require. The release job joins `nuget-release` only on a
real publish (tag push or dry_run=false); dry runs resolve to an empty
environment name so packaging can still be verified on any branch.

Documents creating the environment (restrict to v* tags, optional required
reviewer) and adding it to the nuget.org policy in RELEASING.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1phdgDossB7htzxcbZTNF
@timonkrebs
timonkrebs merged commit a3172bc into main Jun 20, 2026
2 checks passed
@timonkrebs
timonkrebs deleted the claude/charming-bell-iq2emr branch June 20, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants