Implement CI and build releases (vibe-kanban 2ef3e91a)

Implement CI and build releases

Please copy the pre-release and logic that allows us to use JS + NPX to distribute the rust binary, with code signing on mac.

You can view some examples in a different repo at /Users/lkw/Documents/repos/vibe-kanban
- .github/workflows/pre-release.yml
- .github/workflows/publish.yml
- npx-cli/bin/cli.js
- npx-cli/package.json
This commit is contained in:
Louis Knight-Webb
2025-11-01 10:45:13 +00:00
parent c2bbd9f5ce
commit a4efc7988e
10 changed files with 251 additions and 57 deletions

52
scripts/README.md Normal file
View File

@@ -0,0 +1,52 @@
# Manual Release Scripts
## manual-release.sh
Creates a single-platform npm package for testing or manual publishing.
### Usage
```bash
./scripts/manual-release.sh
```
This script will:
1. Detect your current platform (macOS/Linux/Windows, x64/ARM64)
2. Install the Rust target if needed
3. Build the release binary
4. Create the dist structure
5. Zip the binary
6. Install npm dependencies
7. Create a .tgz package
### Testing Locally
After running the script:
```bash
# Install globally to test
npm install -g npx-cli/dev-manager-mcp-*.tgz
# Run it
dev-manager-mcp --help
# Uninstall when done
npm uninstall -g dev-manager-mcp
```
### Publishing Manually
```bash
cd npx-cli
npm login
npm publish dev-manager-mcp-*.tgz --access public
```
### Important Notes
- This creates a **single-platform** package (only your current platform)
- For production releases with **all platforms**, use GitHub Actions
- The manual script is useful for:
- Local testing before setting up CI/CD
- Quick iterations during development
- Publishing platform-specific test versions

111
scripts/manual-release.sh Executable file
View File

@@ -0,0 +1,111 @@
#!/bin/bash
set -e
echo "🚀 Manual Release Script for dev-manager-mcp"
echo ""
# Detect platform
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
# Map to our platform naming
if [[ "$OS" == "darwin" ]]; then
if [[ "$ARCH" == "arm64" ]]; then
PLATFORM="macos-arm64"
TARGET="aarch64-apple-darwin"
else
PLATFORM="macos-x64"
TARGET="x86_64-apple-darwin"
fi
BINARY_NAME="dev-manager-mcp"
elif [[ "$OS" == "linux" ]]; then
if [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
PLATFORM="linux-arm64"
TARGET="aarch64-unknown-linux-musl"
else
PLATFORM="linux-x64"
TARGET="x86_64-unknown-linux-musl"
fi
BINARY_NAME="dev-manager-mcp"
elif [[ "$OS" =~ "mingw" || "$OS" =~ "msys" || "$OS" =~ "cygwin" ]]; then
if [[ "$ARCH" == "aarch64" || "$ARCH" == "arm64" ]]; then
PLATFORM="windows-arm64"
TARGET="aarch64-pc-windows-msvc"
else
PLATFORM="windows-x64"
TARGET="x86_64-pc-windows-msvc"
fi
BINARY_NAME="dev-manager-mcp.exe"
else
echo "❌ Unsupported platform: $OS-$ARCH"
exit 1
fi
echo "📦 Detected platform: $PLATFORM"
echo "🎯 Target: $TARGET"
echo ""
# Check if rustup target is installed
if ! rustup target list --installed | grep -q "$TARGET"; then
echo "📥 Installing Rust target: $TARGET"
rustup target add "$TARGET"
echo ""
fi
# Build the binary
echo "🔨 Building release binary..."
cargo build --release --target "$TARGET"
echo ""
# Create npx-cli dist structure
echo "📁 Creating dist structure..."
mkdir -p npx-cli/dist/"$PLATFORM"
echo ""
# Copy and zip the binary
BINARY_PATH="target/$TARGET/release/$BINARY_NAME"
if [[ ! -f "$BINARY_PATH" ]]; then
echo "❌ Binary not found at: $BINARY_PATH"
exit 1
fi
echo "📦 Zipping binary..."
if command -v zip &> /dev/null; then
zip -j npx-cli/dist/"$PLATFORM"/dev-manager-mcp.zip "$BINARY_PATH"
else
echo "❌ 'zip' command not found. Please install zip."
exit 1
fi
echo ""
# Install npm dependencies if needed
if [[ ! -d "npx-cli/node_modules" ]]; then
echo "📥 Installing npm dependencies..."
cd npx-cli
npm install
cd ..
echo ""
fi
# Pack the npm package
echo "📦 Creating npm package..."
cd npx-cli
npm pack
cd ..
echo ""
# Find the created tarball
TARBALL=$(ls npx-cli/dev-manager-mcp-*.tgz | head -n1)
echo "✅ Package created successfully!"
echo ""
echo "📦 Package: $TARBALL"
echo "🏷️ Platform: $PLATFORM"
echo ""
echo "Next steps:"
echo " 1. Test locally: npm install -g $TARBALL"
echo " 2. Login to npm: cd npx-cli && npm login"
echo " 3. Publish: npm publish --access public"
echo ""
echo "⚠️ Note: This package only contains the $PLATFORM binary."
echo " For multi-platform support, use GitHub Actions CI/CD."