-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Pyinstaller EXE from GitHub Actions (#109)
* Use an older version of PyInstaller for now * Build Pyinstaller EXE from GitHub Actions * Poetry should be in path * Make sure Poetry is installed to PATH * Python on Windows is awful * Sanity check the EXE before releasing * Revert "Use an older version of PyInstaller for now" This reverts commit 7a068f8. * Try not excluding bootlocale * Try a venv * Revert "Try a venv" This reverts commit 1619e04. * Troubleshooting <https://stackoverflow.com/questions/64468438/pyinstaller-executable-fails-with-pkg-resources-distributionnotfound-error> * Add missing argument
- Loading branch information
1 parent
5efefac
commit 2e77e96
Showing
3 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
name: Build Releases | ||
on: push | ||
|
||
jobs: | ||
windows: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Cache Python modules | ||
uses: actions/cache@v1 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.pip | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.5.0 | ||
virtualenvs-create: false | ||
installer-parallel: true | ||
|
||
- name: Install Python Dependencies | ||
run: C:\Users\runneradmin\.local\bin\poetry install --no-interaction --no-ansi | ||
env: | ||
PIP_CACHE_DIR: ~/.pip | ||
|
||
- name: Build Executable | ||
run: C:\Users\runneradmin\.local\bin\poetry run pyinstaller --onefile --additional-hooks-dir hooks hstsparser.py | ||
|
||
- name: Print Helptext to Validate Executable | ||
run: dist\hstsparser.exe -h | ||
|
||
- name: Upload Executable | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: hstsparser.exe | ||
path: dist/hstsparser.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from PyInstaller.utils.hooks import collect_all | ||
|
||
datas, binaries, hiddenimports = collect_all('prettytable') |