-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (86 loc) · 3.17 KB
/
Copy pathpublish-homebrew.yml
File metadata and controls
99 lines (86 loc) · 3.17 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: Publish to Homebrew
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
publish-homebrew:
runs-on: ubuntu-latest
if: |
github.event_name != 'pull_request'
steps:
- name: Set version info
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
TARBALL_URL="https://github.com/zero8dotdev/warp-cli/archive/refs/tags/${VERSION}.tar.gz"
else
VERSION="main"
TARBALL_URL="https://github.com/zero8dotdev/warp-cli/archive/refs/heads/main.tar.gz"
fi
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "TARBALL_URL=$TARBALL_URL" >> $GITHUB_ENV
- name: Checkout warp-cli
uses: actions/checkout@v4
with:
repository: zero8dotdev/warp-cli
ref: ${{ env.VERSION == 'main' && 'main' || github.event.release.tag_name }}
- name: Download release tarball
run: |
curl -L "${{ env.TARBALL_URL }}" -o warp.tar.gz
SHA256=$(shasum -a 256 warp.tar.gz | cut -d' ' -f1)
echo "SHA256=$SHA256" >> $GITHUB_ENV
- name: Checkout homebrew-tools
uses: actions/checkout@v4
with:
repository: zero8dotdev/homebrew-tools
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
path: homebrew-tools
- name: Update formula
run: |
cat > homebrew-tools/Formula/warp-cli.rb << 'EOF'
class Warp < Formula
desc "Beautiful CLI for Cloudflare WARP - Control your VPN from the terminal"
homepage "https://github.com/zero8dotdev/warp-cli"
url "${{ env.TARBALL_URL }}"
sha256 "${{ env.SHA256 }}"
license "MIT"
head "https://github.com/zero8dotdev/warp-cli.git", branch: "main"
depends_on "rust" => :build
def install
system "cargo", "build", "--release"
bin.install "target/release/warp"
end
def caveats
<<~EOS
Cloudflare WARP app must be installed first:
brew install --cask cloudflare-warp
Or download from: https://apps.apple.com/app/cloudflare-warp/id1423210915
EOS
end
test do
assert_match "warp", shell_output("#{bin}/warp --version")
assert_match "Commands:", shell_output("#{bin}/warp --help")
end
end
EOF
- name: Commit and push
working-directory: homebrew-tools
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add Formula/warp-cli.rb
git commit -m "chore: bump warp to ${{ env.VERSION }}"
git push
- name: Verify formula updated
run: |
if [ -f "homebrew-tools/Formula/warp-cli.rb" ]; then
echo "✅ Formula successfully updated in homebrew-tools tap"
grep -A2 "url " homebrew-tools/Formula/warp-cli.rb | head -3
else
echo "❌ Formula file not found"
exit 1
fi