Create PyInstaller .exe #62
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
name: Create PyInstaller .exe | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: install dependencies | |
shell: bash | |
run: | | |
poetry install --with dev | |
poetry run python saenopy/add_source.py | |
- name: build exe with pyinstaller | |
shell: bash | |
run: | | |
poetry run pyinstaller --clean -y --dist output/saenopy_run --onefile --icon "saenopy/img/Icon.ico" --splash "saenopy/img/logo_splash.png" --add-data "saenopy/img:saenopy/img" saenopy/gui/gui_master.py | |
mv output/saenopy_run/gui_master output/saenopy_run/saenopy | |
chmod +x output/saenopy_run/saenopy | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: saenopy_linux | |
path: output/saenopy_run | |
- name: Upload GitHub release assets | |
run: gh release upload $TAG output/saenopy_run/saenopy --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: v1.0.6 | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
#---------------------------------------------- | |
# ----- install & configure poetry ----- | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: install dependencies | |
shell: bash | |
run: | | |
poetry install --with dev | |
poetry run python saenopy/add_source.py | |
- name: build exe with pyinstaller | |
shell: bash | |
run: | | |
poetry run pyinstaller --clean -y --dist output/saenopy_run --onefile --icon "saenopy/img/Icon.ico" --splash "saenopy/img/logo_splash.png" --add-data "saenopy/img;saenopy/img" saenopy/gui/gui_master.py | |
mv output/saenopy_run/gui_master.exe output/saenopy_run/saenopy.exe | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: saenopy_windows | |
path: output/saenopy_run | |
- name: Upload GitHub release assets | |
run: gh release upload v1.0.6 "output\saenopy_run\saenopy.exe" --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: v1.0.6 | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: Install dependencies | |
shell: bash | |
run: | | |
poetry install --with dev | |
poetry run python saenopy/add_source.py | |
- name: Build executable with PyInstaller | |
shell: bash | |
run: | | |
poetry run pyinstaller --clean -y --dist output/saenopy_run --windowed --add-data "saenopy/img:saenopy/img" saenopy/gui/gui_master.py | |
mv output/saenopy_run/gui_master.app output/saenopy_run/saenopy_mac.app | |
zip -r output/saenopy_run/saenopy_mac.app.zip output/saenopy_run/saenopy_mac.app | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: saenopy_mac | |
path: output/saenopy_run | |
- name: Upload GitHub release assets | |
run: gh release upload $TAG output/saenopy_run/saenopy_mac.app.zip --clobber | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAG: v1.0.6 |