Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/py-to-exe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

# https://github.com/pyinstaller/pyinstaller/issues/6296#issuecomment-962446033

name: Build Executable

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9"]
poetry-version: ["1.1.14"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pyinstaller
run: pip install pyinstaller
- name: Install dependencies
run: pip install .
- name: Compile python to exe
run: |
mkdir -p build;
cd build;
if [ "$RUNNER_OS" == 'Windows' ]; then
PATH_SEPARATOR=";"
else
PATH_SEPARATOR=":"
fi
pyinstaller --onefile --name proxybroker-${RUNNER_OS}-$(arch) --add-data "../proxybroker/data${PATH_SEPARATOR}data" --workpath ./tmp --distpath . --clean ../py2exe_entrypoint.py;
rm -rf tmp *.spec;
- name: Archive proxybroker artifact
uses: actions/upload-artifact@v3
with:
name: proxybroker-build-artifacts
path: build/proxybroker-*-*
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ $ docker pull bluet/proxybroker2
### Build bundled one-file executable with pyinstaller

#### Requirements
Supported Operating System: Windows, Linux, MacOS

*On UNIX-like systems (Linux / macOSX / BSD)*

Install these tools
- upx
- objdump (this tool is usually in the binutils package)
- `$ sudo apt install upx-ucl binutils` (On Ubuntu / Debian)
``` {.sourceCode .bash}
$ sudo apt install -y upx-ucl binutils # On Ubuntu / Debian
```

#### Build

Expand All @@ -127,7 +130,7 @@ pip install pyinstaller \
&& mkdir -p build \
&& cd build \
&& pyinstaller --onefile --name proxybroker --add-data "../proxybroker/data:data" --workpath ./tmp --distpath . --clean ../py2exe_entrypoint.py \
&& rm -rf tmp
&& rm -rf tmp *.spec
```

The executable is now in the build directory
Expand Down