-
Notifications
You must be signed in to change notification settings - Fork 14
291 lines (238 loc) · 9.18 KB
/
release.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
name: Compile and publish binaries
on:
release:
types:
- prereleased
- edited
- published
jobs:
macOS-RELEASE:
permissions: write-all
name: OSX release build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Install create-dmg
run: brew install create-dmg
- name: Build app bundle & binaries for OSX (RELEASE VERSION)
run: pyinstaller main.py --onefile --windowed --name OCSysInfo --icon=./resources/icons/OCSI_logo_mac.icns --paths=./src --target-architecture x86_64 --add-data 'src/util/version.json:src/util' --add-data 'requirements.txt:.'
- name: Apply app bundle patch
run: |
cp ./patches/launcher.sh dist/OCSysInfo.app/Contents/MacOS/Launcher
chmod +x dist/OCSysInfo.app/Contents/MacOS/Launcher
python3 ./patches/patch_plist.py
- name: Pack app into DMG image
run: |
rm -rf dist/OCSysInfo
create-dmg \
--volname "OCSysInfo" \
--volicon "resources/icons/OCSI_logo_mac.icns" \
--window-pos 200 120 \
--icon "OCSysInfo.app" 300 202 \
--window-size 800 400 \
--app-drop-link 600 200 "ocsysinfo_osx_x86_64-RELEASE.dmg" "dist/" \
--no-internet-enable
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts OSX
path: ocsysinfo_osx_x86_64-RELEASE.dmg
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ocsysinfo_osx_x86_64-RELEASE.dmg
tag: ${{ github.ref }}
file_glob: true
macOS-DEBUG:
permissions: write-all
name: OSX debug build
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Install create-dmg
run: brew install create-dmg
- name: Build app bundle & binaries for OSX (DEBUG VERSION)
run: pyinstaller main.py --onefile --windowed --name OCSysInfo --icon=./resources/icons/OCSI_logo_mac.icns --paths=./src --target-architecture x86_64 --add-data 'src/util/version.json:src/util' --add-data 'requirements.txt:.' --runtime-hook exe_dbg_hook.py
- name: Apply app bundle patch
run: |
cp ./patches/launcher.sh dist/OCSysInfo.app/Contents/MacOS/Launcher
chmod +x dist/OCSysInfo.app/Contents/MacOS/Launcher
python3 ./patches/patch_plist.py
- name: Pack app into DMG image
run: |
rm -rf dist/OCSysInfo
create-dmg \
--volname "OCSysInfo" \
--volicon "resources/icons/OCSI_logo_mac.icns" \
--window-pos 200 120 \
--icon "OCSysInfo.app" 300 202 \
--window-size 800 400 \
--app-drop-link 600 200 "ocsysinfo_osx_x86_64-DEBUG.dmg" "dist/" \
--no-internet-enable
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts OSX
path: ocsysinfo_osx_x86_64-DEBUG.dmg
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ocsysinfo_osx_x86_64-DEBUG.dmg
tag: ${{ github.ref }}
file_glob: true
windows-RELEASE:
permissions: write-all
name: Windows release binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Build binaries for Windows (RELEASE VERSION)
run: pyinstaller main.py --onefile --name ocsysinfo_win_x86_64-RELEASE --paths=./src --icon=./resources/icons/OCSI_logo_win.ico --add-data="src/util/version.json;src/util" --add-data="requirements.txt;."
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Windows
path: dist/ocsysinfo_win*
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_win*
tag: ${{ github.ref }}
file_glob: true
windows-DEBUG:
permissions: write-all
name: Windows debug binaries
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Build binaries for Windows (DEBUG VERSION)
run: pyinstaller main.py --onefile --name ocsysinfo_win_x86_64_DEBUG --paths=./src --icon=./resources/icons/OCSI_logo_win.ico --add-data="src/util/version.json;src/util" --add-data="requirements.txt;." --runtime-hook exe_dbg_hook.py
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Windows
path: dist/ocsysinfo_win*
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_win*
tag: ${{ github.ref }}
file_glob: true
linux_x64-RELEASE:
permissions: write-all
name: Linux x86_64 release binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip (just in case)
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Build binaries for Linux, x86_64 architecture (RELEASE VERSION)
run: pyinstaller main.py --onefile --name ocsysinfo_linux_x86_64-RELEASE --paths=./src --add-data 'src/util/version.json:src/util' --add-data 'requirements.txt:.'
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Linux
path: dist/ocsysinfo_linux_x86_64-RELEASE
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_linux_x86_64-RELEASE
tag: ${{ github.ref }}
file_glob: true
linux_x64-DEBUG:
permissions: write-all
name: Linux x86_64 debug binaries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: "3.10.x"
- name: Update pip (just in case)
run: pip3 install --upgrade pip
- name: Install dependencies
run: pip3 install -r requirements.txt
- name: Install pyinstaller
run: pip3 install pyinstaller
- name: Build binaries for Linux, x86_64 architecture (DEBUG VERSION)
run: pyinstaller main.py --onefile --name ocsysinfo_linux_x86_64-DEBUG --paths=./src --add-data 'src/util/version.json:src/util' --add-data 'requirements.txt:.' --runtime-hook exe_dbg_hook.py
- name: Upload to Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts Linux
path: dist/ocsysinfo_linux_x86_64-DEBUG
- name: Upload to Release
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@e74ff71f7d8a4c4745b560a485cc5fdb9b5b999d
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/ocsysinfo_linux_x86_64-DEBUG
tag: ${{ github.ref }}
file_glob: true