Add release workflow for the Go CLI - #492
Open
xxxxxxjun wants to merge 4 commits into
Open
Conversation
Also list the new package target in `make help` and replace an em dash in a workflow error message.
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
Automates CLI releases. Pushing a
cli/X.Y.Ztag builds all four platforms, packages them, and attaches the archives to a draft release for review.Closes #37
Two things the issue leaves ambiguous. I picked an answer for each so this could be implemented; say the word and I'll change either.
Asset names. The issue lists three unversioned files. I used
actionbase_{version}_{os}_{arch}plus awindows_amd64.zip, which is what the publishedcli/0.0.1ships and whatmake build-allalready names its output directories, so nothing needs renaming.Tag form.
cli/X.Y.Z, nov. A leadingvis stripped if present, socli/v1.0.0works too. Stripping matters because the version reaches-X main.Version, and the CLI prepends its ownvwhen printing--version, so av-prefixed tag would reportvv1.0.0.Changes
.github/workflows/release-cli.yml: builds and packages on tag pushes, on PRs touching this workflow orcli/Makefile, and on manual dispatch, publishing four archives pluschecksums.txt. Only tag pushes reach the publish job, so PR runs keep a read-only token.cli/Makefile: newpackagetarget, somake package VERSION=1.0.0reproduces the release artifacts locally. It depends onbuild-all, per the issue's "use the existingcli/Makefile".cli/README.md: rewrote the Release Guide, which told you togit tag -a v1.0.0. That tag has nocli/prefix, so it wouldn't trigger the workflow at all.Choices worth flagging:
--clobberdeletes assets before uploading, andcli/0.0.1's hand-built assets aren't reproducible.GOOS/GOARCHper binary, not only the version string. That string is identical across platforms, so nothing else would catch adarwin_amd64binary inside thedarwin_arm64archive.--generate-notes..github/release.ymlis repo-wide with no per-tag scoping, so notes on acli/tag would sweep in every server and engine PR since the last tag.concurrency:is grouped per ref, so distinct tags never contend. Cancelling a tag run mid-upload would leave a partial asset set, socancel-in-progressis limited to pull requests.Left alone deliberately:
install.shsections ofcli/README.mdare byte-identical. There's noinstall.shin the tree and I didn't want to decide whether it's still planned, so I put a two-line note above them rather than editing them.RELEASES.mdline 124 says CLI binaries ship via Releases but documents no procedure, andlinux/arm64has never shipped. Both look like follow-ups.How to Test
The build job runs on this PR, since its trigger paths include the workflow file.
For the publish half, I ran the pipeline on my fork:
shasum -a 256 -c checksums.txtpassed on all four archives, and thedarwin_arm64binary reportedv0.0.0-rc.1.gh release create, so no duplicate release appears.Create draft release if absentwithcli/0.0.0-rc.3 is already published; refusing to overwrite its assets, andUpload assetsnever runs.Locally,
cd cli && make package VERSION=1.0.0produces the same five files.