Skip to content

ci: publish the CLI as a gh extension - #91

Merged
jferrl merged 1 commit into
mainfrom
ci/gh-extension
Oct 31, 2026
Merged

jferrl merged 1 commit into
mainfrom
ci/gh-extension

Conversation

@jferrl

@jferrl jferrl commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

People who use the GitHub CLI install tools as gh extensions. This publishes githubauth as one, so gh extension install jferrl/gh-githubauth makes it available as gh githubauth. gh installs a binary extension from the latest release of a repo named gh-*, picking the asset whose name ends in the platform (darwin-arm64, windows-amd64.exe). A new release job copies each release's binaries to jferrl/gh-githubauth under those names.

What this does

On a v* tag gh-githubauth gets
New stable version, highest so far A release with six binaries, marked latest
Tag with a suffix, e.g. v1.13.0-rc.1 A pre-release, never what gh extension install picks
An older version, released later A release that does not take latest
A re-run after the release was published Nothing: it is left alone
No HOMEBREW_TAP_GITHUB_TOKEN Nothing, with a warning

Changes

  • New gh-extension job after goreleaser: downloads the release's archives, checks them against checksums.txt, extracts the six binaries, and publishes them as a draft that becomes public only once all are uploaded.
  • It writes with the tap token, now extended to jferrl/gh-githubauth.
  • README and llms.txt list the install, starting with v1.12.0.

Rationale

It is a separate job because re-running goreleaser fails on the assets it already uploaded, so only a separate job can be retried with "Re-run failed jobs", and its failure leaves the main release alone. The binaries come from the published archives rather than goreleaser's dist/, which ties what gh installs to the checksummed release.

Two adversarial Codex reviews found seven defects in earlier drafts, all fixed: the release was created before its assets, pre-release and older tags could become latest, re-runs could not recover, two releases could race, and a failed lookup of latest let an older tag win.

Migration Notes

The first extension release comes with the v1.12.0 tag. Verified locally: a snapshot binary installed with gh extension install . runs as gh githubauth, and the job's script, run against the real v1.11.0 archives with gh stubbed, takes the right path for a first publish, a leftover draft, an existing release, an older tag, a failed lookup and a missing token.

🤖 Generated with Claude Code

gh installs a binary extension from the latest release of a gh-* repo,
taking the asset whose name ends in os-arch (.exe on Windows). A new
gh-extension job, after goreleaser, downloads the release it published,
checks the archives against checksums.txt, and publishes their binaries
to jferrl/gh-githubauth under the same tag, so gh extension install
jferrl/gh-githubauth runs githubauth as gh githubauth.

The release is a draft until all six binaries are on it, since gh
installs whatever is latest. A tag with a pre-release suffix stays a
pre-release, and one that is not the highest version never becomes
latest. Runs are serialized, and a failed lookup of the current latest
stops the job rather than letting an older tag take it. A published
release is left alone; a draft left by a failed run is picked up.

It is a separate job so a failure leaves the main release alone, and
re-running only it works: re-running goreleaser fails on the assets it
already uploaded. It writes with the tap token, extended to the new
repo, and skips with a warning without it.
@codecov

codecov Bot commented Oct 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (e17b6f8) to head (023279c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #91   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files           8        8           
  Lines         845      845           
=======================================
  Hits          827      827           
  Misses         18       18           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jferrl
jferrl merged commit ac2c2f6 into main Oct 31, 2026
10 checks passed
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.

1 participant