feat: update to use core tap for beads installation (#1261)
* feat: update to use core tap for beads installation Signed-off-by: Rui Chen <rui@chenrui.dev> * remove custom tap related code and refs Signed-off-by: Rui Chen <rui@chenrui.dev> --------- Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@@ -173,23 +173,3 @@ jobs:
|
||||
end
|
||||
EOF
|
||||
|
||||
- name: Push to homebrew-beads
|
||||
env:
|
||||
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$HOMEBREW_TAP_TOKEN" ]; then
|
||||
echo "::warning::HOMEBREW_TAP_TOKEN not set - skipping Homebrew update"
|
||||
echo "To enable automatic Homebrew updates:"
|
||||
echo "1. Create a Personal Access Token with 'repo' scope"
|
||||
echo "2. Add it as HOMEBREW_TAP_TOKEN in repository secrets"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/steveyegge/homebrew-beads.git" tap
|
||||
cp Formula/bd.rb tap/Formula/bd.rb
|
||||
cd tap
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add Formula/bd.rb
|
||||
git commit -m "Update bd to ${{ steps.release.outputs.version }}"
|
||||
git push
|
||||
|
||||
107
.github/workflows/update-homebrew.yml
vendored
107
.github/workflows/update-homebrew.yml
vendored
@@ -1,107 +0,0 @@
|
||||
name: Update Homebrew Formula
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Release tag (e.g., v0.22.0)'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-formula:
|
||||
# Guard: only run homebrew update in the canonical repository (not in forks)
|
||||
if: ${{ github.repository == 'steveyegge/beads' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout beads repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get release info
|
||||
id: release
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
else
|
||||
TAG="${GITHUB_REF#refs/tags/}"
|
||||
fi
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
echo "version=${TAG#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download checksums
|
||||
run: |
|
||||
curl -sL "https://github.com/steveyegge/beads/releases/download/${{ steps.release.outputs.tag }}/checksums.txt" -o checksums.txt
|
||||
|
||||
- name: Extract checksums
|
||||
id: checksums
|
||||
run: |
|
||||
echo "darwin_amd64=$(grep 'darwin_amd64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "darwin_arm64=$(grep 'darwin_arm64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "linux_amd64=$(grep 'linux_amd64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
echo "linux_arm64=$(grep 'linux_arm64.tar.gz' checksums.txt | awk '{print $1}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update Homebrew formula
|
||||
run: |
|
||||
cat > Formula/bd.rb <<'EOF'
|
||||
class Bd < Formula
|
||||
desc "AI-supervised issue tracker for coding workflows"
|
||||
homepage "https://github.com/steveyegge/beads"
|
||||
version "${{ steps.release.outputs.version }}"
|
||||
license "MIT"
|
||||
|
||||
on_macos do
|
||||
if Hardware::CPU.arm?
|
||||
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_darwin_arm64.tar.gz"
|
||||
sha256 "${{ steps.checksums.outputs.darwin_arm64 }}"
|
||||
else
|
||||
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_darwin_amd64.tar.gz"
|
||||
sha256 "${{ steps.checksums.outputs.darwin_amd64 }}"
|
||||
end
|
||||
end
|
||||
|
||||
on_linux do
|
||||
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
|
||||
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_linux_arm64.tar.gz"
|
||||
sha256 "${{ steps.checksums.outputs.linux_arm64 }}"
|
||||
else
|
||||
url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_linux_amd64.tar.gz"
|
||||
sha256 "${{ steps.checksums.outputs.linux_amd64 }}"
|
||||
end
|
||||
end
|
||||
|
||||
def install
|
||||
bin.install "bd"
|
||||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/bd", "version"
|
||||
end
|
||||
end
|
||||
EOF
|
||||
|
||||
- name: Push to homebrew-beads
|
||||
env:
|
||||
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
|
||||
run: |
|
||||
if [ -z "$HOMEBREW_TAP_TOKEN" ]; then
|
||||
echo "::warning::HOMEBREW_TAP_TOKEN not set - skipping Homebrew update"
|
||||
echo "To enable automatic Homebrew updates:"
|
||||
echo "1. Create a Personal Access Token with 'repo' scope"
|
||||
echo "2. Add it as HOMEBREW_TAP_TOKEN in repository secrets"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/steveyegge/homebrew-beads.git" tap
|
||||
cp Formula/bd.rb tap/Formula/bd.rb
|
||||
cd tap
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git add Formula/bd.rb
|
||||
git commit -m "Update bd to ${{ steps.release.outputs.version }}"
|
||||
git push
|
||||
@@ -205,7 +205,7 @@ release:
|
||||
|
||||
**Homebrew (macOS/Linux):**
|
||||
```bash
|
||||
brew install steveyegge/beads/bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Quick Install (macOS/Linux/FreeBSD):**
|
||||
@@ -221,22 +221,6 @@ release:
|
||||
**Manual Install:**
|
||||
Download the appropriate binary for your platform below, extract it, and place it in your PATH.
|
||||
|
||||
# Homebrew tap - disabled, handled by separate workflow
|
||||
# brews:
|
||||
# - name: bd
|
||||
# repository:
|
||||
# owner: steveyegge
|
||||
# name: homebrew-beads
|
||||
# branch: main
|
||||
# directory: Formula
|
||||
# homepage: https://github.com/steveyegge/beads
|
||||
# description: "AI-supervised issue tracker for coding workflows"
|
||||
# license: MIT
|
||||
# test: |
|
||||
# system "#{bin}/bd", "version"
|
||||
# install: |
|
||||
# bin.install "bd"
|
||||
|
||||
# Announce the release
|
||||
announce:
|
||||
skip: false
|
||||
|
||||
@@ -59,7 +59,7 @@ Beads supports hierarchical IDs for epics:
|
||||
## 📦 Installation
|
||||
|
||||
* **npm:** `npm install -g @beads/bd`
|
||||
* **Homebrew:** `brew install steveyegge/beads/bd`
|
||||
* **Homebrew:** `brew install beads`
|
||||
* **Go:** `go install github.com/steveyegge/beads/cmd/bd@latest`
|
||||
|
||||
**Requirements:** Linux, FreeBSD, macOS, or Windows.
|
||||
|
||||
53
RELEASING.md
53
RELEASING.md
@@ -38,7 +38,6 @@ A beads release involves multiple distribution channels:
|
||||
### Required Access
|
||||
|
||||
- GitHub: Write access to repository and ability to create releases
|
||||
- Homebrew: Write access to steveyegge/homebrew-beads
|
||||
- PyPI: Maintainer access to `beads-mcp` package
|
||||
- npm: Member of `@beads` organization
|
||||
|
||||
@@ -231,46 +230,18 @@ gh release create v0.22.0 \
|
||||
|
||||
## 3. Homebrew Update
|
||||
|
||||
Homebrew formula is in a separate tap repository.
|
||||
|
||||
### Automatic Update (If Configured)
|
||||
|
||||
If you have goreleaser configured with Homebrew:
|
||||
|
||||
```bash
|
||||
# Already done by goreleaser
|
||||
# Check Formula/bd.rb was updated automatically
|
||||
```
|
||||
|
||||
### Manual Update
|
||||
|
||||
```bash
|
||||
# Clone tap repository
|
||||
git clone https://github.com/steveyegge/homebrew-beads.git
|
||||
cd homebrew-beads
|
||||
|
||||
# Update formula
|
||||
# 1. Update version number
|
||||
# 2. Update SHA256 checksums for macOS binaries
|
||||
|
||||
# Test formula
|
||||
brew install --build-from-source ./Formula/bd.rb
|
||||
bd version # Should show 0.22.0
|
||||
|
||||
# Commit and push
|
||||
git add Formula/bd.rb
|
||||
git commit -m "Update bd to 0.22.0"
|
||||
git push
|
||||
```
|
||||
Homebrew formula is now in homebrew-core. Updates are handled automatically via GitHub Release artifacts.
|
||||
|
||||
### Verify Homebrew
|
||||
|
||||
After the GitHub Release is published, verify the Homebrew package:
|
||||
|
||||
```bash
|
||||
# Update tap
|
||||
# Update Homebrew
|
||||
brew update
|
||||
|
||||
# Install new version
|
||||
brew upgrade bd
|
||||
# Install/upgrade
|
||||
brew upgrade beads # or: brew install beads
|
||||
|
||||
# Verify
|
||||
bd version # Should show 0.22.0
|
||||
@@ -519,21 +490,13 @@ gh release edit v0.22.0 --prerelease
|
||||
|
||||
Follow hotfix procedure above to release 0.22.1.
|
||||
|
||||
### 3. Revert Homebrew (If Needed)
|
||||
|
||||
```bash
|
||||
cd homebrew-beads
|
||||
git revert HEAD
|
||||
git push
|
||||
```
|
||||
|
||||
### 4. Deprecate npm Package (If Needed)
|
||||
### 3. Deprecate npm Package (If Needed)
|
||||
|
||||
```bash
|
||||
npm deprecate @beads/bd@0.22.0 "Critical bug, please upgrade to 0.22.1"
|
||||
```
|
||||
|
||||
### 5. Yank PyPI Release (If Needed)
|
||||
### 4. Yank PyPI Release (If Needed)
|
||||
|
||||
```bash
|
||||
# Can't delete, but can yank (hide from pip install)
|
||||
|
||||
@@ -91,7 +91,7 @@ NEXT: Implement rate limiting"
|
||||
|
||||
## Requirements
|
||||
|
||||
- [bd CLI](https://github.com/steveyegge/beads) installed (`brew install steveyegge/beads/bd`)
|
||||
- [bd CLI](https://github.com/steveyegge/beads) installed (`brew install beads`)
|
||||
- A git repository (bd requires git for sync)
|
||||
- Initialized database (`bd init` in project root)
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ func CheckBdInPath() DoctorCheck {
|
||||
Message: "'bd' command not found in PATH",
|
||||
Detail: "Claude hooks execute 'bd prime' and won't work without bd in PATH",
|
||||
Fix: "Install bd globally:\n" +
|
||||
" • Homebrew: brew install steveyegge/tap/bd\n" +
|
||||
" • Homebrew: brew install beads\n" +
|
||||
" • Script: curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash\n" +
|
||||
" • Or add bd to your PATH",
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# Check if bd is available
|
||||
if ! command -v bd >/dev/null 2>&1; then
|
||||
echo "Warning: bd command not found in PATH, skipping post-merge hook" >&2
|
||||
echo " Install bd: brew install steveyegge/tap/bd" >&2
|
||||
echo " Install bd: brew install beads" >&2
|
||||
echo " Or add bd to your PATH" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# Check if bd is available
|
||||
if ! command -v bd >/dev/null 2>&1; then
|
||||
echo "Warning: bd command not found in PATH, skipping pre-commit hook" >&2
|
||||
echo " Install bd: brew install steveyegge/tap/bd" >&2
|
||||
echo " Install bd: brew install beads" >&2
|
||||
echo " Or add bd to your PATH" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# Check if bd is available
|
||||
if ! command -v bd >/dev/null 2>&1; then
|
||||
echo "Warning: bd command not found in PATH, skipping pre-push hook" >&2
|
||||
echo " Install bd: brew install steveyegge/tap/bd" >&2
|
||||
echo " Install bd: brew install beads" >&2
|
||||
echo " Or add bd to your PATH" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# Check if bd is available
|
||||
if ! command -v bd >/dev/null 2>&1; then
|
||||
echo "Warning: bd command not found in PATH, skipping prepare-commit-msg hook" >&2
|
||||
echo " Install bd: brew install steveyegge/tap/bd" >&2
|
||||
echo " Install bd: brew install beads" >&2
|
||||
echo " Or add bd to your PATH" >&2
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -33,8 +33,7 @@ Beads has several components - here's what they are and when you need them:
|
||||
### Homebrew (macOS/Linux)
|
||||
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Why Homebrew?**
|
||||
@@ -75,8 +74,7 @@ The installer will:
|
||||
|
||||
**Via Homebrew** (recommended):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Via go install**:
|
||||
@@ -96,8 +94,7 @@ sudo mv bd /usr/local/bin/
|
||||
|
||||
**Via Homebrew** (works on Linux too):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Arch Linux** (AUR):
|
||||
@@ -179,7 +176,7 @@ bd version
|
||||
|
||||
```bash
|
||||
# 1. Install bd CLI (see Quick Install above)
|
||||
brew install bd
|
||||
brew install beads
|
||||
|
||||
# 2. Initialize in your project
|
||||
cd your-project
|
||||
|
||||
@@ -131,78 +131,18 @@ TWINE_USERNAME=__token__ TWINE_PASSWORD=pypi-... uv tool run twine upload dist/*
|
||||
|
||||
See [integrations/beads-mcp/PYPI.md](../integrations/beads-mcp/PYPI.md) for detailed PyPI instructions.
|
||||
|
||||
### 3. Update Homebrew Formula
|
||||
### 3. Verify Homebrew Update
|
||||
|
||||
**CRITICAL**: This step must be done AFTER GitHub Actions completes the release build (~5 minutes after pushing the tag).
|
||||
The Homebrew formula is now in homebrew-core and updates automatically via GitHub Release artifacts.
|
||||
|
||||
**Why the wait?** The Homebrew formula uses GoReleaser artifacts (platform-specific binaries), not the source tarball. These are built by GitHub Actions.
|
||||
|
||||
**Step 1: Wait for GitHub Actions to complete**
|
||||
|
||||
Monitor the release workflow at: https://github.com/steveyegge/beads/actions
|
||||
|
||||
Once complete, the release appears at: https://github.com/steveyegge/beads/releases/tag/v0.9.X
|
||||
|
||||
**Step 2: Get SHA256s from release artifacts**
|
||||
|
||||
GoReleaser creates a `checksums.txt` file with all artifact hashes:
|
||||
|
||||
```bash
|
||||
# Download checksums file
|
||||
curl -sL https://github.com/steveyegge/beads/releases/download/v0.9.X/checksums.txt
|
||||
|
||||
# Extract the SHA256s you need:
|
||||
# - beads_0.9.X_darwin_arm64.tar.gz (macOS Apple Silicon)
|
||||
# - beads_0.9.X_darwin_amd64.tar.gz (macOS Intel)
|
||||
# - beads_0.9.X_linux_amd64.tar.gz (Linux x86_64)
|
||||
# - beads_0.9.X_linux_arm64.tar.gz (Linux ARM64)
|
||||
```
|
||||
|
||||
**Step 3: Update the formula**
|
||||
|
||||
```bash
|
||||
# Navigate to tap repo (if already cloned) or clone it
|
||||
cd /tmp/homebrew-beads || git clone https://github.com/steveyegge/homebrew-beads /tmp/homebrew-beads
|
||||
|
||||
# Pull latest changes
|
||||
cd /tmp/homebrew-beads
|
||||
git pull
|
||||
|
||||
# Edit Formula/bd.rb - update:
|
||||
# 1. version "0.9.X" (line 4)
|
||||
# 2. SHA256 for darwin_arm64 (line 10)
|
||||
# 3. SHA256 for darwin_amd64 (line 13)
|
||||
# 4. SHA256 for linux_amd64 (line 23)
|
||||
# 5. SHA256 for linux_arm64 (line 20) - optional, often empty
|
||||
|
||||
# Example:
|
||||
# version "0.23.0"
|
||||
# on_macos do
|
||||
# if Hardware::CPU.arm?
|
||||
# url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_darwin_arm64.tar.gz"
|
||||
# sha256 "abc123..."
|
||||
# else
|
||||
# url "https://github.com/steveyegge/beads/releases/download/v#{version}/beads_#{version}_darwin_amd64.tar.gz"
|
||||
# sha256 "def456..."
|
||||
|
||||
# Commit and push
|
||||
git add Formula/bd.rb
|
||||
git commit -m "Update bd formula to v0.9.X"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
**Step 4: CRITICAL - Verify the installation works**
|
||||
**Verify the installation works:**
|
||||
|
||||
```bash
|
||||
brew update
|
||||
brew upgrade bd # Or: brew reinstall bd
|
||||
bd version # MUST show v0.9.X - if not, the release is incomplete!
|
||||
brew upgrade beads # Or: brew install beads
|
||||
bd version # Should show v0.9.X
|
||||
```
|
||||
|
||||
**⚠️ DO NOT SKIP THE VERIFICATION STEP ABOVE** - This ensures users can actually install the new version.
|
||||
|
||||
**Note**: Until this step is complete, users with Homebrew-installed bd will still have the old version.
|
||||
|
||||
**Note:** If you have an old bd binary from `go install` in your PATH, remove it to avoid conflicts:
|
||||
```bash
|
||||
# Find where bd is installed
|
||||
|
||||
@@ -47,7 +47,7 @@ This master script automates the **entire release process**:
|
||||
- All changes committed
|
||||
- golangci-lint installed
|
||||
- Homebrew installed (for local upgrade)
|
||||
- Push access to steveyegge/beads and steveyegge/homebrew-beads
|
||||
- Push access to steveyegge/beads
|
||||
|
||||
### Output
|
||||
|
||||
@@ -128,65 +128,6 @@ Previously, version bumps only updated `cmd/bd/version.go`, leaving other compon
|
||||
|
||||
---
|
||||
|
||||
## update-homebrew.sh
|
||||
|
||||
Automatically updates the Homebrew formula with GoReleaser release artifacts.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
# Update formula after pushing git tag
|
||||
./scripts/update-homebrew.sh 0.9.3
|
||||
|
||||
# Use custom tap directory
|
||||
TAP_DIR=~/homebrew-beads ./scripts/update-homebrew.sh 0.9.3
|
||||
```
|
||||
|
||||
### What It Does
|
||||
|
||||
This script automates the Homebrew formula update process:
|
||||
|
||||
1. **Waits** for GitHub Actions release build (~5 minutes, checks every 30s)
|
||||
2. **Downloads** checksums.txt from the GitHub release
|
||||
3. **Extracts** SHA256s for all platform-specific binaries:
|
||||
- macOS ARM64 (Apple Silicon)
|
||||
- macOS AMD64 (Intel)
|
||||
- Linux AMD64
|
||||
- Linux ARM64
|
||||
4. **Clones/updates** the homebrew-beads tap repository
|
||||
5. **Updates** Formula/bd.rb with new version and all SHA256s
|
||||
6. **Commits and pushes** the changes
|
||||
|
||||
### Important Notes
|
||||
|
||||
- **Run AFTER pushing the git tag** - the script waits for GitHub Actions to finish
|
||||
- **Uses GoReleaser artifacts**, not source tarballs (fixed in v0.23.0)
|
||||
- **Automatically waits** up to 7.5 minutes for release build to complete
|
||||
- **Updates all platforms** in a single operation
|
||||
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
# Standard usage (after git tag push)
|
||||
git tag v0.9.3 && git push origin v0.9.3
|
||||
./scripts/update-homebrew.sh 0.9.3
|
||||
|
||||
# Custom tap directory
|
||||
TAP_DIR=/path/to/homebrew-beads ./scripts/update-homebrew.sh 0.9.3
|
||||
```
|
||||
|
||||
### Why This Script Exists
|
||||
|
||||
Previously, the Homebrew formula update was manual and error-prone:
|
||||
- Used source tarball SHA256 instead of GoReleaser artifacts (wrong!)
|
||||
- Required manually computing 4 separate SHA256s
|
||||
- Easy to forget updating all platforms
|
||||
- No automation for waiting on GitHub Actions
|
||||
|
||||
This script fixes all those issues and is now used by `release.sh`.
|
||||
|
||||
---
|
||||
|
||||
## sign-windows.sh
|
||||
|
||||
Signs Windows executables with an Authenticode certificate using osslsigncode.
|
||||
|
||||
@@ -24,11 +24,10 @@ This script performs the complete release workflow:
|
||||
1. Kill running daemons
|
||||
2. Run tests and linting
|
||||
3. Bump version in all files
|
||||
4. Commit and push version bump
|
||||
5. Create and push git tag
|
||||
6. Update Homebrew formula
|
||||
4. Rebuild local binary
|
||||
5. Push version bump to GitHub
|
||||
6. Create and push git tag
|
||||
7. Upgrade local brew installation
|
||||
8. Verify everything is working
|
||||
|
||||
Examples:
|
||||
$0 0.9.3 # Full release
|
||||
@@ -75,7 +74,7 @@ echo -e "${BLUE}╔════════════════════
|
||||
echo ""
|
||||
|
||||
# Step 1: Kill daemons
|
||||
echo -e "${YELLOW}Step 1/8: Killing running daemons...${NC}"
|
||||
echo -e "${YELLOW}Step 1/7: Killing running daemons...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: pkill -f 'bd.*daemon'"
|
||||
else
|
||||
@@ -90,7 +89,7 @@ fi
|
||||
echo -e "${GREEN}✓ All daemons stopped${NC}\n"
|
||||
|
||||
# Step 2: Run tests
|
||||
echo -e "${YELLOW}Step 2/8: Running tests and linting...${NC}"
|
||||
echo -e "${YELLOW}Step 2/7: Running tests and linting...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: TMPDIR=/tmp go test ./..."
|
||||
echo "[DRY RUN] Would run: golangci-lint run ./..."
|
||||
@@ -106,7 +105,7 @@ fi
|
||||
echo -e "${GREEN}✓ Tests passed${NC}\n"
|
||||
|
||||
# Step 3: Bump version
|
||||
echo -e "${YELLOW}Step 3/8: Bumping version to ${VERSION}...${NC}"
|
||||
echo -e "${YELLOW}Step 3/7: Bumping version to ${VERSION}...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: $SCRIPT_DIR/bump-version.sh $VERSION --commit"
|
||||
$SCRIPT_DIR/bump-version.sh "$VERSION" 2>/dev/null || true
|
||||
@@ -119,7 +118,7 @@ fi
|
||||
echo -e "${GREEN}✓ Version bumped and committed${NC}\n"
|
||||
|
||||
# Step 4: Rebuild local binary
|
||||
echo -e "${YELLOW}Step 4/8: Rebuilding local binary...${NC}"
|
||||
echo -e "${YELLOW}Step 4/7: Rebuilding local binary...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: go build -o bd ./cmd/bd"
|
||||
else
|
||||
@@ -133,7 +132,7 @@ fi
|
||||
echo -e "${GREEN}✓ Binary rebuilt${NC}\n"
|
||||
|
||||
# Step 5: Push version bump
|
||||
echo -e "${YELLOW}Step 5/8: Pushing version bump to GitHub...${NC}"
|
||||
echo -e "${YELLOW}Step 5/7: Pushing version bump to GitHub...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: git push origin main"
|
||||
else
|
||||
@@ -145,7 +144,7 @@ fi
|
||||
echo -e "${GREEN}✓ Version bump pushed${NC}\n"
|
||||
|
||||
# Step 6: Create and push tag
|
||||
echo -e "${YELLOW}Step 6/8: Creating and pushing git tag v${VERSION}...${NC}"
|
||||
echo -e "${YELLOW}Step 6/7: Creating and pushing git tag v${VERSION}...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: git tag v${VERSION}"
|
||||
echo "[DRY RUN] Would run: git push origin v${VERSION}"
|
||||
@@ -163,35 +162,20 @@ else
|
||||
fi
|
||||
echo -e "${GREEN}✓ Tag v${VERSION} pushed${NC}\n"
|
||||
|
||||
# Note: update-homebrew.sh now handles waiting for GitHub Actions (~5 minutes)
|
||||
# No need to wait here anymore
|
||||
|
||||
# Step 7: Update Homebrew formula
|
||||
echo -e "${YELLOW}Step 7/8: Updating Homebrew formula...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: $SCRIPT_DIR/update-homebrew.sh ${VERSION}"
|
||||
else
|
||||
if ! $SCRIPT_DIR/update-homebrew.sh "$VERSION"; then
|
||||
echo -e "${RED}✗ Homebrew update failed${NC}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo -e "${GREEN}✓ Homebrew formula updated${NC}\n"
|
||||
|
||||
# Step 8: Upgrade local installation
|
||||
echo -e "${YELLOW}Step 8/8: Upgrading local Homebrew installation...${NC}"
|
||||
# Step 7: Upgrade local installation
|
||||
echo -e "${YELLOW}Step 7/7: Upgrading local Homebrew installation...${NC}"
|
||||
if [ "$DRY_RUN" = true ]; then
|
||||
echo "[DRY RUN] Would run: brew update"
|
||||
echo "[DRY RUN] Would run: brew upgrade bd"
|
||||
echo "[DRY RUN] Would run: brew upgrade beads"
|
||||
else
|
||||
brew update
|
||||
|
||||
# Check if bd is installed via brew
|
||||
if brew list bd >/dev/null 2>&1; then
|
||||
brew upgrade bd || brew reinstall bd
|
||||
# Check if beads is installed via brew
|
||||
if brew list beads >/dev/null 2>&1; then
|
||||
brew upgrade beads || brew reinstall beads
|
||||
else
|
||||
echo -e "${YELLOW}⚠ bd not installed via Homebrew, skipping upgrade${NC}"
|
||||
echo "To install: brew install steveyegge/beads/bd"
|
||||
echo "To install: brew install beads"
|
||||
fi
|
||||
fi
|
||||
echo -e "${GREEN}✓ Local installation upgraded${NC}\n"
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Configuration
|
||||
TAP_REPO="https://github.com/steveyegge/homebrew-beads"
|
||||
TAP_DIR="${TAP_DIR:-/tmp/homebrew-beads}"
|
||||
FORMULA_FILE="Formula/bd.rb"
|
||||
|
||||
usage() {
|
||||
cat << EOF
|
||||
Usage: $0 <version>
|
||||
|
||||
Automate Homebrew formula update for beads release.
|
||||
|
||||
Arguments:
|
||||
version Version number (e.g., 0.9.3 or v0.9.3)
|
||||
|
||||
Environment Variables:
|
||||
TAP_DIR Directory for homebrew-beads repo (default: /tmp/homebrew-beads)
|
||||
|
||||
Examples:
|
||||
$0 0.9.3
|
||||
TAP_DIR=~/homebrew-beads $0 v0.9.3
|
||||
|
||||
This script:
|
||||
1. Waits for GitHub Actions release build to complete (~5 minutes)
|
||||
2. Fetches checksums for all platform-specific release artifacts
|
||||
3. Clones/updates the homebrew-beads tap repository
|
||||
4. Updates the formula with new version and all platform SHA256s
|
||||
5. Commits and pushes the changes
|
||||
|
||||
IMPORTANT: Run this AFTER pushing the git tag to GitHub.
|
||||
The script will automatically wait for GitHub Actions to finish building.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse arguments
|
||||
if [ $# -ne 1 ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
VERSION="$1"
|
||||
# Strip 'v' prefix if present
|
||||
VERSION="${VERSION#v}"
|
||||
|
||||
echo -e "${GREEN}=== Homebrew Formula Update for beads v${VERSION} ===${NC}\n"
|
||||
|
||||
# Step 1: Wait for GitHub Actions and fetch release checksums
|
||||
echo -e "${YELLOW}Step 1: Waiting for GitHub Actions release to complete...${NC}"
|
||||
echo "This typically takes ~5 minutes. Checking every 30 seconds..."
|
||||
echo ""
|
||||
|
||||
CHECKSUMS_URL="https://github.com/steveyegge/beads/releases/download/v${VERSION}/checksums.txt"
|
||||
MAX_RETRIES=15 # 15 attempts * 30s = 7.5 minutes max wait
|
||||
RETRY_DELAY=30
|
||||
CHECKSUMS=""
|
||||
|
||||
for i in $(seq 1 $MAX_RETRIES); do
|
||||
echo -n "Attempt $i/$MAX_RETRIES: Checking for release artifacts... "
|
||||
|
||||
if CHECKSUMS=$(curl -sL "$CHECKSUMS_URL" 2>/dev/null); then
|
||||
if echo "$CHECKSUMS" | grep -q "darwin_arm64"; then
|
||||
echo -e "${GREEN}✓ Found!${NC}"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $i -lt $MAX_RETRIES ]; then
|
||||
echo -e "${YELLOW}Not ready yet, waiting ${RETRY_DELAY}s...${NC}"
|
||||
sleep $RETRY_DELAY
|
||||
else
|
||||
echo -e "${RED}✗ Failed to fetch checksums after waiting $(($MAX_RETRIES * $RETRY_DELAY))s${NC}"
|
||||
echo ""
|
||||
echo "Possible issues:"
|
||||
echo " • GitHub Actions release workflow is still running"
|
||||
echo " • Git tag was not pushed: git push origin v${VERSION}"
|
||||
echo " • Release workflow failed (check: https://github.com/steveyegge/beads/actions)"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo -e "${GREEN}✓ Release artifacts ready${NC}"
|
||||
echo ""
|
||||
echo -e "${YELLOW}Extracting platform SHA256s...${NC}"
|
||||
|
||||
# Extract SHA256s for each platform
|
||||
SHA256_DARWIN_ARM64=$(echo "$CHECKSUMS" | grep "darwin_arm64.tar.gz" | cut -d' ' -f1)
|
||||
SHA256_DARWIN_AMD64=$(echo "$CHECKSUMS" | grep "darwin_amd64.tar.gz" | cut -d' ' -f1)
|
||||
SHA256_LINUX_AMD64=$(echo "$CHECKSUMS" | grep "linux_amd64.tar.gz" | cut -d' ' -f1)
|
||||
SHA256_LINUX_ARM64=$(echo "$CHECKSUMS" | grep "linux_arm64.tar.gz" | cut -d' ' -f1)
|
||||
|
||||
# Validate we got all required checksums
|
||||
if [ -z "$SHA256_DARWIN_ARM64" ] || [ -z "$SHA256_DARWIN_AMD64" ] || [ -z "$SHA256_LINUX_AMD64" ]; then
|
||||
echo -e "${RED}✗ Failed to extract all required SHA256s${NC}"
|
||||
echo "darwin_arm64: $SHA256_DARWIN_ARM64"
|
||||
echo "darwin_amd64: $SHA256_DARWIN_AMD64"
|
||||
echo "linux_amd64: $SHA256_LINUX_AMD64"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo " darwin_arm64: $SHA256_DARWIN_ARM64"
|
||||
echo " darwin_amd64: $SHA256_DARWIN_AMD64"
|
||||
echo " linux_amd64: $SHA256_LINUX_AMD64"
|
||||
if [ -n "$SHA256_LINUX_ARM64" ]; then
|
||||
echo " linux_arm64: $SHA256_LINUX_ARM64"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Step 2: Clone/update tap repository
|
||||
echo -e "${YELLOW}Step 2: Preparing tap repository...${NC}"
|
||||
if [ -d "$TAP_DIR" ]; then
|
||||
echo "Updating existing repository at $TAP_DIR"
|
||||
cd "$TAP_DIR"
|
||||
git fetch origin
|
||||
git reset --hard origin/main
|
||||
else
|
||||
echo "Cloning repository to $TAP_DIR"
|
||||
git clone "$TAP_REPO" "$TAP_DIR"
|
||||
cd "$TAP_DIR"
|
||||
fi
|
||||
echo -e "${GREEN}✓ Repository ready${NC}\n"
|
||||
|
||||
# Step 3: Update formula
|
||||
echo -e "${YELLOW}Step 3: Updating formula...${NC}"
|
||||
if [ ! -f "$FORMULA_FILE" ]; then
|
||||
echo -e "${RED}✗ Formula file not found: $FORMULA_FILE${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create backup
|
||||
cp "$FORMULA_FILE" "${FORMULA_FILE}.bak"
|
||||
|
||||
# Update version number (line 4)
|
||||
sed -i.tmp "s/version \"[0-9.]*\"/version \"${VERSION}\"/" "$FORMULA_FILE"
|
||||
|
||||
# Update SHA256s - need to handle the multi-platform structure
|
||||
# We'll use awk for more precise control since the formula has multiple sha256 lines
|
||||
|
||||
# Use awk to update SHA256 values while preserving all structure
|
||||
# Track which platform section we're in, then replace sha256 lines accordingly
|
||||
awk -v sha_darwin_arm64="$SHA256_DARWIN_ARM64" \
|
||||
-v sha_darwin_amd64="$SHA256_DARWIN_AMD64" \
|
||||
-v sha_linux_amd64="$SHA256_LINUX_AMD64" \
|
||||
-v sha_linux_arm64="$SHA256_LINUX_ARM64" '
|
||||
BEGIN { in_macos=0; in_linux=0; in_arm=0 }
|
||||
/on_macos do/ { in_macos=1; in_linux=0; in_arm=0 }
|
||||
/on_linux do/ { in_linux=1; in_macos=0; in_arm=0 }
|
||||
/if Hardware::CPU.arm/ { in_arm=1 }
|
||||
/else/ { in_arm=0 }
|
||||
/^[[:space:]]*end/ {
|
||||
if (in_arm) { in_arm=0 }
|
||||
else { in_macos=0; in_linux=0 }
|
||||
}
|
||||
/sha256/ {
|
||||
if (in_macos && in_arm) { sub(/"[a-f0-9]+"/, "\"" sha_darwin_arm64 "\"") }
|
||||
else if (in_macos && !in_arm) { sub(/"[a-f0-9]+"/, "\"" sha_darwin_amd64 "\"") }
|
||||
else if (in_linux && in_arm) { sub(/"[a-f0-9]+"/, "\"" sha_linux_arm64 "\"") }
|
||||
else if (in_linux && !in_arm) { sub(/"[a-f0-9]+"/, "\"" sha_linux_amd64 "\"") }
|
||||
}
|
||||
{ print }
|
||||
' "$FORMULA_FILE" > "${FORMULA_FILE}.new"
|
||||
|
||||
mv "${FORMULA_FILE}.new" "$FORMULA_FILE"
|
||||
rm -f "${FORMULA_FILE}.tmp"
|
||||
|
||||
# Show diff
|
||||
echo "Changes to $FORMULA_FILE:"
|
||||
git diff "$FORMULA_FILE" || true
|
||||
echo -e "${GREEN}✓ Formula updated${NC}\n"
|
||||
|
||||
# Step 4: Commit and push
|
||||
echo -e "${YELLOW}Step 4: Committing changes...${NC}"
|
||||
git add "$FORMULA_FILE"
|
||||
|
||||
if git diff --staged --quiet; then
|
||||
echo -e "${YELLOW}⚠ No changes detected - formula might already be up to date${NC}"
|
||||
rm -f "${FORMULA_FILE}.bak"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git commit -m "Update bd formula to v${VERSION}"
|
||||
echo -e "${GREEN}✓ Changes committed${NC}\n"
|
||||
|
||||
echo -e "${YELLOW}Step 5: Pushing to GitHub...${NC}"
|
||||
if git push origin main; then
|
||||
echo -e "${GREEN}✓ Formula pushed successfully${NC}\n"
|
||||
rm -f "${FORMULA_FILE}.bak"
|
||||
else
|
||||
echo -e "${RED}✗ Failed to push changes${NC}"
|
||||
echo "Restoring backup..."
|
||||
mv "${FORMULA_FILE}.bak" "$FORMULA_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Success message
|
||||
echo -e "${GREEN}=== Homebrew Formula Update Complete ===${NC}\n"
|
||||
echo "Next steps:"
|
||||
echo " 1. Verify the formula update at: https://github.com/steveyegge/homebrew-beads"
|
||||
echo " 2. Test locally:"
|
||||
echo " brew update"
|
||||
echo " brew upgrade bd"
|
||||
echo " bd version # Should show v${VERSION}"
|
||||
echo ""
|
||||
echo -e "${GREEN}Done!${NC}"
|
||||
@@ -13,8 +13,7 @@ Complete installation guide for all platforms.
|
||||
### Homebrew (macOS/Linux)
|
||||
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Why Homebrew?**
|
||||
@@ -41,8 +40,7 @@ The installer will:
|
||||
|
||||
**Via Homebrew** (recommended):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Via go install**:
|
||||
@@ -62,8 +60,7 @@ sudo mv bd /usr/local/bin/
|
||||
|
||||
**Via Homebrew** (works on Linux too):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Arch Linux** (AUR):
|
||||
@@ -117,7 +114,7 @@ The recommended approach for Claude Code, Cursor, Windsurf, and other editors wi
|
||||
|
||||
```bash
|
||||
# 1. Install bd CLI (see Quick Install above)
|
||||
brew install bd
|
||||
brew install beads
|
||||
|
||||
# 2. Initialize in your project
|
||||
cd your-project
|
||||
|
||||
@@ -23,8 +23,7 @@ Traditional issue trackers (Jira, GitHub Issues) weren't designed for AI agents.
|
||||
|
||||
```bash
|
||||
# Install via Homebrew (macOS/Linux)
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
|
||||
# Or quick install (macOS/Linux/FreeBSD)
|
||||
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
||||
|
||||
@@ -27,8 +27,7 @@ Traditional issue trackers (Jira, GitHub Issues) weren't designed for AI agents.
|
||||
|
||||
```bash
|
||||
# Install via Homebrew (macOS/Linux)
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
|
||||
# Or quick install (macOS/Linux/FreeBSD)
|
||||
curl -fsSL https://raw.githubusercontent.com/steveyegge/beads/main/scripts/install.sh | bash
|
||||
@@ -263,8 +262,7 @@ Complete installation guide for all platforms.
|
||||
### Homebrew (macOS/Linux)
|
||||
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Why Homebrew?**
|
||||
@@ -291,8 +289,7 @@ The installer will:
|
||||
|
||||
**Via Homebrew** (recommended):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Via go install**:
|
||||
@@ -312,8 +309,7 @@ sudo mv bd /usr/local/bin/
|
||||
|
||||
**Via Homebrew** (works on Linux too):
|
||||
```bash
|
||||
brew tap steveyegge/beads
|
||||
brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
**Arch Linux** (AUR):
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
Install:
|
||||
```bash
|
||||
brew tap steveyegge/beads && brew install bd
|
||||
brew install beads
|
||||
```
|
||||
|
||||
Initialize:
|
||||
|
||||
Reference in New Issue
Block a user