-
Notifications
You must be signed in to change notification settings - Fork 13
99 lines (77 loc) · 2.44 KB
/
Copy pathrelease.yml
File metadata and controls
99 lines (77 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
- name: Run tests
run: go test -v ./...
- name: Build binaries
run: |
mkdir -p build
# Build for multiple platforms
platforms=("linux/amd64" "linux/arm64" "darwin/amd64" "darwin/arm64" "windows/amd64")
for platform in "${platforms[@]}"; do
IFS='/' read -r goos goarch <<< "$platform"
output="build/ccr-${goos}-${goarch}"
if [ "$goos" = "windows" ]; then
output="${output}.exe"
fi
echo "Building for $goos/$goarch..."
GOOS="$goos" GOARCH="$goarch" go build \
-ldflags="-s -w -X 'github.com/Davincible/claude-code-router-go/cmd.Version=${GITHUB_REF#refs/tags/}'" \
-o "$output" \
.
done
- name: Generate checksums
run: |
cd build
sha256sum * > checksums.txt
cat checksums.txt
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: |
build/*
body: |
## Claude Code Router ${{ github.ref_name }}
### Installation
Download the appropriate binary for your platform and add it to your PATH.
### Linux/macOS
```bash
# Download and install (replace with your platform)
wget https://github.com/Davincible/claude-code-router-go/releases/download/${{ github.ref_name }}/ccr-linux-amd64
chmod +x ccr-linux-amd64
sudo mv ccr-linux-amd64 /usr/local/bin/ccr
```
### Windows
```powershell
# Download ccr-windows-amd64.exe and add to PATH
```
### Quick Start
```bash
# Initialize configuration
ccr config init
# Start the router
ccr start
# Use with Claude Code
ccr code
```
### Checksums
Verify your download with the checksums in `checksums.txt`.
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}