Create PyInstaller .exe #47
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@v3 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
#---------------------------------------------- | |
# ----- 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 | |
- 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@v3 | |
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@v3 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
#---------------------------------------------- | |
# ----- 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 | |
- 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@v3 | |
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 |