Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/update-homebrew-formula.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Update Homebrew Formula

on:
release:
types: [published]

jobs:
update-formula:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Checkout Homebrew tap
uses: actions/checkout@v4
with:
repository: kelos-dev/homebrew-tap
token: ${{ secrets.TAP_GITHUB_TOKEN }}
path: homebrew-tap

- name: Copy formula template to tap repo
run: cp Formula/kelos.rb homebrew-tap/Formula/kelos.rb

- name: Update Homebrew formula
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.event.release.tag_name }}
run: bash hack/update-homebrew-formula.sh "$TAG_NAME" homebrew-tap

- name: Commit and push Homebrew formula update
working-directory: homebrew-tap
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: |
git config user.name "kelos-dev[bot]"
git config user.email "kelos-dev@users.noreply.github.com"
git add Formula/kelos.rb
git commit -m "chore: update Homebrew formula for ${TAG_NAME}" || true
git push
40 changes: 40 additions & 0 deletions Formula/kelos.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
class Kelos < Formula
desc "Orchestrate autonomous AI coding agents on Kubernetes"
homepage "https://github.com/kelos-dev/kelos"
license "Apache-2.0"

version "VERSION_PLACEHOLDER"

on_macos do
on_intel do
url "https://github.com/kelos-dev/kelos/releases/download/v#{version}/kelos-darwin-amd64"
sha256 "SHA256_MACOS_AMD64_PLACEHOLDER"
end
on_arm do
url "https://github.com/kelos-dev/kelos/releases/download/v#{version}/kelos-darwin-arm64"
sha256 "SHA256_MACOS_ARM64_PLACEHOLDER"
end
end

on_linux do
on_intel do
url "https://github.com/kelos-dev/kelos/releases/download/v#{version}/kelos-linux-amd64"
sha256 "SHA256_LINUX_AMD64_PLACEHOLDER"
end
on_arm do
url "https://github.com/kelos-dev/kelos/releases/download/v#{version}/kelos-linux-arm64"
sha256 "SHA256_LINUX_ARM64_PLACEHOLDER"
end
end

def install
# Homebrew downloads the binary with the URL's filename,
# so we just rename it and install
bin.install Dir.glob("kelos-*").first => "kelos"
end

test do
output = shell_output("#{bin}/kelos version")
assert_match(/\d+\.\d+\.\d+/, output)
end
end
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ This creates a single-node cluster and configures your kubeconfig automatically.
### 1. Install the CLI

```bash
# Install using the script
curl -fsSL https://raw.githubusercontent.com/kelos-dev/kelos/main/hack/install.sh | bash

# Or by using Homebrew
brew tap kelos-dev/tap
brew install kelos
```

<details>
Expand Down
66 changes: 66 additions & 0 deletions hack/update-homebrew-formula.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash

# Script to update the Homebrew formula with checksums from a GitHub release
# Usage: ./hack/update-homebrew-formula.sh v1.2.3 [/path/to/tap-repo]

set -euo pipefail

if [[ $# -lt 1 ]]; then
echo "Usage: $0 <version> [tap-repo-path]" >&2
exit 1
fi

VERSION="$1"
TAP_DIR="${2:-.}"
REPO="kelos-dev/kelos"
CHECKSUMS_FILE="/tmp/checksums.txt"

trap 'rm -f /tmp/checksums.txt' EXIT

echo "Fetching checksums for ${VERSION}..."

# Download checksums
gh release download "${VERSION}" \
--repo "${REPO}" \
--pattern "checksums.txt" \
--dir /tmp

# Parse checksums
declare -A SHAS
while IFS= read -r line; do
sha=$(echo "$line" | awk '{print $1}')
filename=$(echo "$line" | awk '{print $2}')

# Extract arch from filename (e.g., kelos-linux-amd64 -> linux-amd64)
arch="${filename#kelos-}"

SHAS["$arch"]="$sha"
done <"$CHECKSUMS_FILE"

# Verify we have all required checksums
required_archs=("darwin-amd64" "darwin-arm64" "linux-amd64" "linux-arm64")
for arch in "${required_archs[@]}"; do
if [[ -z "${SHAS["$arch"]:-}" ]]; then
echo "Error: Missing checksum for $arch" >&2
exit 1
fi
done

# Update formula
FORMULA_FILE="${TAP_DIR}/Formula/kelos.rb"

# Strip leading 'v' so Homebrew gets a bare version number (e.g., 1.2.3 not v1.2.3)
BARE_VERSION="${VERSION#v}"
# Note: sed -i without a backup suffix requires GNU sed. This script is intended to run
# in CI on Ubuntu. On macOS, use `sed -i '' ...` or install gnu-sed via Homebrew.
sed -i "s/version \"VERSION_PLACEHOLDER\"/version \"${BARE_VERSION}\"/" "$FORMULA_FILE"
sed -i "s/sha256 \"SHA256_MACOS_AMD64_PLACEHOLDER\"/sha256 \"${SHAS["darwin-amd64"]}\"/" "$FORMULA_FILE"
sed -i "s/sha256 \"SHA256_MACOS_ARM64_PLACEHOLDER\"/sha256 \"${SHAS["darwin-arm64"]}\"/" "$FORMULA_FILE"
sed -i "s/sha256 \"SHA256_LINUX_AMD64_PLACEHOLDER\"/sha256 \"${SHAS["linux-amd64"]}\"/" "$FORMULA_FILE"
sed -i "s/sha256 \"SHA256_LINUX_ARM64_PLACEHOLDER\"/sha256 \"${SHAS["linux-arm64"]}\"/" "$FORMULA_FILE"

echo "✓ Updated $FORMULA_FILE with version $VERSION"
echo " Checksums:"
for arch in "${required_archs[@]}"; do
echo " $arch: ${SHAS["$arch"]}"
done
Loading