From 7a7e98b55bada0189aa203537b64c65d7cb0aecb Mon Sep 17 00:00:00 2001 From: Michael Ramos Date: Mon, 5 Jan 2026 09:06:57 -0800 Subject: [PATCH] Add Linux ARM64 binary to release workflow --- .github/workflows/release.yml | 4 ++ scripts/analyze-stargazers.sh | 78 +++++++++++++++++++++++++++++++ tests/manual/local/test-binary.sh | 56 ++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 scripts/analyze-stargazers.sh create mode 100755 tests/manual/local/test-binary.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db95b393..6778190a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,6 +39,10 @@ jobs: bun build apps/hook/server/index.ts --compile --target=bun-linux-x64 --outfile plannotator-linux-x64 sha256sum plannotator-linux-x64 > plannotator-linux-x64.sha256 + # Linux ARM64 + bun build apps/hook/server/index.ts --compile --target=bun-linux-arm64 --outfile plannotator-linux-arm64 + sha256sum plannotator-linux-arm64 > plannotator-linux-arm64.sha256 + # Windows x64 bun build apps/hook/server/index.ts --compile --target=bun-windows-x64 --outfile plannotator-win32-x64.exe sha256sum plannotator-win32-x64.exe > plannotator-win32-x64.exe.sha256 diff --git a/scripts/analyze-stargazers.sh b/scripts/analyze-stargazers.sh new file mode 100644 index 00000000..90f60b59 --- /dev/null +++ b/scripts/analyze-stargazers.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# Analyze stargazers - fetch profiles and extract organizations/followers +# +# Usage: +# ./analyze-stargazers.sh +# +# Output: +# - stargazers.json (raw data) +# - stargazers-summary.csv (company, followers, bio) +# +# Note: GitHub API rate limit is 5000/hour for authenticated requests + +set -e + +REPO="backnotprop/plannotator" +OUTPUT_DIR="$(dirname "$0")/../.stargazers" +mkdir -p "$OUTPUT_DIR" + +echo "=== Stargazer Analysis ===" +echo "" + +# Step 1: Get all stargazers +echo "Fetching stargazers..." +gh api "repos/$REPO/stargazers" --paginate --jq '.[].login' > "$OUTPUT_DIR/usernames.txt" +TOTAL=$(wc -l < "$OUTPUT_DIR/usernames.txt" | tr -d ' ') +echo "Found $TOTAL stargazers" +echo "" + +# Step 2: Fetch profiles (with rate limit awareness) +echo "Fetching profiles (this may take a few minutes)..." +echo "login,followers,company,location,twitter,bio" > "$OUTPUT_DIR/stargazers.csv" + +COUNT=0 +while read -r username; do + COUNT=$((COUNT + 1)) + + # Progress indicator + if [ $((COUNT % 50)) -eq 0 ]; then + echo " Processed $COUNT / $TOTAL" + fi + + # Fetch user profile + profile=$(gh api "users/$username" 2>/dev/null || echo '{}') + + # Extract fields + followers=$(echo "$profile" | jq -r '.followers // 0') + company=$(echo "$profile" | jq -r '.company // ""' | tr ',' ';' | tr '\n' ' ') + location=$(echo "$profile" | jq -r '.location // ""' | tr ',' ';' | tr '\n' ' ') + twitter=$(echo "$profile" | jq -r '.twitter_username // ""') + bio=$(echo "$profile" | jq -r '.bio // ""' | tr ',' ';' | tr '\n' ' ' | cut -c1-100) + + echo "$username,$followers,$company,$location,$twitter,$bio" >> "$OUTPUT_DIR/stargazers.csv" + + # Small delay to be nice to the API + sleep 0.1 + +done < "$OUTPUT_DIR/usernames.txt" + +echo "" +echo "=== Analysis Complete ===" +echo "" + +# Step 3: Generate summary +echo "Top 20 by followers:" +sort -t',' -k2 -nr "$OUTPUT_DIR/stargazers.csv" | head -21 | tail -20 | while IFS=',' read -r user followers company location twitter bio; do + printf " %-25s %6s followers" "$user" "$followers" + [ -n "$company" ] && printf " @ %s" "$company" + echo "" +done + +echo "" +echo "Organizations found:" +cut -d',' -f3 "$OUTPUT_DIR/stargazers.csv" | grep -v "^$" | grep -v "^company$" | sort | uniq -c | sort -rn | head -20 + +echo "" +echo "Files saved to: $OUTPUT_DIR/" +echo " - usernames.txt" +echo " - stargazers.csv" diff --git a/tests/manual/local/test-binary.sh b/tests/manual/local/test-binary.sh new file mode 100755 index 00000000..e3c63616 --- /dev/null +++ b/tests/manual/local/test-binary.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# Test script using the installed plannotator binary (not local codebase) +# +# Usage: +# ./test-binary.sh +# +# Prerequisites: +# plannotator binary must be installed and on PATH +# (via: curl -fsSL https://plannotator.ai/install.sh | bash) +# +# What it does: +# 1. Verifies plannotator is on PATH +# 2. Pipes sample plan JSON to the binary (simulating Claude Code) +# 3. Opens browser for you to test the UI +# 4. Prints the hook output (allow/deny decision) + +set -e + +echo "=== Plannotator Binary Test ===" +echo "" + +# Check if plannotator is installed +if ! command -v plannotator &> /dev/null; then + echo "Error: plannotator not found on PATH" + echo "" + echo "Install it with:" + echo " curl -fsSL https://plannotator.ai/install.sh | bash" + echo "" + echo "Or add ~/.local/bin to your PATH:" + echo " export PATH=\"\$HOME/.local/bin:\$PATH\"" + exit 1 +fi + +BINARY_PATH=$(which plannotator) +echo "Using binary: $BINARY_PATH" +echo "" + +echo "Starting plannotator..." +echo "Browser should open automatically. Approve or deny the plan." +echo "" + +# Sample plan with code blocks (for tag extraction testing) +PLAN_JSON=$(cat << 'EOF' +{ + "tool_input": { + "plan": "# Implementation Plan: User Authentication\n\n## Overview\nAdd secure user authentication using JWT tokens and bcrypt password hashing.\n\n## Phase 1: Database Schema\n\n```sql\nCREATE TABLE users (\n id UUID PRIMARY KEY,\n email VARCHAR(255) UNIQUE NOT NULL,\n password_hash VARCHAR(255) NOT NULL,\n created_at TIMESTAMP DEFAULT NOW()\n);\n```\n\n## Phase 2: API Endpoints\n\n```typescript\n// POST /auth/register\napp.post('/auth/register', async (req, res) => {\n const { email, password } = req.body;\n const hash = await bcrypt.hash(password, 10);\n // ... create user\n});\n\n// POST /auth/login\napp.post('/auth/login', async (req, res) => {\n // ... verify credentials\n const token = jwt.sign({ userId }, SECRET);\n res.json({ token });\n});\n```\n\n## Checklist\n\n- [ ] Set up database migrations\n- [ ] Implement password hashing\n- [ ] Add JWT token generation\n- [ ] Create login/register endpoints\n- [x] Design database schema\n\n---\n\n**Target:** Complete by end of sprint" + } +} +EOF +) + +# Run the installed binary +echo "$PLAN_JSON" | plannotator + +echo "" +echo "=== Test Complete ==="