Add automated semver + CI + binary release workflows - #41
Merged
Conversation
CI runs `go vet`, `go build`, `go test -race` on every PR and push to main, plus shellcheck on every tracked `.sh` file (preserved from the previous go.yml). A successful run on main triggers the release workflow, which reads the merged PR's `release:*` label (default `patch`), computes the next semver tag, builds a static linux/amd64 binary stamped with version + commit metadata, pushes the tag, and publishes a GitHub release with `ussher`, `ussher.sha256`, and auto-generated notes. The asset is named `ussher` (no -linux-amd64 suffix) so the existing install.sh keeps working. Replaces the previous tag-triggered release in `go.yml` with a fully automated PR-label-driven flow.
The shellcheck job moved into ci.yml; the tag-triggered build/release flow is replaced by the PR-label-driven release.yml.
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
Sets up automated semver + CI + binary release for this repo:
ci.ymlrunsgo vet,go build,go test -race, and shellcheck on every PR and on every push tomain. The shellcheck job (which lints every tracked*.shfile) is preserved from the previousgo.yml.release.ymlchains off a successful CI run onmain: it reads the merged PR'srelease:*label, computes the next semver tag, builds a staticlinux/amd64binary stamped with version + commit metadata via-Xon the existing variables inversion.go, pushes the tag, and publishes a GitHub release withussher,ussher.sha256, and auto-generated notes.The release asset is named
ussher(no-linux-amd64suffix) so the existinginstall.sh— which curlshttps://github.com/dolph/ussher/releases/latest/download/ussherand verifies it againstussher.sha256— keeps working unchanged.go.ymlis removed; its shellcheck job moved intoci.ymland its tag-triggered build/release flow is replaced by the PR-label-drivenrelease.yml.codeql-analysis.ymlis left alone.Version-bump labels
Apply exactly one to a PR (default is
release:patchif none set):release:majorrelease:minorrelease:patchrelease:skipPrecedence:
skip>major>minor>patch. Direct pushes tomain(no PR) fall back torelease:patch.Behavior changes vs. the old
go.ymlgit push origin vX.Y.Z; they now fire automatically after a PR merge tomain, based on the merge commit's PR label. The next tag is computed from the latest existing tag (currentlyv1.1.0), so the first merge after this PR cutsv1.1.1by default.CHANGELOG.md; now auto-generated from PR titles + commit messages since the previous tag (viagh release create --generate-notes --notes-start-tag). TheCHANGELOG.mdis no longer wired to the release body — keep maintaining it as project history if you want, but it won't appear on the release page automatically.go vet/go build ./.../go test -race ./...directly instead of invoking./build.sh. The release step still stamps the same sevenversion.govariables (GitTag,GitCommit,GoVersion,BuildTimestamp,BuildOS,BuildArch,BuildTainted) and runs./ussher --versionas a sanity check.Test plan
mainand cutsv1.1.1with bothussherandussher.sha256attached.curl -fLO https://github.com/dolph/ussher/releases/latest/download/ussher && curl -fLO https://github.com/dolph/ussher/releases/latest/download/ussher.sha256 && sha256sum -c ussher.sha256continues to succeed against the new release../ussher --versionon the released binary prints a real tag (e.g.Version: v1.1.1), short commit, Go version, build date,linux/amd64.release:minorcutsv1.2.0.release:skipproduces no new tag.