From ae35cb114c2b5dedbf25662b078f51b6155c97b9 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Fri, 17 Apr 2026 08:12:53 -0400 Subject: [PATCH] ci: publish fabro-beta Homebrew formula on pre-release tags Adds a sibling Homebrew formula so users can opt into pre-releases with `brew install fabro-sh/tap/fabro-beta`. Pre-release tags (v*-*) update Formula/fabro-beta.rb in the tap; stable tags still only touch Formula/fabro.rb. The two formulae declare conflicts_with each other since they both install the fabro binary. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 45 ++++++++++++++++++++++++++++++++ installer/fabro-beta.rb.template | 34 ++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 installer/fabro-beta.rb.template diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 117f9b668..a0823f510 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -143,3 +143,48 @@ jobs: git config user.email "github-actions[bot]@users.noreply.github.com" git add Formula/fabro.rb git diff --cached --quiet || (git commit -m "Update fabro to ${TAG_NAME}" && git push) + + update-homebrew-beta: + name: Update Homebrew Beta Formula + needs: release + if: ${{ contains(github.ref_name, '-') }} + runs-on: ubuntu-latest + environment: release + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + path: target/distrib + pattern: artifacts-fabro-* + merge-multiple: true + + - name: Generate and push beta formula + env: + GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} + TAG_NAME: ${{ github.ref_name }} + run: | + VERSION="${TAG_NAME#v}" + + SHA_AARCH64_DARWIN=$(awk '{print $1}' target/distrib/fabro-aarch64-apple-darwin.tar.gz.sha256) + SHA_X86_64_LINUX=$(awk '{print $1}' target/distrib/fabro-x86_64-unknown-linux-gnu.tar.gz.sha256) + SHA_AARCH64_LINUX=$(awk '{print $1}' target/distrib/fabro-aarch64-unknown-linux-gnu.tar.gz.sha256) + + sed \ + -e "s/{{VERSION}}/$VERSION/g" \ + -e "s/{{SHA_AARCH64_DARWIN}}/$SHA_AARCH64_DARWIN/g" \ + -e "s/{{SHA_X86_64_LINUX}}/$SHA_X86_64_LINUX/g" \ + -e "s/{{SHA_AARCH64_LINUX}}/$SHA_AARCH64_LINUX/g" \ + installer/fabro-beta.rb.template > fabro-beta.rb + + git clone https://x-access-token:${GH_TOKEN}@github.com/fabro-sh/homebrew-tap.git tap + cp fabro-beta.rb tap/Formula/fabro-beta.rb + cd tap + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add Formula/fabro-beta.rb + git diff --cached --quiet || (git commit -m "Update fabro-beta to ${TAG_NAME}" && git push) diff --git a/installer/fabro-beta.rb.template b/installer/fabro-beta.rb.template new file mode 100644 index 000000000..f88a124a5 --- /dev/null +++ b/installer/fabro-beta.rb.template @@ -0,0 +1,34 @@ +class FabroBeta < Formula + desc "Unified CLI for the Fabro AI framework (pre-release channel)" + homepage "https://fabro.sh" + license "MIT" + version "{{VERSION}}" + + conflicts_with "fabro", because: "both install the fabro binary" + + if OS.mac? + if Hardware::CPU.arm? + url "https://github.com/fabro-sh/fabro/releases/download/v{{VERSION}}/fabro-aarch64-apple-darwin.tar.gz" + sha256 "{{SHA_AARCH64_DARWIN}}" + end + end + + if OS.linux? + if Hardware::CPU.intel? + url "https://github.com/fabro-sh/fabro/releases/download/v{{VERSION}}/fabro-x86_64-unknown-linux-gnu.tar.gz" + sha256 "{{SHA_X86_64_LINUX}}" + end + if Hardware::CPU.arm? + url "https://github.com/fabro-sh/fabro/releases/download/v{{VERSION}}/fabro-aarch64-unknown-linux-gnu.tar.gz" + sha256 "{{SHA_AARCH64_LINUX}}" + end + end + + def install + bin.install "fabro" + end + + test do + assert_match version.to_s, shell_output("#{bin}/fabro --version") + end +end