-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
179 lines (159 loc) · 5.8 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
name: Build
on:
push:
paths:
- ".github/workflows/build.yml"
- "include/**"
- "src/**"
- "tools/**"
- "third_party/**"
- "CMakeLists.txt"
pull_request:
paths:
- ".github/workflows/build.yml"
- "include/**"
- "src/**"
- "tools/**"
- "third_party/**"
- "CMakeLists.txt"
workflow_dispatch:
jobs:
ubuntu:
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options-dev
- name: Build Video2X
run: |
mkdir -p /tmp/build /tmp/install
cmake -B /tmp/build -S . -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF \
-DINSTALL_BIN_DESTINATION=. -DINSTALL_INCLUDE_DESTINATION=include \
-DINSTALL_LIB_DESTINATION=. -DINSTALL_MODEL_DESTINATION=. \
-DCMAKE_INSTALL_PREFIX=/tmp/install
cmake --build /tmp/build --config Debug --target install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: video2x-nightly-linux-amd64
path: /tmp/install
windows:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Vulkan SDK
uses: humbletim/setup-vulkan-sdk@v1.2.0
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader, Glslang, SPIRV-Tools, SPIRV-Headers
vulkan-use-cache: true
- name: Install dependencies
shell: pwsh
run: |
$ffmpegVersion = "7.1"
$ncnnVersion = "20241226"
git submodule update --init --recursive
curl -Lo ffmpeg-shared.zip "https://github.com/GyanD/codexffmpeg/releases/download/$ffmpegVersion/ffmpeg-$ffmpegVersion-full_build-shared.zip"
Expand-Archive -Path ffmpeg-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ffmpeg-$ffmpegVersion-full_build-shared" -NewName ffmpeg-shared
curl -Lo ncnn-shared.zip "https://github.com/Tencent/ncnn/releases/download/$ncnnVersion/ncnn-$ncnnVersion-windows-vs2022-shared.zip"
Expand-Archive -Path ncnn-shared.zip -DestinationPath third_party
Rename-Item -Path "third_party/ncnn-$ncnnVersion-windows-vs2022-shared" -NewName ncnn-shared
- name: Build Video2X
shell: pwsh
run: |
cmake -S . -B build `
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF -DVIDEO2X_USE_EXTERNAL_SPDLOG=OFF -DVIDEO2X_USE_EXTERNAL_BOOST=OFF `
-DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=build/video2x_install
cmake --build build --config Debug --parallel --target install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: video2x-nightly-windows-amd64
path: build/video2x_install
container:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build the Docker image
with:
registry: ghcr.io
dockerfile: packaging/docker/Dockerfile
image: video2x
tags: latest
pushImage: false
appimage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
git submodule update --init --recursive
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential cmake clang pkg-config ninja-build curl file fuse \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libvulkan-dev \
glslang-tools \
libomp-dev \
libboost-program-options1.83-dev \
libboost-program-options1.83.0 \
libspdlog-dev
- name: Build Video2X
run: |
cmake -G Ninja -B build -S . \
-DVIDEO2X_USE_EXTERNAL_NCNN=OFF \
-DNCNN_BUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=Release \
-DNCNN_AVX512=OFF \
-DCMAKE_INSTALL_PREFIX=AppDir/usr
cmake --build build --config Release --target install --parallel
- name: Build AppImage
run: |
sudo curl -Lo /usr/local/bin/linuxdeploy \
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
sudo chmod +x /usr/local/bin/linuxdeploy
LD_LIBRARY_PATH=AppDir/usr/lib linuxdeploy \
--appdir AppDir \
--executable AppDir/usr/bin/video2x \
--exclude-library "libvulkan.so.1" \
--desktop-file packaging/appimage/video2x.desktop \
--icon-file packaging/appimage/video2x.png \
--output appimage
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Video2X-x86_64.AppImage
path: Video2X-x86_64.AppImage