Skip to content

Commit dee9b62

Browse files
committed
--- brew
1 parent 726a371 commit dee9b62

4 files changed

Lines changed: 90 additions & 142 deletions

File tree

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Update Homebrew Formula
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
update-homebrew:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
16+
- name: Get release info
17+
id: release
18+
run: |
19+
VERSION=${{ github.event.release.tag_name }}
20+
echo "version=$VERSION" >> $GITHUB_OUTPUT
21+
22+
# Download and calculate SHA256
23+
TARBALL_URL="https://github.com/${{ github.repository }}/archive/refs/tags/$VERSION.tar.gz"
24+
SHA256=$(curl -sL "$TARBALL_URL" | sha256sum | cut -d' ' -f1)
25+
echo "sha256=$SHA256" >> $GITHUB_OUTPUT
26+
27+
- name: Update Formula
28+
run: |
29+
VERSION=${{ steps.release.outputs.version }}
30+
SHA256=${{ steps.release.outputs.sha256 }}
31+
32+
mkdir -p Formula
33+
34+
cat > Formula/agentx.rb << EOF
35+
# typed: false
36+
# frozen_string_literal: true
37+
38+
class Agentx < Formula
39+
desc "CLI tool for managing MCP servers and skills across AI coding agents"
40+
homepage "https://github.com/${{ github.repository }}"
41+
url "https://github.com/${{ github.repository }}/archive/refs/tags/$VERSION.tar.gz"
42+
sha256 "$SHA256"
43+
license "Apache-2.0"
44+
head "https://github.com/${{ github.repository }}.git", branch: "master"
45+
46+
depends_on "go" => :build
47+
48+
def install
49+
ldflags = %W[
50+
-s -w
51+
-X github.com/agentsdance/agentx/internal/version.Version=#{version}
52+
]
53+
system "go", "build", *std_go_args(ldflags: ldflags)
54+
end
55+
56+
test do
57+
assert_match version.to_s, shell_output("#{bin}/agentx version")
58+
end
59+
end
60+
EOF
61+
62+
- name: Commit and push
63+
run: |
64+
git config --local user.email "action@github.com"
65+
git config --local user.name "GitHub Action"
66+
67+
git add Formula/agentx.rb
68+
69+
if git diff --staged --quiet; then
70+
echo "No changes to commit"
71+
else
72+
git commit -m "chore: update homebrew formula to ${{ steps.release.outputs.version }}
73+
74+
- Update formula for version ${{ steps.release.outputs.version }}
75+
- SHA256: ${{ steps.release.outputs.sha256 }}"
76+
77+
git push origin HEAD
78+
fi

.goreleaser.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

Formula/agentx.rb

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,25 @@
11
# typed: false
22
# frozen_string_literal: true
33

4-
# This formula is auto-generated by GoReleaser.
5-
# Manual edits will be overwritten on the next release.
6-
#
7-
# To use this formula before it's published to the tap:
8-
# brew install --build-from-source ./Formula/agentx.rb
9-
#
10-
# After publishing, users can install via:
11-
# brew tap agentsdance/agentx
12-
# brew install agentx
13-
144
class Agentx < Formula
155
desc "CLI tool for managing MCP servers and skills across AI coding agents"
166
homepage "https://github.com/agentsdance/agentx"
7+
url "https://github.com/agentsdance/agentx/archive/refs/tags/v0.0.5.tar.gz"
8+
sha256 "387afada91e1dda9700baafd9b0926b0b4617138350a5a0627b92dec73c0d939"
179
license "Apache-2.0"
18-
version "0.0.7"
19-
20-
on_macos do
21-
on_intel do
22-
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_darwin_amd64.tar.gz"
23-
sha256 "6b7181fab5420bd6675e042cf5db5ba02809099fe49057bd1e1cae79c9e8de21"
24-
end
25-
26-
on_arm do
27-
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_darwin_arm64.tar.gz"
28-
sha256 "e5ca1aed035684a8c6d672399718418b350f433ba2a72766bd781df99252e6ee"
29-
end
30-
end
10+
head "https://github.com/agentsdance/agentx.git", branch: "master"
3111

32-
on_linux do
33-
on_intel do
34-
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_linux_amd64.tar.gz"
35-
sha256 "19038bde1de5a4bc761c810762d0cdecdadbe85a21799896280951c24e2844a1"
36-
end
37-
38-
on_arm do
39-
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_linux_arm64.tar.gz"
40-
sha256 "3f2da0a3b3e6880f4af2dbbab07d1fc88998c1bf8cf387d12e9928398d7568e4"
41-
end
42-
end
43-
44-
head do
45-
url "https://github.com/agentsdance/agentx.git", branch: "master"
46-
depends_on "go" => :build
47-
end
12+
depends_on "go" => :build
4813

4914
def install
50-
if build.head?
51-
system "go", "build", "-ldflags", "-s -w -X github.com/agentsdance/agentx/internal/version.Version=head", "-o", "agentx", "."
52-
end
53-
bin.install "agentx"
15+
ldflags = %W[
16+
-s -w
17+
-X github.com/agentsdance/agentx/internal/version.Version=#{version}
18+
]
19+
system "go", "build", *std_go_args(ldflags: ldflags)
5420
end
5521

5622
test do
57-
system "#{bin}/agentx", "--version"
23+
assert_match version.to_s, shell_output("#{bin}/agentx version")
5824
end
5925
end

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ It provides both a command-line interface and an interactive terminal UI (TUI) f
4141
### Homebrew (macOS/Linux)
4242

4343
```bash
44-
# Add the tap
45-
brew tap agentsdance/agentx
44+
# Add the tap (points to this repo)
45+
brew tap agentsdance/agentx https://github.com/agentsdance/agentx.git
4646

4747
# Install agentx
4848
brew install agentx

0 commit comments

Comments
 (0)