forked from kliment/Printrun
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (82 loc) · 3.58 KB
/
buildpackage-win.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Build Windows Executable
on:
push:
pull_request:
release:
types:
- published
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 == 'pull_request' }}
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
upload_release_assets:
needs: [build]
if: github.event_name == 'release' && github.event.action == 'published'
uses: kliment/Printrun/.github/workflows/upload-assets.yml@master