docs: add comprehensive PROJECT_STORY explaining the journey and lear… #8
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.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.rb | |
| git commit -m "chore: bump warp to ${{ env.VERSION }}" | |
| git push | |
| - name: Verify formula updated | |
| run: | | |
| if [ -f "homebrew-tools/Formula/warp.rb" ]; then | |
| echo "✅ Formula successfully updated in homebrew-tools tap" | |
| grep -A2 "url " homebrew-tools/Formula/warp.rb | head -3 | |
| else | |
| echo "❌ Formula file not found" | |
| exit 1 | |
| fi |