Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

ci(cli): update the Homebrew tap after each stable release

Andrejb22dfe683949
diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml
index 3209dd4f9..8df29dc13 100644
--- a/.github/workflows/publish-cli.yml
+++ b/.github/workflows/publish-cli.yml
@@ -266,6 +266,51 @@ jobs:
--latest=false \
--prerelease="$PRERELEASE"
+ homebrew:
+ name: Update Homebrew tap
+ needs: [check, release]
+ if: needs.check.outputs.prerelease == 'false'
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: read
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+ sparse-checkout: packages/cli/scripts
+
+ - name: Checkout Homebrew tap
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ repository: usekaneo/homebrew-tap
+ path: homebrew-tap
+ persist-credentials: false
+
+ - name: Update the kaneo formula
+ env:
+ GH_TOKEN: ${{ github.token }}
+ TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
+ VERSION: ${{ needs.check.outputs.version }}
+ run: |
+ set -euo pipefail
+ if [ -z "$TAP_TOKEN" ]; then
+ echo "::error::Set the HOMEBREW_TAP_TOKEN secret to a token that can push to usekaneo/homebrew-tap."
+ exit 1
+ fi
+ gh release download "cli-v$VERSION" --repo "$GITHUB_REPOSITORY" --pattern SHA256SUMS --dir "$RUNNER_TEMP"
+ sh packages/cli/scripts/homebrew-formula.sh "$VERSION" "$RUNNER_TEMP/SHA256SUMS" > homebrew-tap/Formula/kaneo.rb
+ cd homebrew-tap
+ if git diff --quiet; then
+ echo "The formula is already at $VERSION."
+ exit 0
+ fi
+ git config user.name "github-actions[bot]"
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
+ git commit -am "kaneo $VERSION"
+ git push "https://x-access-token:${TAP_TOKEN}@github.com/usekaneo/homebrew-tap.git" HEAD:main
+
npm:
name: Publish to npm
needs: check
diff --git a/packages/cli/README.md b/packages/cli/README.md
index 3679fb8a0..91ffecea5 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -175,4 +175,6 @@ The CLI is written with [Effect](https://effect.website) 4 (`effect/cli`, `effec
Bump `version` in `package.json` and merge to `main`. The `Release CLI` workflow (`.github/workflows/publish-cli.yml`) tests and bundles the CLI, compiles standalone binaries with Bun for macOS, Linux (glibc and musl) and Windows, and creates the `cli-v<version>` GitHub release with the binaries and a `SHA256SUMS` file. It skips versions that already have a release, and you can also run it by hand from the Actions tab.
+After a stable release, the workflow also points the `kaneo` formula in [usekaneo/homebrew-tap](https://github.com/usekaneo/homebrew-tap) at the new binaries. It writes the formula with `scripts/homebrew-formula.sh` and pushes with the `HOMEBREW_TAP_TOKEN` secret, a fine-grained token that can write to that repository only.
+
While the `CLI_NPM_PUBLISH` repository variable is `true`, the same workflow also publishes `@kaneo/cli` to npm with provenance through trusted publishing, skipping versions that are already published.