-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·48 lines (41 loc) · 1.35 KB
/
build.sh
File metadata and controls
executable file
·48 lines (41 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Build script for GitHub CLI using PyInstaller
# This script creates a single binary executable
set -e # Exit on any error
echo "🔨 Building GitHub Inventory CLI binary..."
# Clean previous builds
echo "🧹 Cleaning previous builds..."
rm -rf build/ dist/
# Install/update dependencies
echo "📦 Installing dependencies..."
# Use the virtual environment's pip if available, otherwise use system pip
if [ -f "venv/bin/pip" ]; then
./venv/bin/pip install -r requirements.txt
./venv/bin/pip install -r requirements-dev.txt
./venv/bin/pip install pyinstaller
else
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install pyinstaller
fi
# Build the binary using PyInstaller
echo "⚙️ Building binary with PyInstaller..."
# Use the virtual environment's Python if available, otherwise use system Python
if [ -f "venv/bin/pyinstaller" ]; then
./venv/bin/pyinstaller github.spec
else
pyinstaller github.spec
fi
# Check if build was successful
if [ -f "dist/github" ]; then
echo "✅ Build successful!"
echo "📁 Binary location: dist/github"
echo "📊 Binary size: $(du -h dist/github | cut -f1)"
echo ""
echo "🚀 You can now:"
echo " - Copy dist/github to your Docker image"
echo " - Run ./dist/github --help to test locally"
else
echo "❌ Build failed!"
exit 1
fi