-
Notifications
You must be signed in to change notification settings - Fork 215
237 lines (200 loc) · 7.37 KB
/
build.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: Build
on: [push, pull_request]
jobs:
windows32:
name: Build for Windows (32-bit)
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x86
- name: Check Python install
run: |
which python
python --version
python -c "import struct; print(struct.calcsize('P') * 8)"
which pip
pip --version
- name: Install Python dependencies
run: |
pip3 install -U setuptools wheel pip
pip3 install -r requirements.txt
pip3 install -r requirements_gui.txt
pip3 install py2exe
- name: Check Python dependencies
run: |
python3 -c "from PySide2 import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))"
- name: Build
run: |
$ver = (findstr version .\syncplay\__init__.py).split("'")[1]
echo $ver
echo "VER=$ver" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
python buildPy2exe.py
New-Item -Path syncplay_v$ver -Name "syncplay.ini" -Value " "
- name: Prepare for deployment
run: dir
- name: Deploy portable
uses: actions/upload-artifact@v2
with:
name: Syncplay_${{ env.VER }}_x86_Portable
path: |
syncplay_v${{ env.VER }}
- name: Deploy installer
uses: actions/upload-artifact@v2
with:
name: Syncplay-${{ env.VER }}-x86-Setup.exe
path: |
Syncplay-${{ env.VER }}-Setup.exe
windows64:
name: Build for Windows (64-bit)
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: Check Python install
run: |
which python
python --version
python -c "import struct; print(struct.calcsize('P') * 8)"
which pip
pip --version
- name: Install Python dependencies
run: |
pip3 install -U setuptools wheel pip
pip3 install -r requirements.txt
pip3 install -r requirements_gui.txt
pip3 install py2exe
- name: Check Python dependencies
run: |
python3 -c "from PySide2 import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import __version__; print(__version__)"
python3 -c "from PySide2.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))"
- name: Build
run: |
$ver = (findstr version .\syncplay\__init__.py).split("'")[1]
echo $ver
echo "VER=$ver" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
python buildPy2exe.py
New-Item -Path syncplay_v$ver -Name "syncplay.ini" -Value " "
- name: Prepare for deployment
run: dir
- name: Deploy portable
uses: actions/upload-artifact@v2
with:
name: Syncplay_${{ env.VER }}_Portable
path: |
syncplay_v${{ env.VER }}
- name: Deploy installer
uses: actions/upload-artifact@v2
with:
name: Syncplay-${{ env.VER }}-x64-Setup.exe
path: |
Syncplay-${{ env.VER }}-x64-Setup.exe
macos:
name: Build for macOS
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
run: |
wget https://www.python.org/ftp/python/3.10.6/python-3.10.6-macos11.pkg
sudo installer -verbose -pkg ./python-3.10.6-macos11.pkg -target /
echo "/Library/Frameworks/Python.framework/Versions/3.10/bin" >> $GITHUB_PATH
- name: Check Python install
run: |
which python3
python3 --version
which pip3
pip3 --version
file $(which python3)
- name: Install Python dependencies
run: |
pip3 install -U pip setuptools wheel
pip3 install -r requirements.txt
pip3 install -r requirements_gui.txt
pip3 install py2app
- name: Install universal2 dependencies
env:
CFLAGS: -arch x86_64 -arch arm64
ARCHFLAGS: -arch x86_64 -arch arm64
run: |
pip3 uninstall zope.interface -y
pip3 install --no-binary :all: zope.interface
pip3 uninstall cffi -y
pip3 install --no-binary :all: cffi
pip3 uninstall cryptography -y
pip3 download --platform macosx_10_10_universal2 --only-binary :all: --no-deps --dest . cryptography
pip3 install --no-cache-dir --no-index --find-links . cryptography
pip3 uninstall charset-normalizer -y
pip3 download --platform macosx_10_9_universal2 --only-binary :all: --no-deps --dest . charset-normalizer
pip3 install --no-cache-dir --no-index --find-links . charset-normalizer
- name: Check Python dependencies
run: |
python3 -c "from PySide6 import __version__; print(__version__)"
python3 -c "from PySide6.QtCore import __version__; print(__version__)"
python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))"
python3 -c "import ssl; print(ssl)"
python3 -c "from py2app.recipes import pyside6"
python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))'
- name: Build
run: |
python3 buildPy2app.py py2app
- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
ci/macos-deploy.sh
ls -al dist_actions
- name: Deploy
uses: actions/upload-artifact@v2
with:
name: Syncplay_${{ env.VER }}.dmg
path: |
dist_actions/Syncplay_${{ env.VER }}.dmg
deb:
name: Build Debian package
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: ci/deb-script.sh
- name: Build server
run: ci/deb-server-script.sh
- name: Test
run: ci/deb-installation-test.sh
- name: Prepare for deployment
run: |
ls -al
export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
echo "VER=$VER" >> $GITHUB_ENV
mkdir dist_actions
mv /tmp/syncplay.deb dist_actions/syncplay_${VER}.deb
mv /tmp/syncplay-server.deb dist_actions/syncplay-server_${VER}.deb
ls -al dist_actions
- name: Deploy full deb
uses: actions/upload-artifact@v2
with:
name: syncplay.deb
path: |
dist_actions/syncplay_*.deb
- name: Deploy server deb
uses: actions/upload-artifact@v2
with:
name: syncplay-server.deb
path: |
dist_actions/syncplay-server_*.deb