From dd3d8970077d5fc0f43cfef0b98617da794b461e Mon Sep 17 00:00:00 2001 From: Alexander Loth Date: Mon, 16 Nov 2026 16:06:22 +0100 Subject: [PATCH] Point the Homebrew formula at the npm tarball and test it on macOS Homebrew's npm helper removes prepare, prepack and postpack from package.json before packing, and the GitHub source tarball has no dist/, so the formula installed no binary (#69). The bump now passes the npm registry tarball, which contains the prebuilt dist/, and waits for that URL instead of the GitHub archive. A new workflow, homebrew.yml, installs aloth/tap/olcli on macos-latest, runs brew test and checks that olcli, olcli-mcp and git-remote-overleaf are linked. publish.yml calls it after the bump, and it can be started by hand. --- .github/workflows/homebrew.yml | 24 ++++++++++++++++++++++++ .github/workflows/publish.yml | 15 +++++++++++++-- CHANGELOG.md | 5 +++++ 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/homebrew.yml diff --git a/.github/workflows/homebrew.yml b/.github/workflows/homebrew.yml new file mode 100644 index 0000000..a1ec6f0 --- /dev/null +++ b/.github/workflows/homebrew.yml @@ -0,0 +1,24 @@ +name: Homebrew install check +# Installs olcli from aloth/homebrew-tap on macOS and runs the formula test, so +# a formula that installs no binary fails visibly. Runs after every formula +# bump in publish.yml and can be started by hand. +on: + workflow_dispatch: + workflow_call: +permissions: + contents: read +jobs: + brew-install: + runs-on: macos-latest + steps: + - name: Install olcli from the tap + run: | + brew update + brew install aloth/tap/olcli + - name: Run the formula test + run: brew test aloth/tap/olcli + - name: Check the linked commands + run: | + olcli --version + test -x "$(brew --prefix)/bin/olcli-mcp" + test -x "$(brew --prefix)/bin/git-remote-overleaf" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bc7a7ac..9571855 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -77,7 +77,7 @@ jobs: - name: Wait for tarball availability run: | for i in $(seq 1 10); do - STATUS=$(curl -sI "https://github.com/aloth/olcli/archive/refs/tags/${{ github.ref_name }}.tar.gz" -o /dev/null -w '%{http_code}') + STATUS=$(curl -sI "https://registry.npmjs.org/@aloth/olcli/-/olcli-${GITHUB_REF_NAME#v}.tgz" -o /dev/null -w '%{http_code}') if [ "$STATUS" = "200" ] || [ "$STATUS" = "302" ]; then echo "Tarball ready (HTTP $STATUS)" exit 0 @@ -87,15 +87,26 @@ jobs: done echo "Tarball not available after 50s" exit 1 + - uses: actions/checkout@v4 + - name: Read the version from package.json + id: version + run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT" - name: Bump Homebrew formula uses: mislav/bump-homebrew-formula-action@v4.2 with: formula-name: olcli homebrew-tap: aloth/homebrew-tap tag-name: ${{ github.ref_name }} - download-url: https://github.com/aloth/olcli/archive/refs/tags/${{ github.ref_name }}.tar.gz + # The npm tarball, not the GitHub source tarball: Homebrew's npm + # helper removes the prepare script before packing, so a source + # tarball without dist/ installs no binary. + download-url: https://registry.npmjs.org/@aloth/olcli/-/olcli-${{ steps.version.outputs.version }}.tgz create-pullrequest: false commit-message: | olcli: bump to {{version}} env: COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + + verify-homebrew: + needs: bump-homebrew + uses: ./.github/workflows/homebrew.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index be407b1..3ee65d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [Unreleased] + +### Fixed +- **`brew install aloth/tap/olcli` installs the commands again** ([#69](https://github.com/aloth/olcli/issues/69)) - the formula built from the GitHub source tarball, which has no `dist/`, and Homebrew removes the `prepare` script that builds it before packing, so the install finished without error but linked no `olcli`. The formula now installs the prebuilt npm package, the same one `npm install -g` uses, and the release workflow installs and tests the formula on macOS after every bump. Already fixed for 0.18.0: run `brew update && brew reinstall olcli`. Thanks to @floswald for the report and the diagnosis + ## [0.18.0] - 2026-11-16 ### Added