-
-
Notifications
You must be signed in to change notification settings - Fork 19
380 lines (311 loc) · 17 KB
/
prerelease.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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
name: build-prerelease
# Controls when the workflow will run
on:
#schedule:
# - cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-Cuda:
strategy:
matrix:
python-version: ["3.8"]
# The type of runner that the job will run on
#runs-on: self-hosted-22.04
runs-on: ubuntu-22.04
permissions: write-all
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Checkout code
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer-BETA.git
# Runs a single command using the runners shell
- name: Log
run: ls
- name: Get last release
id: last_release
run: |
cd REAL-Video-Enhancer-BETA
last_release_tag=$(git describe --tags --abbrev=0)
last_release_date=$(git log -1 --format="%aI" $last_release_tag)
echo "::set-output name=last_release_date::$last_release_date"
- name: Calculate time difference
id: calculate_time
run: |
current_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
last_release_date=${{ steps.last_release.outputs.last_release_date }}
current_timestamp=$(date -d "$current_date" +%s)
release_timestamp=$(date -d "$last_release_date" +%s)
time_difference=$((current_timestamp - release_timestamp))
echo "::set-output name=time_difference::$time_difference"
- name: Display time difference
run: |
time_difference=${{ steps.calculate_time.outputs.time_difference }}
echo "Time since last release: $((time_difference / 86400)) days"
# Runs a set of commands using the runners shell
- name: Get latest version
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer.git
- name: install libomp
run: |
sudo apt install -y libomp5 libvulkan-dev -y
cd /usr/lib
sudo ln -s libomp.so libomp.so.5
- name: Install python dependencies
run: cd REAL-Video-Enhancer && python3 -m pip install -r requirements.txt && python3 -m pip install https://github.com/TNTwise/realcugan-ncnn-py/releases/download/2024-04-22-rve/realcugan_ncnn_py-2.0.0-cp310-none-manylinux1_x86_64.whl https://github.com/TNTwise/Universal-NCNN-upscaler-python/releases/download/2024-04-20-rve/upscale_ncnn_py-1.2.0-cp310-none-manylinux1_x86_64.whl sympy PyQt5 py-notifier notify2 pillow testresources requests opencv-python-headless pypresence pyuic5-tool cx_FREEZE psutil loguru sympy pyinstaller spandrel https://download.pytorch.org/whl/cu117/torch-2.0.0%2Bcu117-cp310-cp310-linux_x86_64.whl torchvision==0.15 && sudo apt install libnotify-bin -y
- name: Compile to executable
run: |
cd REAL-Video-Enhancer
python3 -m PyQt5.uic.pyuic mainwindow.ui > mainwindow.py
rm -rf dist
rm -rf build
mkdir dist
python3 -m PyQt5.uic.pyuic mainwindow.ui > mainwindow.py
python3 -m PyQt5.uic.pyuic src/getModels/SelectModels.ui > src/getModels/SelectModels.py
python3 -m PyQt5.uic.pyuic src/getModels/Download.ui > src/getModels/Download.py
python3 -m PyQt5.uic.pyuic src/getModels/SelectAI.ui > src/getModels/SelectAI.py
python3 -m PyQt5.uic.pyuic src/getLinkVideo/get_vid_from_link.ui > src/getLinkVideo/get_vid_from_link.py
python3 -m cx_Freeze -c main.py --target-dir dist/ --packages=torch,torchvision
- name: Clone appimage repo
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer-AppImage.git
- name: Move files
run: mkdir -p REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/ && mv REAL-Video-Enhancer/dist/* REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/ && mv REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/main REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/REAL-Video-Enhancer
- name: Move QT Files
run: |
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
rm -rf squashfs-root/usr/bin
mv squashfs-root/usr/* REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/
rm -rf squashfs-root/
#- name: Make appimage
# run: chmod +x REAL-Video-Enhancer-AppImage/appimagetool-x86_64.AppImage && cd REAL-Video-Enhancer-AppImage/ && XZ_OPT=-9e ./appimagetool-x86_64.AppImage --comp xz REAL-Video-Enhancer.AppDir/
# uses: actions/upload-artifact@v3
# with:
# name: REAL-Video-Enhancer
# path: REAL-Video-Enhancer-AppImage/squashfs-root/usr/REAL-Video-Enhancer.tar.xz
- name: Generate version and tag
id: version_tag
run: |
version=$(python -c "from datetime import datetime; print(str(datetime.now()).split(' ')[0].replace('-',''))")
tag=$(python -c "import random, string; print(''.join(random.choices(string.ascii_letters, k=8)))")
commitlog=$(cd REAL-Video-Enhancer && git log --since="24 hours ago" --pretty=format:"%h - %s")
echo "Version=$version"
echo "Tag=$version"
echo "CommitLog=$commitlog"
echo "::set-output name=version::$version"
echo "::set-output name=tag::$version"
echo "::set-output name=commitlog::$commitlog"
- name: Make Commit Log
run: |
cd REAL-Video-Enhancer
time_difference=${{ 604800 }}
hours=$((time_difference / 3600)) # Convert seconds to hours
git log --since="$hours hours ago" --pretty=format:"%h - %s" >> ../output.log
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
zip --junk-paths REAL-Video-Enhancer-Appimage README.md README.md
- name: hella compress this shit
run: |
cd REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/
tar -cf - * | xz -9e > REAL-Video-Enhancer-x86_64.AppImage.tar.xz
cd ../../../../
mv REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/REAL-Video-Enhancer-x86_64.AppImage.tar.xz .
mv REAL-Video-Enhancer-x86_64.AppImage.tar.xz REAL-Video-Enhancer-CUDA.tar.xz
- name: Save CUDA Archive as artifact
uses: actions/upload-artifact@v3
with:
name: REAL-Video-Enhancer-CUDA.tar.xz
path: REAL-Video-Enhancer-CUDA.tar.xz
build-MacOS:
# The type of runner that the job will run on
runs-on: macos-12
permissions: write-all
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: checks
run: |
mkdir -p /Applications/Postgres.app/Contents/Versions/9.6/lib/
brew reinstall postgresql
brew update
brew reinstall libiodbc
export LDFLAGS="-L/usr/local/opt/libiodbc/lib"
export CPPFLAGS="-I/usr/local/opt/libiodbc/include"
export PKG_CONFIG_PATH="/usr/local/opt/libiodbc/lib/pkgconfig"
- uses: actions/checkout@v3
- name: Checkout code
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer-BETA.git
# Runs a single command using the runners shell
- name: Log
run: ls
- name: Get last release
id: last_release
run: |
cd REAL-Video-Enhancer-BETA
last_release_tag=$(git describe --tags --abbrev=0)
last_release_date=$(git log -1 --format="%aI" $last_release_tag)
echo "::set-output name=last_release_date::$last_release_date"
# Runs a set of commands using the runners shell
- name: Get latest version
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer.git
- name: Generate version and tag
id: version_tag
run: |
version=$(python -c "from datetime import datetime; print(str(datetime.now()).split(' ')[0].replace('-',''))")
tag=$(python -c "import random, string; print(''.join(random.choices(string.ascii_letters, k=8)))")
commitlog=$(cd REAL-Video-Enhancer && git log --since="24 hours ago" --pretty=format:"%h - %s")
echo "Version=$version"
echo "Tag=$version"
echo "CommitLog=$commitlog"
echo "::set-output name=version::$version"
echo "::set-output name=tag::$version"
echo "::set-output name=commitlog::$commitlog"
- name: Make Commit Log
run: |
cd REAL-Video-Enhancer
time_difference=${{ 604800 }}
hours=$((time_difference / 3600)) # Convert seconds to hours
git log --since="$hours hours ago" --pretty=format:"%h - %s" >> ../output.log
- name: Install python dependencies
run: cd REAL-Video-Enhancer && python3 -m pip install -r requirements.txt && python3 -m pip install https://github.com/TNTwise/Universal-NCNN-upscaler-python/releases/download/2024-04-20-rve/upscale_ncnn_py-1.2.0-cp311-none-macosx_11_0_universal2.whl https://github.com/TNTwise/realcugan-ncnn-py/releases/download/2024-04-22-rve/realcugan_ncnn_py-2.0.0-cp311-none-macosx_11_0_universal2.whl
- name: Compile to executable
run: |
cd REAL-Video-Enhancer
python3 -m PyQt5.uic.pyuic mainwindow.ui > mainwindow.py
rm -rf dist
rm -rf build
mkdir dist
python3 -m PyQt5.uic.pyuic mainwindow.ui > mainwindow.py
python3 -m PyQt5.uic.pyuic src/getModels/SelectModels.ui > src/getModels/SelectModels.py
python3 -m PyQt5.uic.pyuic src/getModels/Download.ui > src/getModels/Download.py
python3 -m PyQt5.uic.pyuic src/getModels/SelectAI.ui > src/getModels/SelectAI.py
python3 -m PyQt5.uic.pyuic src/getLinkVideo/get_vid_from_link.ui > src/getLinkVideo/get_vid_from_link.py
python3 -m PyInstaller --onefile main.py
- name: compress archive
run: |
cp -r REAL-Video-Enhancer/dist/ bin/
cd bin
mv main REAL-Video-Enhancer
tar -caf REAL-Video-Enhancer.tar.xz *
cd ../
mv bin/REAL-Video-Enhancer.tar.xz .
mv REAL-Video-Enhancer.tar.xz REAL-Video-Enhancer-MacOS-x86_64.tar.xz
- name: Save Archive as artifact
uses: actions/upload-artifact@v3
with:
name: REAL-Video-Enhancer-MacOS-x86_64.tar.xz
path: REAL-Video-Enhancer-MacOS-x86_64.tar.xz
build-NCNN:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
permissions: write-all
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Checkout code
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer-BETA.git
# Runs a single command using the runners shell
- name: Log
run: ls
- name: Get last release
id: last_release
run: |
cd REAL-Video-Enhancer-BETA
last_release_tag=$(git describe --tags --abbrev=0)
last_release_date=$(git log -1 --format="%aI" $last_release_tag)
echo "::set-output name=last_release_date::$last_release_date"
- name: Calculate time difference
id: calculate_time
run: |
current_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)
last_release_date=${{ steps.last_release.outputs.last_release_date }}
current_timestamp=$(date -d "$current_date" +%s)
release_timestamp=$(date -d "$last_release_date" +%s)
time_difference=$((current_timestamp - release_timestamp))
echo "::set-output name=time_difference::$time_difference"
- name: Display time difference
run: |
time_difference=${{ steps.calculate_time.outputs.time_difference }}
echo "Time since last release: $((time_difference / 86400)) days"
# Runs a set of commands using the runners shell
- name: Get latest version
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer.git
- name: Install python dependencies
run: cd REAL-Video-Enhancer && python3 -m pip install -r requirements.txt && python3 -m pip uninstall PyQt5 -y && python3 -m pip install https://github.com/TNTwise/realcugan-ncnn-py/releases/download/2024-04-22-rve/realcugan_ncnn_py-2.0.0-cp38-none-manylinux1_x86_64.whl sympy https://github.com/TNTwise/Universal-NCNN-upscaler-python/releases/download/2024-04-20-rve/upscale_ncnn_py-1.2.0-cp38-none-manylinux1_x86_64.whl py-notifier notify2 pillow python-magic testresources requests opencv-python-headless pypresence pyuic5-tool cx_FREEZE psutil PyQt5==5.12 loguru sympy && sudo apt install libnotify-bin -y
- name: Compile to executable
run: cd REAL-Video-Enhancer && make
- name: Clone appimage repo
run: git clone https://github.com/TNTwise/REAL-Video-Enhancer-AppImage.git
- name: Move files
run: mkdir -p REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/ && mv REAL-Video-Enhancer/dist/* REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/ && mv REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/main REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/bin/REAL-Video-Enhancer
- name: Move QT Files
run: |
wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
rm -rf squashfs-root/usr/bin
mv squashfs-root/usr/* REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer.AppDir/usr/
rm -rf squashfs-root/
- name: Make appimage
run: chmod +x REAL-Video-Enhancer-AppImage/appimagetool-x86_64.AppImage && cd REAL-Video-Enhancer-AppImage/ && ./appimagetool-x86_64.AppImage REAL-Video-Enhancer.AppDir/
- name: Make archive
run: |
python3 -m pip uninstall PyQt5 -y && sudo apt install python3-pyqt5 -y
mkdir archive-build && cd archive-build
git clone https://github.com/TNTwise/REAL-Video-Enhancer.git && cd REAL-Video-Enhancer && make && mv dist/main dist/REAL-Video-Enhancer
rm -rf bin/
mkdir bin/
cp -r dist/* bin/
- name: compress archive
run: |
cp -r archive-build/REAL-Video-Enhancer/bin/ bin/
tar -caf REAL-Video-Enhancer.tar.xz bin/
- name: Save AppImage as artifact
uses: actions/upload-artifact@v3
with:
name: REAL-Video-Enhancer-Appimage
path: REAL-Video-Enhancer-AppImage/REAL-Video-Enhancer-x86_64.AppImage
- name: Save Flatpak Archive as artifact
uses: actions/upload-artifact@v3
with:
name: REAL-Video-Enhancer-FLATPAK.tar.xz
path: REAL-Video-Enhancer.tar.xz
#- name: Log
# run: ls
Release:
needs: [build-NCNN, build-Cuda, build-MacOS]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Generate version and tag
id: version_tag
run: |
version=$(python -c "from datetime import datetime; print(str(datetime.now()).split(' ')[0].replace('-',''))")
tag=$(python -c "import random, string; print(''.join(random.choices(string.ascii_letters, k=8)))")
echo "Version=$version"
echo "Tag=$version"
echo "::set-output name=version::$version"
echo "::set-output name=tag::$version"
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
with:
name: Pre-Release Build
tag_name: prerelease
body: ${{ steps.version_tag.outputs.tag }}
draft: false
prerelease: true
files: |
artifacts/REAL-Video-Enhancer-Appimage/REAL-Video-Enhancer-x86_64.AppImage
artifacts/REAL-Video-Enhancer-MacOS-x86_64.tar.xz/REAL-Video-Enhancer-MacOS-x86_64.tar.xz
artifacts/REAL-Video-Enhancer-CUDA.tar.xz/REAL-Video-Enhancer-CUDA.tar.xz