Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
goreleaser:
Expand All @@ -31,3 +32,84 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}

- name: Get version and SHA256
id: release
run: |
VERSION=${GITHUB_REF#refs/tags/}
echo "version=$VERSION" >> $GITHUB_OUTPUT

TARBALL_URL="https://github.com/${{ github.repository }}/archive/refs/tags/$VERSION.tar.gz"
SHA256=$(curl -sL "$TARBALL_URL" | sha256sum | cut -d' ' -f1)
echo "sha256=$SHA256" >> $GITHUB_OUTPUT

- name: Update Homebrew Formula
run: |
VERSION=${{ steps.release.outputs.version }}
SHA256=${{ steps.release.outputs.sha256 }}

mkdir -p Formula

cat > Formula/agentx.rb << EOF
# typed: false
# frozen_string_literal: true

class Agentx < Formula
desc "CLI tool for managing MCP servers and skills across AI coding agents"
homepage "https://github.com/${{ github.repository }}"
url "https://github.com/${{ github.repository }}/archive/refs/tags/$VERSION.tar.gz"
sha256 "$SHA256"
license "Apache-2.0"
head "https://github.com/${{ github.repository }}.git", branch: "master"

depends_on "go" => :build

def install
ldflags = %W[
-s -w
-X github.com/agentsdance/agentx/internal/version.Version=#{version}
]
system "go", "build", *std_go_args(ldflags: ldflags)
end

test do
assert_match version.to_s, shell_output("#{bin}/agentx version")
end
end
EOF

- name: Commit and push Formula
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"

# Create a new branch for the formula update
BRANCH_NAME="homebrew-${{ steps.release.outputs.version }}"

# Delete remote branch if it exists (from a previous failed run)
git push origin --delete "$BRANCH_NAME" 2>/dev/null || true

git checkout -b "$BRANCH_NAME"

git add Formula/agentx.rb

if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update homebrew formula to ${{ steps.release.outputs.version }}"
git push origin "$BRANCH_NAME"

# Create PR using GitHub CLI (may fail if Actions doesn't have PR permissions)
# To enable: Settings → Actions → General → Workflow permissions → Allow GitHub Actions to create and approve pull requests
if gh pr create --title "chore: update homebrew formula to ${{ steps.release.outputs.version }}" \
--body "Automated PR to update Homebrew formula for release ${{ steps.release.outputs.version }}" \
--base master \
--head "$BRANCH_NAME"; then
echo "✅ PR created successfully"
else
echo "⚠️ Could not create PR automatically. Please create PR manually from branch: $BRANCH_NAME"
echo " Or enable PR creation in Settings → Actions → General → Workflow permissions"
fi
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96 changes: 0 additions & 96 deletions .goreleaser.yml

This file was deleted.

54 changes: 10 additions & 44 deletions Formula/agentx.rb
Original file line number Diff line number Diff line change
@@ -1,59 +1,25 @@
# typed: false
# frozen_string_literal: true

# This formula is auto-generated by GoReleaser.
# Manual edits will be overwritten on the next release.
#
# To use this formula before it's published to the tap:
# brew install --build-from-source ./Formula/agentx.rb
#
# After publishing, users can install via:
# brew tap agentsdance/agentx
# brew install agentx

class Agentx < Formula
desc "CLI tool for managing MCP servers and skills across AI coding agents"
homepage "https://github.com/agentsdance/agentx"
url "https://github.com/agentsdance/agentx/archive/refs/tags/v0.0.5.tar.gz"
sha256 "387afada91e1dda9700baafd9b0926b0b4617138350a5a0627b92dec73c0d939"
license "Apache-2.0"
version "0.0.7"

on_macos do
on_intel do
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_darwin_amd64.tar.gz"
sha256 "6b7181fab5420bd6675e042cf5db5ba02809099fe49057bd1e1cae79c9e8de21"
end

on_arm do
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_darwin_arm64.tar.gz"
sha256 "e5ca1aed035684a8c6d672399718418b350f433ba2a72766bd781df99252e6ee"
end
end
head "https://github.com/agentsdance/agentx.git", branch: "master"

on_linux do
on_intel do
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_linux_amd64.tar.gz"
sha256 "19038bde1de5a4bc761c810762d0cdecdadbe85a21799896280951c24e2844a1"
end

on_arm do
url "https://github.com/agentsdance/agentx/releases/download/v#{version}/agentx_#{version}_linux_arm64.tar.gz"
sha256 "3f2da0a3b3e6880f4af2dbbab07d1fc88998c1bf8cf387d12e9928398d7568e4"
end
end

head do
url "https://github.com/agentsdance/agentx.git", branch: "master"
depends_on "go" => :build
end
depends_on "go" => :build

def install
if build.head?
system "go", "build", "-ldflags", "-s -w -X github.com/agentsdance/agentx/internal/version.Version=head", "-o", "agentx", "."
end
bin.install "agentx"
ldflags = %W[
-s -w
-X github.com/agentsdance/agentx/internal/version.Version=#{version}
]
system "go", "build", *std_go_args(ldflags: ldflags)
end

test do
system "#{bin}/agentx", "--version"
assert_match version.to_s, shell_output("#{bin}/agentx version")
end
end
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ It provides both a command-line interface and an interactive terminal UI (TUI) f
### Homebrew (macOS/Linux)

```bash
# Add the tap
brew tap agentsdance/agentx
# Add the tap (points to this repo)
brew tap agentsdance/agentx https://github.com/agentsdance/agentx.git

# Install agentx
brew install agentx
Expand Down