-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (115 loc) · 4.12 KB
/
main.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: Package Application with Pyinstaller for Windows and pypi
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-pyPI:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install setuptools
run:
python -m pip install --upgrade pip setuptools wheel
- name: Build an sdist
run:
python setup.py sdist
- name: Publish distribution to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build-Windows-exe:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Package Application for Windows
uses: JackMcKew/pyinstaller-action-windows@main
with:
path: ./
- uses: actions/upload-artifact@v2
with:
name: pyDataView.exe
path: dist/windows
build-mac-linux:
strategy:
fail-fast: false
matrix:
#os: [macos-latest, macos-11, macos-10.15]
os: [ubuntu-20.04, ubuntu-22.04]#, macos-11, ubuntu-18.04, ubuntu-22.04]
python-version: ['3.9']#, '3.8', '3.9', '3.10', '3.11']
#exclude:
# - os: macos-latest
# python-version: '3.8'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python --version
- name: Diagnostic report env
run: |
echo "PYTHON_VERSION is ${{ matrix.python-version }} on OS ${{ matrix.os }}"
echo "Github variable RUNNER_OS=$RUNNER_OS"
if [ "$RUNNER_OS" == "Linux" ]; then # report linux distro version
lsb_release -a
fi
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install attrdict3
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0
sudo apt-get install libgtk-3-dev
pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/${{ matrix.os }} wxPython
elif [ "$RUNNER_OS" == "macOS" ]; then
pip install wxpython
else
echo "$RUNNER_OS not supported"
exit 1
fi
pip install numpy matplotlib scipy vispy
pip install pyinstaller
- name: Run Python and print version_info
run: |
python -c "import sys; print(sys.version_info)"
uname -a
#Checkout code here
- uses: actions/checkout@v2
- name: Build executable using Pyinstaller
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
pyinstaller pyDataView.spec
ls -l dist/
elif [ "$RUNNER_OS" == "macOS" ]; then
#It seems building in stages seems to work (locally at least)
pyinstaller --windowed pyDataView.py
#diff pyDataView.spec pyDataView_apple1.spec
#Try rebuilding with spec file generated by windowed command above
pyinstaller pyDataView.spec
#pyinstaller -y pyDataView_apple1.spec
#pyinstaller -y pyDataView_apple2.spec
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Save generated executable file as an artifact
uses: actions/upload-artifact@v2
with:
# The act of downloading zips up the artifact and adds the .zip to the downloaded file
name: pyDataView-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/