From 6a4a3a49f32d7ffb6f08a23e73ee92495ff34910 Mon Sep 17 00:00:00 2001 From: Mads Hvelplund Date: Sun, 25 Oct 2026 10:10:57 +0100 Subject: [PATCH] ci: publish a GitHub release with the dist binaries When commitizen tags a new version, build every binary with mise run dist from the tag and attach them, with SHA256SUMS, to a GitHub release whose notes are the changelog increment. Document the release flow and the download in the README. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01K2ffjZ98kNMDjtSLJKwF2t --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ README.md | 14 +++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44c0572..5dc557a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ name: Release # Conventional Commits since the last tag. A bump commits the new version # (.cz.toml, mise.toml pins, CHANGELOG.md) and pushes it with a `vX.Y.Z` tag. # Commits that release nothing (docs, ci, chore, ...) leave main untouched. +# A new tag gets a GitHub release with every `mise run dist` binary attached. # # The push uses a token minted from a GitHub App, so it can get past branch # protection and triggers workflows for the bump commit. The App's client ID is @@ -21,6 +22,11 @@ concurrency: group: release cancel-in-progress: false +# The toolchain comes from mise.toml, as in ci.yml. +env: + MISE_EXEC_AUTO_INSTALL: 'false' + MISE_TASK_RUN_AUTO_INSTALL: 'false' + jobs: ci: uses: ./.github/workflows/ci.yml @@ -71,3 +77,31 @@ jobs: with: name: release-notes path: release-notes.md + + release: + needs: bump + if: ${{ needs.bump.outputs.tag != '' }} + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v7 + with: + ref: ${{ needs.bump.outputs.tag }} + fetch-depth: 0 # tags for `git describe` in the version ldflags + - uses: jdx/mise-action@v5 + with: + version: 2026.10.18 + install_args: go golangci-lint + - run: mise run dist + - name: Checksums + working-directory: dist + run: sha256sum -- * > SHA256SUMS + - uses: actions/download-artifact@v8 + with: + name: release-notes + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ needs.bump.outputs.tag }} + run: gh release create "$TAG" dist/* --title "$TAG" --notes-file release-notes.md --verify-tag diff --git a/README.md b/README.md index ac32f8d..7c0870c 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,10 @@ This covers every command of gh-stack v0.2.1. Every command takes `--provider` ( git-stack is five binaries: `git-stack` itself and one plugin per provider, `git-stack-github`, `git-stack-gitlab`, `git-stack-bitbucket` and `git-stack-ado`. Install the providers you need next to `git-stack` or anywhere on your `PATH`. -1. Install the binaries (requires Go, see [Development](#development)): +1. Download the binaries for your platform from the + [latest release](https://github.com/mhvelplund/git-stack/releases/latest), named `--`, rename + each to `` (`.exe` on Windows), make them executable and put them on your `PATH`. `SHA256SUMS` lists + their checksums. Or install them with Go (see [Development](#development)): ```sh go install github.com/mhvelplund/git-stack/cmd/git-stack@latest @@ -235,6 +238,15 @@ mise run dist # cross-compile for Windows, Linux and macOS into dist/ To try a build, put `bin/` first on your `PATH` and run `git stack` in any repository. +Releases are automatic. Commit messages follow [Conventional Commits](https://www.conventionalcommits.org) (a +commit-msg hook checks them). On every push to `main`, the Release workflow runs CI and then +[commitizen](https://commitizen-tools.github.io/commitizen/): `feat` commits bump the minor version, `fix` and +`perf` the patch version and breaking changes (`feat!:` or a `BREAKING CHANGE:` footer) the major version. A bump +updates `.cz.toml`, the git-stack pins in `mise.toml` and `CHANGELOG.md`, tags `vX.Y.Z` and publishes a GitHub +release with the `mise run dist` binaries. The workflow pushes with a token from a GitHub App with read and write +access to the repository contents: set its client ID as the `RELEASE_APP_CLIENT_ID` Actions variable and its +private key as the `RELEASE_APP_PRIVATE_KEY` Actions secret. + ## License MIT. See [LICENSE](LICENSE). Contains work derived from gh-stack, Copyright GitHub, Inc.