Repository navigation
ci: publish the CLI as a gh extension - #91
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
People who use the GitHub CLI install tools as
ghextensions. This publishesgithubauthas one, sogh extension install jferrl/gh-githubauthmakes it available asgh githubauth. gh installs a binary extension from the latest release of a repo namedgh-*, 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
v*tagv1.13.0-rc.1gh extension installpicksHOMEBREW_TAP_GITHUB_TOKENChanges
gh-extensionjob aftergoreleaser: downloads the release's archives, checks them againstchecksums.txt, extracts the six binaries, and publishes them as a draft that becomes public only once all are uploaded.jferrl/gh-githubauth.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 asgh githubauth, and the job's script, run against the real v1.11.0 archives withghstubbed, 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