feat: add GitHub Actions workflow for automated release and installation script

This commit is contained in:
2025-08-24 14:01:33 +02:00
parent a36aea9e55
commit cc222e52c0
2 changed files with 106 additions and 0 deletions

28
install.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/sh
# install.sh
#
# This script downloads and installs the latest release of codebase-to-prompt.
set -e
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/GKaszewski/codebase-to-prompt/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
TARGET=""
if [ "$OS" = "linux" ] && [ "$ARCH" = "x86_64" ]; then
TARGET="x86_64-unknown-linux-gnu"
elif [ "$OS" = "darwin" ] && [ "$ARCH" = "x86_64" ]; then
TARGET="x86_64-apple-darwin"
else
echo "Unsupported OS or architecture: $OS $ARCH"
exit 1
fi
DOWNLOAD_URL="https://github.com/GKaszewski/codebase-to-prompt/releases/download/$LATEST_RELEASE/codebase-to-prompt-$TARGET"
curl -L "$DOWNLOAD_URL" -o codebase-to-prompt
chmod +x codebase-to-prompt
mv codebase-to-prompt /usr/local/bin/
echo "codebase-to-prompt installed successfully!"