-
Notifications
You must be signed in to change notification settings - Fork 10
242 lines (213 loc) · 13.8 KB
/
build_edcb.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
name: Build EDCB
# 手動実行
on:
workflow_dispatch:
inputs:
update_repository:
type: boolean
required: true
description: 'リポジトリにビルド済みアーカイブを追加・更新する (本番用)'
update_readme:
type: boolean
required: true
description: 'Readme を更新する (本番用)'
# ジョブの定義
jobs:
# EDCB (32bit / 64bit) のビルド
build:
runs-on: windows-2019
steps:
# リポジトリのチェックアウト
- name: Checkout Repository
uses: actions/checkout@v3
with:
path: DTV-Builds/
fetch-depth: 0
token: ${{ secrets.GIT_PUSH_TOKEN }}
# MSBuild のセットアップ
- name: Setup MSBuild
uses: microsoft/[email protected]
# EDCB のビルド
- name: Build EDCB
run: |
git clone -b master https://github.com/tsukumijima/EDCB.git
# EDCB 本体のビルド
cd EDCB/Document/
msbuild EDCB_ALL.VS2015.sln /t:Build /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v142
msbuild EDCB_ALL.VS2015.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
# EDCB 付属ツール群のビルド
cd ../ini/Tools/
msbuild misc.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild misc.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cd IBonCast/
msbuild IBonCast.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild IBonCast.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cd ../tsidmove/
msbuild tsidmove.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild tsidmove.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
# EDCB のバージョンとして用いる日付を取得して保存
- id: version
name: Set EDCB Version
working-directory: EDCB/
run: |
$version = ((Get-Content -Path "Common/CommonResource.h") -match '#define EDCB_VERSION_TAG "(.*)"')[0] -replace '#define EDCB_VERSION_TAG "', '' -replace '"', '' -replace 'tkntrec-', ''
$version_date = [DateTime]::ParseExact($version, "yyMMdd", $null).ToString("yyyy/MM/dd")
echo "data=EDCB-$version" >> $ENV:GITHUB_OUTPUT
echo "version_date=$version_date" >> $ENV:GITHUB_OUTPUT
# パッケージングスクリプトを実行し、ビルド成果物を適切なフォルダに配置
- name: Arrangement Artifacts
run: |
# パッケージスクリプトを実行
mkdir Packages
cd EDCB/
bash package.sh -a x86 -t Release -o ../Packages/
bash package.sh -a x64 -t Release -o ../Packages/
cd ../
# ビルド成果物を配置
mkdir ${{steps.version.outputs.data}}
cp -Path Packages/x86/release/ -Destination ${{steps.version.outputs.data}}/EDCB_32bit/ -Recurse
cp -Path Packages/x64/release/ -Destination ${{steps.version.outputs.data}}/EDCB_64bit/ -Recurse
cp -Path DTV-Builds/.github/workflows/assets/EDCB/* -Destination ${{steps.version.outputs.data}}/EDCB_32bit/ -Recurse -Force
cp -Path DTV-Builds/.github/workflows/assets/EDCB/* -Destination ${{steps.version.outputs.data}}/EDCB_64bit/ -Recurse -Force
mkdir ${{steps.version.outputs.data}}/EDCB_32bit/BonDriver/ -Force
mkdir ${{steps.version.outputs.data}}/EDCB_64bit/BonDriver/ -Force
mv -Path ${{steps.version.outputs.data}}/EDCB_32bit/LICENSE-Civetweb.md -Destination ${{steps.version.outputs.data}}/EDCB_32bit/License_CivetWeb.md
mv -Path ${{steps.version.outputs.data}}/EDCB_64bit/LICENSE-Civetweb.md -Destination ${{steps.version.outputs.data}}/EDCB_64bit/License_CivetWeb.md
# EDCB_Build.txt を配置
cp -Path DTV-Builds/EDCB_Build.txt -Destination ${{steps.version.outputs.data}}/
bash -c "sed -i 's| - [0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\}| - ${{steps.version.outputs.version_date}}|g' ${{steps.version.outputs.data}}/EDCB_Build.txt"
bash -c "dos2unix --keep-bom ${{steps.version.outputs.data}}/EDCB_Build.txt"
# libaribb25 (B25Decoder.dll / B1Decoder.dll) のビルド
- name: Build libaribb25 (B25Decoder.dll / B1Decoder.dll)
run: |
git clone -b master https://github.com/tsukumijima/libaribb25.git
cd libaribb25/
msbuild arib_std_b25.sln /t:Build /p:Configuration=Release /p:Platform=Win32 /p:PlatformToolset=v142
msbuild arib_std_b25.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Win32/Release/libaribb1.dll -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/B1Decoder.dll
cp -Path Win32/Release/libaribb25.dll -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/B25Decoder.dll
cp -Path x64/Release/libaribb1.dll -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/B1Decoder.dll
cp -Path x64/Release/libaribb25.dll -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/B25Decoder.dll
# OpenSSL 3.0 ライブラリのダウンロード
- name: Download OpenSSL 3.0 Libraries
run: |
curl -LO https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-3.0.9.zip
7z x -y openssl-3.0.9.zip
cp -Path openssl-3.0/x86/bin/libcrypto-3.dll -Destination ${{steps.version.outputs.data}}/EDCB_32bit/
cp -Path openssl-3.0/x86/bin/libssl-3.dll -Destination ${{steps.version.outputs.data}}/EDCB_32bit/
cp -Path openssl-3.0/x86/bin/openssl.exe -Destination ${{steps.version.outputs.data}}/EDCB_32bit/
cp -Path openssl-3.0/x64/bin/libcrypto-3-x64.dll -Destination ${{steps.version.outputs.data}}/EDCB_64bit/
cp -Path openssl-3.0/x64/bin/libssl-3-x64.dll -Destination ${{steps.version.outputs.data}}/EDCB_64bit/
cp -Path openssl-3.0/x64/bin/openssl.exe -Destination ${{steps.version.outputs.data}}/EDCB_64bit/
# Lua 5.2 のビルド
- name: Build Lua 5.2
run: |
git clone -b v5.2-luabinaries https://github.com/xtne6f/lua.git
cd lua/
msbuild lua52.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild lua52.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/lua52.dll -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/
cp -Path x64/Release/lua52.dll -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/
# lua-zlib のビルド
- name: Build Lua 5.2 zlib
run: |
git clone -b v0.5-lua52 https://github.com/xtne6f/lua-zlib.git
cd lua-zlib/
msbuild zlib52.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild zlib52.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/zlib52.dll -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/zlib.dll
cp -Path x64/Release/zlib52.dll -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/zlib.dll
# Write_Multi (EdcbPlugIn 向け書き出しプラグイン) のビルド
- name: Build Write_Multi
run: |
git clone -b master https://github.com/tsukumijima/Write_Multi.git
cd Write_Multi/
msbuild Write_Multi.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild Write_Multi.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/Write_Multi.dll -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/EdcbPlugIn/
cp -Path x64/Release/Write_Multi.dll -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/EdcbPlugIn/
# EDCB Material WebUI のダウンロード
- name: Download EDCB Material WebUI
run: |
git clone -b master https://github.com/tsukumijima/EDCB_Material_WebUI.git
cp -Path EDCB_Material_WebUI/HttpPublic/* -Destination ${{steps.version.outputs.data}}/EDCB_32bit/HttpPublic/ -Recurse -Force
cp -Path EDCB_Material_WebUI/HttpPublic/* -Destination ${{steps.version.outputs.data}}/EDCB_64bit/HttpPublic/ -Recurse -Force
cp -Path EDCB_Material_WebUI/Setting/* -Destination ${{steps.version.outputs.data}}/EDCB_32bit/Setting/ -Recurse -Force
cp -Path EDCB_Material_WebUI/Setting/* -Destination ${{steps.version.outputs.data}}/EDCB_64bit/Setting/ -Recurse -Force
cp -Path EDCB_Material_WebUI/README.md -Destination ${{steps.version.outputs.data}}/EDCB_32bit/Readme_EMWUI.md
cp -Path EDCB_Material_WebUI/README.md -Destination ${{steps.version.outputs.data}}/EDCB_64bit/Readme_EMWUI.md
# FFmpeg 4.3.1 のダウンロード
# 本当は FFmpeg-Builds のビルドを同梱したいが、現状公式で案内されているサイトでは 32bit 版ビルドが配布されていないのと、
# 昨今の FFmpeg のサイズが大きく 32bit 版と 64bit 版両方を同梱すると EDCB のアーカイブ全体が圧縮後で 100MB を超えてしまうため、
# やむを得ず Zeranoe の古いビルドを利用している (GitHub はリポジトリ内のサイズが 100MB を超えるファイルをアップロードできない)
- name: Download FFmpeg 4.3.1
run: |
curl -LO https://web.archive.org/web/2if_/https://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-4.3.1-win32-shared.zip
curl -LO https://web.archive.org/web/2if_/https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.3.1-win64-shared.zip
7z x -y ffmpeg-4.3.1-win32-shared.zip
7z x -y ffmpeg-4.3.1-win64-shared.zip
cp -Path ffmpeg-4.3.1-win32-shared/bin/* -Destination ${{steps.version.outputs.data}}/EDCB_32bit/Tools/
cp -Path ffmpeg-4.3.1-win64-shared/bin/* -Destination ${{steps.version.outputs.data}}/EDCB_64bit/Tools/
rm ${{steps.version.outputs.data}}/EDCB_32bit/Tools/ffplay.exe
rm ${{steps.version.outputs.data}}/EDCB_64bit/Tools/ffplay.exe
# psisiarc のビルド
- name: Build psisiarc
run: |
git clone -b master https://github.com/xtne6f/psisiarc
cd psisiarc/
msbuild psisiarc.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild psisiarc.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/psisiarc.exe -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/Tools/
cp -Path x64/Release/psisiarc.exe -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/Tools/
# tsreadex のビルド
- name: Build tsmemseg
run: |
git clone -b master https://github.com/xtne6f/tsmemseg
cd tsmemseg/
msbuild tsmemseg.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild tsmemseg.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/tsmemseg.exe -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/Tools/
cp -Path x64/Release/tsmemseg.exe -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/Tools/
# tsreadex のビルド
- name: Build tsreadex
run: |
git clone -b master https://github.com/xtne6f/tsreadex
cd tsreadex/
msbuild tsreadex.sln /t:Build /p:Configuration=Release /p:Platform=x86 /p:PlatformToolset=v142
msbuild tsreadex.sln /t:Build /p:Configuration=Release /p:Platform=x64 /p:PlatformToolset=v142
cp -Path Release/tsreadex.exe -Destination ../${{steps.version.outputs.data}}/EDCB_32bit/Tools/
cp -Path x64/Release/tsreadex.exe -Destination ../${{steps.version.outputs.data}}/EDCB_64bit/Tools/
# EDCB のビルドアーカイブを zip で圧縮
- name: Compress EDCB Archives
run: |
7z a -tzip -mx=9 ${{steps.version.outputs.data}}.zip ${{steps.version.outputs.data}}/
# Artifact としてアップロード
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{steps.version.outputs.data}}.zip
path: ${{steps.version.outputs.data}}.zip
# update_repository にチェックが入っているときのみ、ビルド済みアーカイブを追加してコミット
- name: Update Repository
working-directory: DTV-Builds/
if: ${{ github.event.inputs.update_repository == 'true' }}
run: |
git config --global core.autocrlf false
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git pull
cp -Path ../${{steps.version.outputs.data}}/EDCB_Build.txt -Destination ./
cp -Path ../${{steps.version.outputs.data}}.zip -Destination ./
bash -c "/usr/bin/find . -type f -name '*.txt' -exec dos2unix --keep-bom {} \;"
git add .
git commit -m "Add ${{steps.version.outputs.data}}"
git push -u origin master
# update_readme にチェックが入っているときのみ、Readme.md を更新
- name: Update Readme
working-directory: DTV-Builds/
if: ${{ github.event.inputs.update_readme == 'true' }}
run: |
bash -c "sed -i 's|^ - \*\*EDCB\*\*| - \*\*EDCB\*\*\n - ${{steps.version.outputs.data}} … [${{steps.version.outputs.data}}.zip](https://github.com/tsukumijima/DTV-Builds/raw/master/${{steps.version.outputs.data}}.zip)|' Readme.md && dos2unix Readme.md"
git add .
git commit -m "Update Readme.md"
git push -u origin master