From 89ec54ef889a295e29f700a590c72860afd4bdf5 Mon Sep 17 00:00:00 2001 From: gok03 Date: Mon, 18 May 2026 08:31:29 +0530 Subject: [PATCH] feat(release): automate version + tag via release-please MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wires up googleapis/release-please-action@v4 so that conventional-commit history on `main` drives a "Release vX.Y.Z" PR. Merging that PR creates the tag + GitHub release, which triggers the existing release.yaml → goreleaser → cask publish to RefuseHQ/homebrew-tap. Bootstrapped at 0.0.0; release-please will propose the first real version on the next push to main (likely 0.1.0 given the feat: commits in history). CHANGELOG.md reset to a clean header — release-please manages future entries from commit messages. Note: for the chain to fire end-to-end without manual intervention, the release-please workflow needs a PAT (RELEASE_PLEASE_TOKEN) with `contents: write` on this repo. With only GITHUB_TOKEN, the tag is created but downstream release.yaml does not fire (GitHub policy on token-cascaded workflows). The workflow uses the PAT if present and falls back to GITHUB_TOKEN otherwise. --- .github/workflows/release-please.yaml | 24 ++++++++++++++++++++++++ .release-please-manifest.json | 3 +++ CHANGELOG.md | 24 +----------------------- release-please-config.json | 16 ++++++++++++++++ 4 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/release-please.yaml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yaml b/.github/workflows/release-please.yaml new file mode 100644 index 0000000..795b865 --- /dev/null +++ b/.github/workflows/release-please.yaml @@ -0,0 +1,24 @@ +name: release-please + +on: + push: + branches: [main] + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + # If RELEASE_PLEASE_TOKEN is set (a PAT with `contents: write` on this + # repo), tags pushed by release-please will trigger release.yaml. With + # only the default GITHUB_TOKEN, the tag is created but downstream + # workflows do NOT fire (GitHub policy), so the release would need to + # be re-kicked manually. Set the PAT to wire the chain end-to-end. + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..e18ee07 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f2ac25..7dcac21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,26 +4,4 @@ All notable changes to refuse-cli are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) once it reaches 1.0. -## [Unreleased] - -### Added -- Community + governance: `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`, `SECURITY.md`, `CODEOWNERS`, issue + PR templates, `.editorconfig`, `ARCHITECTURE.md`, `ROADMAP.md`. -- `.golangci.yaml` and a `lint` workflow. -- Dependabot, CodeQL. -- Release signing (cosign) and SLSA provenance attestations. - -### Changed -- README: hero, badges, ecosystem matrix, cross-links to `refuse` and `refuse.dev`. - -## [0.0.1] — initial - -- Multicall binary: invoking the binary as `npm` / `pip` / `yarn` / `cargo` / etc. routes to the shim, invoking it as `refuse` opens the CLI. -- `refuse gate` decision engine: parses an install command, queries the server, and exits 0 (allow) or 2 (block). -- Argv parsers: npm, pnpm, yarn (classic + Berry), pip, pip3, cargo, gem, bun, go. -- Claude Code PreToolUse hook integration. -- Goreleaser-based releases for darwin/linux/windows × amd64/arm64. -- Homebrew tap (`refusehq/tap/refuse`). -- `scripts/install.sh` with sha256 checksum verification. - -[Unreleased]: https://github.com/RefuseHQ/refuse-cli/compare/v0.0.1...HEAD -[0.0.1]: https://github.com/RefuseHQ/refuse-cli/releases/tag/v0.0.1 + diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..b0f4069 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "release-type": "go", + "include-component-in-tag": false, + "include-v-in-tag": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "draft": false, + "prerelease": false, + "packages": { + ".": { + "package-name": "refuse-cli", + "changelog-path": "CHANGELOG.md" + } + } +}