-
Notifications
You must be signed in to change notification settings - Fork 191
365 lines (350 loc) · 12.4 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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
name: release
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
PACKAGE_PREFIX: ${{ steps.get-package_prefix.outputs.PACKAGE_PREFIX }}
TAG_NAME: ${{ steps.get-package_prefix.outputs.TAG_NAME }}
HEAD_SHA_SHORT: ${{ steps.get-package_prefix.outputs.HEAD_SHA_SHORT }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: get-package_prefix
id: get-package_prefix
run: |
LIB_NAME=bika
TAG_NAME=$(git describe --abbrev=0 --tags)
HEAD_SHA_SHORT=$(git rev-parse --short HEAD)
echo "::set-output name=PACKAGE_PREFIX::${LIB_NAME}_${TAG_NAME}"
echo "::set-output name=TAG_NAME::${TAG_NAME}"
echo "::set-output name=HEAD_SHA_SHORT::${HEAD_SHA_SHORT}"
release:
needs: [setup]
runs-on: ubuntu-latest
outputs:
Up_Url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: create_release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.setup.outputs.TAG_NAME }}
release_name: ${{ needs.setup.outputs.TAG_NAME }}
draft: true
prerelease: true
macos:
needs: [setup, release]
runs-on: macos-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_universal2
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311.cp312.cp313-none-macosx_10_9_universal2.whl
cd script
pip install delocate wheel_filename
python build_universal2.py pillow
pip install *.whl
cd ..
pip install -r src/requirements_macos.txt
brew install create-dmg
- name: Build
run: |
cd src
cp ../res/icon/Icon.icns ./
pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \
--hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \
--hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \
--hidden-import config \
--hidden-import component \
--hidden-import server \
--hidden-import task \
--hidden-import tools \
--hidden-import view \
--strip --windowed -i Icon.icns \
start.py
cp -avf db dist/PicACG.app/Contents/Frameworks
xattr -cr dist/PicACG.app
create-dmg --volname "PicACG" --volicon "Icon.icns" --icon "PicACG.app" 200 190 \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--hide-extension "PicACG.app" --app-drop-link 600 185 \
${{ env.PACKAGENAME }}.dmg dist/PicACG.app
zip -9 bika.zip ${{ env.PACKAGENAME }}.dmg
mv ${{ env.PACKAGENAME }}.dmg ..
mv bika.zip ..
cd ..
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika.zip
- name: upload-macos-arm
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.PACKAGENAME }}.dmg
macos-nosr:
needs: [setup, release]
runs-on: macos-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_macos_nosr_universal2
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
# pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311.cp312.cp313-none-macosx_10_9_universal2.whl
cd script
pip install delocate wheel_filename
python build_universal2.py pillow
pip install *.whl
cd ..
pip install -r src/requirements_macos.txt
brew install create-dmg
- name: Build
run: |
cd src
cp ../res/icon/Icon.icns ./
pyinstaller --target-architecture=universal2 --clean --onedir --name PicACG \
--hidden-import sr_ncnn_vulkan --hidden-import PySide6 --hidden-import requests \
--hidden-import urllib3 --hidden-import websocket-client --hidden-import pillow \
--hidden-import config \
--hidden-import component \
--hidden-import server \
--hidden-import task \
--hidden-import tools \
--hidden-import view \
--strip --windowed -i Icon.icns \
start.py
cp -avf db dist/PicACG.app/Contents/Frameworks
xattr -cr dist/PicACG.app
create-dmg --volname "PicACG" --volicon "Icon.icns" --icon "PicACG.app" 200 190 \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--hide-extension "PicACG.app" --app-drop-link 600 185 \
${{ env.PACKAGENAME }}.dmg dist/PicACG.app
zip -9 bika.zip ${{ env.PACKAGENAME }}.dmg
mv ${{ env.PACKAGENAME }}.dmg ..
mv bika.zip ..
cd ..
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika.zip
- name: upload-macos-arm
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: ${{ env.PACKAGENAME }}.dmg
windows:
needs: [setup, release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311-none-win_amd64.whl
pip install -r src\requirements.txt
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
Expand-Archive -Path "upx.zip" -DestinationPath "D:\"
Remove-Item "upx.zip"
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
pyinstaller -F -w -i icon.ico start.py --upx-dir "D:\upx-4.2.4-win64"
mv dist bika
Copy-Item -Verbose -Recurse -Path db -Destination bika/
cp ..\LICENSE bika\
cp ..\CHANGELOG bika\
cd ..
mkdir ${{ env.PACKAGENAME }}
mv src\bika ${{ env.PACKAGENAME }}
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip
windows-nosr:
needs: [setup, release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows_nosr_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r src\requirements.txt
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
Expand-Archive -Path "upx.zip" -DestinationPath "D:\"
Remove-Item "upx.zip"
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
pyinstaller -F -w -i icon.ico start.py --upx-dir "D:\upx-4.2.4-win64"
mv dist bika
Copy-Item -Verbose -Recurse -Path db -Destination bika/
cp ..\LICENSE bika\
cp ..\CHANGELOG bika\
cd ..
mkdir ${{ env.PACKAGENAME }}
mv src\bika ${{ env.PACKAGENAME }}
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip
windows7:
needs: [setup, release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows7_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.6
pip install https://github.com/tonquer/waifu2x-vulkan/releases/download/v1.1.6/sr_ncnn_vulkan-1.2.0-cp36.cp37.cp38.cp39.cp310.cp311-none-win_amd64.whl
pip install -r src\requirements_win7.txt
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
Expand-Archive -Path "upx.zip" -DestinationPath "D:\"
Remove-Item "upx.zip"
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
pyinstaller -F -w -i icon.ico start.py --upx-dir "D:\upx-4.2.4-win64"
mv dist bika
Copy-Item -Verbose -Recurse -Path db -Destination bika/
cp ..\LICENSE bika\
cp ..\CHANGELOG bika\
cd ..
mkdir ${{ env.PACKAGENAME }}
mv src\bika ${{ env.PACKAGENAME }}
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip
windows7-nosr:
needs: [setup, release]
runs-on: windows-latest
env:
PACKAGENAME: ${{ needs.setup.outputs.PACKAGE_PREFIX }}_windows7_nosr_x64
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller==4.6
pip install -r src\requirements_win7.txt
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-win64.zip" -OutFile "upx.zip"
Expand-Archive -Path "upx.zip" -DestinationPath "D:\"
Remove-Item "upx.zip"
- name: Build
run: |
cd src
cp ..\res\icon\icon.ico .\
pyinstaller -F -w -i icon.ico start.py --upx-dir "D:\upx-4.2.4-win64"
mv dist bika
Copy-Item -Verbose -Recurse -Path db -Destination bika/
cp ..\LICENSE bika\
cp ..\CHANGELOG bika\
cd ..
mkdir ${{ env.PACKAGENAME }}
mv src\bika ${{ env.PACKAGENAME }}
7z a -t7z -r "$($Env:PACKAGENAME + '.7z')" "bika"
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGENAME }}
path: bika
- name: upload-win
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.Up_Url }}
asset_path: ${{ env.PACKAGENAME }}.7z
asset_name: ${{ env.PACKAGENAME }}.7z
asset_content_type: application/zip