mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-08-28 05:27:41 +00:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
297a591fd2
commit
ae35cb114c
2 changed files with 79 additions and 0 deletions
45
.github/workflows/release.yml
vendored
45
.github/workflows/release.yml
vendored
|
|
@ -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)
|
||||
|
|
|
|||
34
installer/fabro-beta.rb.template
Normal file
34
installer/fabro-beta.rb.template
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue