From 43363a5aafed0a52a3a41a5827321948fb168b96 Mon Sep 17 00:00:00 2001 From: aladac Date: Sun, 5 Apr 2026 18:49:00 +0200 Subject: [PATCH] Add Homebrew tap auto-update to release workflow --- .github/workflows/release.yml | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 52d9344..507b727 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,3 +62,70 @@ jobs: uses: softprops/action-gh-release@v2 with: generate_release_notes: true + + update-homebrew: + name: update-homebrew + needs: publish-npm + runs-on: ubuntu-latest + steps: + - name: Get version + id: version + run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Wait for npm registry propagation + run: sleep 30 + + - name: Get npm tarball checksum + id: checksums + run: | + VERSION="${GITHUB_REF_NAME#v}" + URL="https://registry.npmjs.org/@saiden/browse/-/browse-${VERSION}.tgz" + curl -fsSL "${URL}" -o npm-tarball.tgz + sha=$(sha256sum npm-tarball.tgz | cut -d' ' -f1) + echo "npm_sha=${sha}" >> "$GITHUB_OUTPUT" + + - name: Update Homebrew formula + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + VERSION="${{ steps.version.outputs.version }}" + SHA_NPM="${{ steps.checksums.outputs.npm_sha }}" + + cat > /tmp/browse.rb <