Skip to content

Commit

Permalink
Little by little
Browse files Browse the repository at this point in the history
  • Loading branch information
travisvn committed Dec 17, 2024
1 parent 841ada8 commit 0b414a4
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pyinstaller pathspec pyperclip
if [ "${{ matrix.os }}" != "windows-latest" ]; then
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
sudo apt-get update && sudo apt-get install -y upx
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
brew install upx
fi
# Build binary with PyInstaller and optimize
Expand All @@ -42,7 +45,16 @@ jobs:
if [ "${{ matrix.os }}" = "windows-latest" ]; then
pyinstaller --onefile --noconsole --name gptree.exe cli_tool_gptree/main.py
else
pyinstaller --onefile --noconsole --upx-dir=/usr/bin --name gptree cli_tool_gptree/main.py
# Dynamically find UPX path
UPX_PATH=$(which upx || echo "")
echo "Using UPX path: $UPX_PATH"
if [ -n "$UPX_PATH" ]; then
pyinstaller --onefile --noconsole --upx-dir=$(dirname "$UPX_PATH") --name gptree cli_tool_gptree/main.py
else
echo "UPX not found; skipping compression."
pyinstaller --onefile --noconsole --name gptree cli_tool_gptree/main.py
fi
fi
# Rename binaries for platform-specific names
Expand Down

0 comments on commit 0b414a4

Please sign in to comment.