Skip to content

Update for translation strings and translation files #301

Update for translation strings and translation files

Update for translation strings and translation files #301

name: Build Windows Executable
on:
push:
pull_request:
release:
types:
- created
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
# supported architecture: [x64, x86]
architecture: [x86, x64]
# supported versions: ['3.8', '3.9', '3.10', '3.11']
# for x86 only Python 3.9 to 3.11 is supported
python-version: ['3.10']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: ${{ matrix.architecture }}
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip pyinstaller setuptools wheel simplejson polygon3 cython -r requirements.txt
- name: Update to wxPython latest Version for x86
# Latest development version for x32 and Python 3.9 to 3.11, can be removed if requirements.txt is fixed
# minimum version for x86 needs to be wxPython >= 4.2.1 (2023-11-20)
if: ${{ matrix.architecture == 'x86' && matrix.python-version >= '3.9' }}
run: |
#python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.2.2a1.dev5626+a1184286
#python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython
python -m pip install -U wxPython
- name: Update to wxPython latest Version for x64
# Latest development version for x64 and Python 3.8 to 3.11, can be removed if requirements.txt is fixed
if: ${{ matrix.architecture == 'x64' && matrix.python-version >= '3.8' }}
run: |
#python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython==4.2.2a1.dev5626+a1184286
#python -m pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/ wxPython
python -m pip install -U wxPython
- name: Build Cython ext
run: |
python setup.py build_ext --inplace
- name: Make pyinstaller spec
run: |
pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --name "Pronterface" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -w -i pronterface.ico pronterface.py
pyi-makespec --hidden-import="pkg_resources.py2_warn" -F --name "Pronsole" --add-data "images/*;images" --add-data "*.png;." --add-data "*.ico;." -c -i pronsole.ico pronsole.py
- name: Make pyinstaller build
run: |
pyinstaller --clean Pronterface.spec -y
pyinstaller --clean Pronsole.spec -y
- name: Copy translation files
run: |
cp -r locale dist
- name: Configuration for releases
if: ${{ github.event_name == 'release' }}
run: |
"EXE_NAME=${{ github.ref_name }}" >> $env:GITHUB_ENV
- name: Configuration for pushes
if: ${{ github.event_name == 'push' }}
run: |
"EXE_NAME=printrun-nightly" >> $env:GITHUB_ENV
- name: Configuration for pull requests
if: ${{ github.event_name != 'release' && github.event_name != 'push' }}
run: |
"EXE_NAME=printrun-test" >> $env:GITHUB_ENV
- name: Upload artifacts for inspection
uses: actions/upload-artifact@v4
with:
name: ${{ env.EXE_NAME }}_windows_${{ matrix.architecture }}_py${{ matrix.python-version }}
path: |
dist/Pronterface.exe
dist/Pronsole.exe
dist/locale