-
Notifications
You must be signed in to change notification settings - Fork 114
268 lines (235 loc) · 13 KB
/
build_releases.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
name: Build Windows Releases
on:
push:
branches:
- master
- actions
tags:
- '*'
jobs:
get_version_name:
name: Get version name
runs-on: ubuntu-latest
outputs:
rev_count: ${{ steps.rev.outputs.rev_count }}
version_name: ${{ steps.rev.outputs.version_name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version name
id: rev
run: |
cd ${{ github.workspace }}
REVCOUNT=`git rev-list --count HEAD`
echo "rev_count=${REVCOUNT}" >> $GITHUB_OUTPUT
if [[ "${{ github.ref }}" =~ "refs/tags/" ]]; then
VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/##g")
else
VERSION=r${REVCOUNT}
fi
echo "version_name=${VERSION}" >> $GITHUB_OUTPUT
build:
name: Upload Release Asset
runs-on: windows-2019
needs: get_version_name
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
include:
- arch: x86
platform: Win32
cuda_ver_major: 11
cuda_ver_minor: 1
cuda_download_url: https://developer.download.nvidia.com/compute/cuda/11.1.1/network_installers/cuda_11.1.1_win10_network.exe
- arch: x64
platform: x64
cuda_ver_major: 10
cuda_ver_minor: 1
cuda_download_url: https://developer.download.nvidia.com/compute/cuda/10.1/Prod/network_installers/cuda_10.1.243_win10_network.exe
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Checkout dependencies
run: |
curl -s -o hdr10plus_gen_0.00_${{ matrix.platform }}.7z -L https://github.com/rigaya/hdr10plus_gen/releases/download/0.00/hdr10plus_gen_0.00_${{ matrix.platform }}.7z
7z x -ohdr10plus_gen\ hdr10plus_gen_0.00_${{ matrix.platform }}.7z
curl -s -o ffmpeg_lgpl.7z -L https://github.com/rigaya/ffmpeg_dlls_for_hwenc/releases/download/20240511/ffmpeg_dlls_for_hwenc_20240511.7z
7z x -offmpeg_lgpl -y ffmpeg_lgpl.7z
if "${{ matrix.arch }}" == "x64" curl -s -o NVEncNVOFFRUC_x64.7z -L https://github.com/rigaya/NVEnc/releases/download/7.42/NVEncNVOFFRUC_20240303_x64.7z
if "${{ matrix.arch }}" == "x64" 7z x -oNVEncNVOFFRUCBin -y NVEncNVOFFRUC_x64.7z
if "${{ matrix.arch }}" == "x64" curl -s -o NVEncNVSDKNGX_x64.7z -L https://github.com/rigaya/NVEnc/releases/download/7.55/NVEncNVSDKNGX_20240629_x64.7z
if "${{ matrix.arch }}" == "x64" 7z x -oNVEncNVSDKNGXBin -y NVEncNVSDKNGX_x64.7z
git clone https://github.com/AviSynth/AviSynthPlus.git ..\AviSynthPlus
git clone https://github.com/vapoursynth/vapoursynth.git ..\vapoursynth
git clone https://github.com/KhronosGroup/OpenCL-Headers.git ..\openclheaders
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.arch }}
- name: Setup CUDA
run: |
curl -s -o cuda_installer.exe -L ${{ matrix.cuda_download_url }}
cuda_installer.exe -s nvcc_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} cudart_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} curand_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} curand_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} npp_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} npp_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvml_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvrtc_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvrtc_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} visual_studio_integration_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}
- name: MSBuild
run: |
chcp 932
set AVISYNTH_SDK=${{ github.workspace }}\..\AviSynthPlus\avs_core
set VAPOURSYNTH_SDK=${{ github.workspace }}\..\vapoursynth
set OPENCL_HEADERS=${{ github.workspace }}\..\openclheaders
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}
if "${{ matrix.cuda_ver_major }}" == "10" set CUDA_PATH_V10_1=%CUDA_PATH%
if "${{ matrix.cuda_ver_major }}" == "11" set CUDA_PATH_V11_1=%CUDA_PATH%
msbuild NVEnc.sln /t:build /p:configuration=RelStatic /p:Platform=${{ matrix.platform }} -maxcpucount
- name: Create Archieve
id: archieve
run: |
mkdir NVEncC_Release
copy _build\${{ matrix.platform }}\RelStatic\NVEncC*.exe NVEncC_Release
copy _build\${{ matrix.platform }}\RelStatic\*.dll NVEncC_Release
copy hdr10plus_gen\hdr10plus_gen.exe NVEncC_Release
if "${{ matrix.arch }}" == "x64" copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}\bin\nvrtc64_*_0.dll" NVEncC_Release
if "${{ matrix.arch }}" == "x64" copy "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}\bin\nvrtc-builtins64_*.dll" NVEncC_Release
if "${{ matrix.arch }}" == "x64" copy NVEncNVOFFRUCBin\*.dll NVEncC_Release
if "${{ matrix.arch }}" == "x64" copy NVEncNVSDKNGXBin\*.dll NVEncC_Release
7z a -mx9 NVEncC_${{ needs.get_version_name.outputs.version_name }}_${{ matrix.platform }}.7z .\NVEncC_Release\*
- name: Check dll
run: |
if ("${{ matrix.platform }}" == "x64") "NVEncC_Release\NVEncC64.exe" --check-avcodec-dll
if ("${{ matrix.platform }}" == "Win32") "NVEncC_Release\NVEncC.exe" --check-avcodec-dll
- name: Check Version
if: startsWith(github.ref, 'refs/tags/')
id: check_ver
run: |
powershell "$ver = (Get-ItemProperty .\NVEncC_Release\NVEncC*.exe).VersionInfo.FileVersion; if ($ver -eq '${{ needs.get_version_name.outputs.version_name }}') { exit 0; } exit 1;"
- name: Calc hash
id: calc_hash
run: |
7z h -scrc* NVEncC_${{ needs.get_version_name.outputs.version_name }}_${{ matrix.platform }}.7z
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: NVEncC_${{ needs.get_version_name.outputs.version_name }}_${{ matrix.platform }}.7z
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: NVEncC_release_${{ needs.get_version_name.outputs.version_name }}_${{ matrix.platform }}
path: NVEncC_${{ needs.get_version_name.outputs.version_name }}_${{ matrix.platform }}.7z
upload_aviutl_release:
name: Upload Aviutl Release Asset
runs-on: windows-2019
needs: [ get_version_name, build ]
defaults:
run:
shell: cmd
strategy:
fail-fast: false
matrix:
include:
- arch: x86
platform: Win32
cuda_ver_major: 11
cuda_ver_minor: 1
cuda_download_url: https://developer.download.nvidia.com/compute/cuda/11.1.1/network_installers/cuda_11.1.1_win10_network.exe
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Checkout dependencies
run: |
curl -s -o ffmpeg_lgpl.7z -L https://github.com/rigaya/ffmpeg_dlls_for_hwenc/releases/download/20240511/ffmpeg_dlls_for_hwenc_20240511.7z
7z x -offmpeg_lgpl -y ffmpeg_lgpl.7z
git clone https://github.com/AviSynth/AviSynthPlus.git ..\AviSynthPlus
git clone https://github.com/vapoursynth/vapoursynth.git ..\vapoursynth
git clone https://github.com/KhronosGroup/OpenCL-Headers.git ..\openclheaders
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: ${{ matrix.arch }}
- name: Setup CUDA
run: |
curl -s -o cuda_installer.exe -L ${{ matrix.cuda_download_url }}
cuda_installer.exe -s nvcc_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} cudart_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} curand_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} curand_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} npp_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} npp_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvml_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvrtc_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} nvrtc_dev_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }} visual_studio_integration_${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}
- name: MSBuild
run: |
set AVISYNTH_SDK=${{ github.workspace }}\..\AviSynthPlus\avs_core
set VAPOURSYNTH_SDK=${{ github.workspace }}\..\vapoursynth
set OPENCL_HEADERS=${{ github.workspace }}\..\openclheaders
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${{ matrix.cuda_ver_major }}.${{ matrix.cuda_ver_minor }}
if "${{ matrix.cuda_ver_major }}" == "10" set CUDA_PATH_V10_1=%CUDA_PATH%
if "${{ matrix.cuda_ver_major }}" == "11" set CUDA_PATH_V11_1=%CUDA_PATH%
msbuild NVEnc.sln /t:build /p:configuration=Release /p:Platform=${{ matrix.platform }} -maxcpucount
- name: Download auo_setup
id: download_auosetup
run: |
curl -o auo_setup.zip -L https://github.com/rigaya/auo_setup/releases/download/2.01/auo_setup_2.01.zip
- name: Download NVEncC Win32
uses: actions/download-artifact@v4
with:
name: NVEncC_release_${{ needs.get_version_name.outputs.version_name }}_Win32
path: NVEncC_${{ needs.get_version_name.outputs.version_name }}_Win32.7z
- name: Download NVEncC x64
uses: actions/download-artifact@v4
with:
name: NVEncC_release_${{ needs.get_version_name.outputs.version_name }}_x64
path: NVEncC_${{ needs.get_version_name.outputs.version_name }}_x64.7z
- name: Create package
id: archieve
run: |
mkdir Aviutl_NVEnc_release
7z x -oAviutl_NVEnc_release\ auo_setup.zip
mkdir Aviutl_NVEnc_release\exe_files\NVEncC
mkdir Aviutl_NVEnc_release\exe_files\NVEncC\x86
mkdir Aviutl_NVEnc_release\exe_files\NVEncC\x64
7z x -oAviutl_NVEnc_release\exe_files\NVEncC\x86\ NVEncC_${{ needs.get_version_name.outputs.version_name }}_Win32.7z
7z x -oAviutl_NVEnc_release\exe_files\NVEncC\x64\ NVEncC_${{ needs.get_version_name.outputs.version_name }}_x64.7z
copy /y _build\Win32\Release\NVEnc.auo Aviutl_NVEnc_release\plugins\
copy /y NVEnc\NVEnc.ini Aviutl_NVEnc_release\plugins\
copy /y NVEnc\NVEnc.en.ini Aviutl_NVEnc_release\plugins\
copy /y NVEnc\NVEnc.zh.ini Aviutl_NVEnc_release\plugins\
copy /y NVEnc\auo_setup.ini Aviutl_NVEnc_release\exe_files\
copy /y NVEnc\NVEnc_readme.txt Aviutl_NVEnc_release\
copy /y "NVEnc\NVENCが利用可能か確認 [ダブルクリック].bat" Aviutl_NVEnc_release\
echo D | xcopy /y /e NVEnc\stg Aviutl_NVEnc_release\plugins\NVEnc_stg
dir /b /s Aviutl_NVEnc_release\
7z a -mx9 Aviutl_NVEnc_${{ needs.get_version_name.outputs.version_name }}.zip .\Aviutl_NVEnc_release\*
- name: Check Version
id: check_ver
if: startsWith(github.ref, 'refs/tags/')
run: |
powershell "$ver = (Get-ItemProperty .\Aviutl_NVEnc_release\plugins\NVEnc.auo).VersionInfo.FileVersion; if ($ver -eq '${{ needs.get_version_name.outputs.version_name }}') { exit 0; } exit 1;"
- name: Check dll
id: check_dll
run: |
"Aviutl_NVEnc_release\exe_files\NVEncC\x86\NVEncC.exe" --check-avcodec-dll
"Aviutl_NVEnc_release\exe_files\NVEncC\x64\NVEncC64.exe" --check-avcodec-dll
- name: Calc hash
id: calc_hash
run: |
7z h -scrc* Aviutl_NVEnc_${{ needs.get_version_name.outputs.version_name }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: Aviutl_NVEnc_${{ needs.get_version_name.outputs.version_name }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Aviutl_NVEnc_${{ needs.get_version_name.outputs.version_name }}
path: Aviutl_NVEnc_${{ needs.get_version_name.outputs.version_name }}.zip