mirror of
https://github.com/backnotprop/plannotator.git
synced 2026-09-14 14:17:26 +08:00
Add Linux ARM64 binary to release workflow
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
Executable
+56
@@ -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 ==="
|
||||
Reference in New Issue
Block a user