Skip to content

Commit c9f5d71

Browse files
mzhaomclaude
andcommitted
Add GoReleaser for automated releases with Homebrew support
Replace manual release workflow with GoReleaser to simplify cross-platform builds and enable Homebrew installation. Users can now install via: brew tap mzhaom/claude-cli-protocol brew install claude-cli-tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f0c6a50 commit c9f5d71

File tree

3 files changed

+123
-62
lines changed

3 files changed

+123
-62
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,32 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
tags:
6+
- "v*"
67

78
permissions:
89
contents: write
910

1011
jobs:
11-
build:
12+
goreleaser:
1213
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
goos: [linux, darwin, windows]
16-
goarch: [amd64, arm64]
1714
steps:
18-
- name: Checkout code
15+
- name: Checkout
1916
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
2019

2120
- name: Setup Go
2221
uses: actions/setup-go@v5
2322
with:
2423
go-version: '1.23'
2524

26-
- name: Set binary extension
27-
id: ext
28-
run: |
29-
if [ "${{ matrix.goos }}" = "windows" ]; then
30-
echo "ext=.exe" >> $GITHUB_OUTPUT
31-
else
32-
echo "ext=" >> $GITHUB_OUTPUT
33-
fi
34-
35-
- name: Build yoloplanner
36-
env:
37-
GOOS: ${{ matrix.goos }}
38-
GOARCH: ${{ matrix.goarch }}
39-
CGO_ENABLED: '0'
40-
run: |
41-
cd yoloplanner
42-
go build -o yoloplanner${{ steps.ext.outputs.ext }} ./cmd
43-
44-
- name: Build sessionplayer
45-
env:
46-
GOOS: ${{ matrix.goos }}
47-
GOARCH: ${{ matrix.goarch }}
48-
CGO_ENABLED: '0'
49-
run: |
50-
cd tools/sessionplayer
51-
go build -o sessionplayer${{ steps.ext.outputs.ext }} ./cmd
52-
53-
- name: Create archive (Unix)
54-
if: matrix.goos != 'windows'
55-
run: |
56-
VERSION=${{ github.event.release.tag_name }}
57-
mkdir -p dist
58-
cp yoloplanner/yoloplanner dist/
59-
cp tools/sessionplayer/sessionplayer dist/
60-
tar -czvf claude-cli-tools-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz -C dist .
61-
62-
- name: Create archive (Windows)
63-
if: matrix.goos == 'windows'
64-
run: |
65-
VERSION=${{ github.event.release.tag_name }}
66-
mkdir -p dist
67-
cp yoloplanner/yoloplanner.exe dist/
68-
cp tools/sessionplayer/sessionplayer.exe dist/
69-
cd dist && zip ../claude-cli-tools-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.zip * && cd ..
70-
71-
- name: Upload release assets
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@v6
27+
with:
28+
distribution: goreleaser
29+
version: "~> v2"
30+
args: release --clean
7231
env:
73-
GH_TOKEN: ${{ github.token }}
74-
run: |
75-
VERSION=${{ github.event.release.tag_name }}
76-
if [ "${{ matrix.goos }}" = "windows" ]; then
77-
gh release upload ${VERSION} claude-cli-tools-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.zip
78-
else
79-
gh release upload ${VERSION} claude-cli-tools-${VERSION}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
80-
fi
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
version: 2
2+
3+
before:
4+
hooks:
5+
- go mod tidy -C yoloplanner
6+
- go mod tidy -C yoloswe
7+
- go mod tidy -C tools/sessionplayer
8+
9+
builds:
10+
- id: yoloplanner
11+
dir: yoloplanner
12+
main: ./cmd
13+
binary: yoloplanner
14+
env:
15+
- CGO_ENABLED=0
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
24+
- id: yoloswe
25+
dir: yoloswe
26+
main: ./cmd
27+
binary: yoloswe
28+
env:
29+
- CGO_ENABLED=0
30+
goos:
31+
- linux
32+
- darwin
33+
- windows
34+
goarch:
35+
- amd64
36+
- arm64
37+
38+
- id: sessionplayer
39+
dir: tools/sessionplayer
40+
main: ./cmd
41+
binary: sessionplayer
42+
env:
43+
- CGO_ENABLED=0
44+
goos:
45+
- linux
46+
- darwin
47+
- windows
48+
goarch:
49+
- amd64
50+
- arm64
51+
52+
archives:
53+
- id: default
54+
name_template: "claude-cli-tools-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
55+
formats:
56+
- tar.gz
57+
format_overrides:
58+
- goos: windows
59+
formats:
60+
- zip
61+
62+
checksum:
63+
name_template: "checksums.txt"
64+
65+
brews:
66+
- name: claude-cli-tools
67+
repository:
68+
owner: mzhaom
69+
name: claude-cli-protocol
70+
directory: Formula
71+
homepage: "https://github.com/mzhaom/claude-cli-protocol"
72+
description: "CLI tools for Claude Code protocol"
73+
license: "Apache-2.0"
74+
install: |
75+
bin.install "yoloplanner"
76+
bin.install "yoloswe"
77+
bin.install "sessionplayer"
78+
79+
release:
80+
github:
81+
owner: mzhaom
82+
name: claude-cli-protocol

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
Multi-language SDKs for the Claude CLI protocol, enabling programmatic interaction with Claude Code CLI.
44

5+
## Installation
6+
7+
### Homebrew (macOS/Linux)
8+
9+
```bash
10+
brew tap mzhaom/claude-cli-protocol
11+
brew install claude-cli-tools
12+
```
13+
14+
This installs:
15+
- `yoloplanner` - Multi-agent planning tool
16+
- `yoloswe` - Builder-reviewer loop for software engineering tasks
17+
- `sessionplayer` - Session replay tool
18+
19+
### From Source
20+
21+
```bash
22+
# Build individual tools
23+
cd yoloplanner && go build -o yoloplanner ./cmd
24+
cd yoloswe && go build -o yoloswe ./cmd
25+
cd tools/sessionplayer && go build -o sessionplayer ./cmd
26+
```
27+
28+
### GitHub Releases
29+
30+
Download pre-built binaries from the [Releases](https://github.com/mzhaom/claude-cli-protocol/releases) page.
31+
532
## Repository Structure
633

734
```

0 commit comments

Comments
 (0)