fix: increase delay for IP detection to reflect connection state changes #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 WarpCli < 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 }}" | |
| version "0.1.0" | |
| 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 | |
| daemon_installed = system("launchctl list | grep -q com.cloudflare.warp.daemon") | |
| gui_installed = File.exist?("/Applications/Cloudflare WARP.app") | |
| message = "" | |
| message += "✅ warp-cli installed!\n\n" | |
| message += "📊 Installation Summary:\n" | |
| message += " • Binary: warp\n" | |
| message += " • Location: #{bin}/warp\n" | |
| message += " • Size: ~4.4MB\n\n" | |
| if !daemon_installed | |
| message += "⚠️ WARP daemon not detected.\n" | |
| message += "Install it with:\n" | |
| message += " brew install --cask cloudflare-warp\n\n" | |
| else | |
| message += "✅ WARP daemon is running\n\n" | |
| end | |
| if gui_installed | |
| message += "💡 GUI app detected at /Applications/Cloudflare WARP.app\n" | |
| message += " (Not needed - this CLI doesn't use it)\n\n" | |
| end | |
| message += "🚀 Quick start:\n" | |
| message += " warp up # Connect to WARP\n" | |
| message += " warp status # Check connection + IP\n" | |
| message += " warp --help # See all commands\n\n" | |
| message += "📖 Learn more: https://github.com/zero8dotdev/warp-cli" | |
| message | |
| 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 |