-
Notifications
You must be signed in to change notification settings - Fork 7
326 lines (271 loc) · 12.7 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
name: Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
release:
name: Identify GitHub Release
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
if: github.event_name != 'push'
- name: Set tag name
id: tag
run: |
tag=$(basename "${{ github.ref }}")
echo "tag=$tag" >> $GITHUB_OUTPUT
release_web:
name: Release (Web)
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libpulse-dev libgl1-mesa-dev
- name: Cache LLVM host
id: cache-llvm-host
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build_llvm
key: web-cache-llvm-host
- name: Build LLVM host
if: steps.cache-llvm-host.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz
tar -xf llvm-project-16.0.0.src.tar.xz
cmake -B ${{github.workspace}}/build_llvm -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TARGETS_TO_BUILD=WebAssembly -DLLVM_ENABLE_PROJECTS="clang" -S llvm-project-16.0.0.src/llvm
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- llvm-tblgen
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- clang-tblgen
- name: Set up emsdk
run: |
git clone https://github.com/emscripten-core/emsdk.git ${{github.workspace}}/emsdk
${{github.workspace}}/emsdk/emsdk install 3.1.31
${{github.workspace}}/emsdk/emsdk activate 3.1.31
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build/_deps
key: web-cache-fetchcontent
- name: Configure
run: |
source ${{github.workspace}}/emsdk/emsdk_env.sh
emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TABLEGEN=${{github.workspace}}/build_llvm/bin/llvm-tblgen -DCLANG_TABLEGEN=${{github.workspace}}/build_llvm/bin/clang-tblgen
- name: Build
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(nproc)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensFlashcart
mkdir ${{github.workspace}}/Ardens_web
- name: Create zip file
run: |
cp ${{github.workspace}}/build/Ardens.js ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/build/Ardens.wasm ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/build/ArdensPlayer.js ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/build/ArdensPlayer.wasm ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/src/Ardens.html ${{github.workspace}}/Ardens_web/index.html
cp ${{github.workspace}}/src/ArdensPlayer.html ${{github.workspace}}/Ardens_web/player.html
cd ${{github.workspace}}/Ardens_web
zip -r ${{github.workspace}}/Ardens_web.zip *
- name: Pre-Deploy
run: |
cp ${{github.workspace}}/src/live_Ardens.html ${{github.workspace}}/Ardens_web/index.html
cp ${{github.workspace}}/src/live_ArdensPlayer.html ${{github.workspace}}/Ardens_web/player.html
cp ${{github.workspace}}/src/live_ArdensFlashcart.html ${{github.workspace}}/Ardens_web/flashcart.html
cp ${{github.workspace}}/build/ArdensFlashcart.js ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/build/ArdensFlashcart.wasm ${{github.workspace}}/Ardens_web
cp ${{github.workspace}}/src/boot/flashcart.zip ${{github.workspace}}/Ardens_web
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
token: ${{ secrets.GITHUB_TOKEN }}
folder: ${{github.workspace}}/Ardens_web
- name: Deploy to GitHub Pages (version)
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
token: ${{ secrets.GITHUB_TOKEN }}
folder: ${{github.workspace}}/Ardens_web
target-folder: ${{ needs.release.outputs.tag }}
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "${{github.workspace}}/Ardens_web.zip"
release_linux:
name: Release (Linux)
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Install prerequisites
run: |
sudo apt-get update
sudo apt-get install -y libfuse2
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v3
with:
path: _deps
key: windows_x86-cache-fetchcontent
- name: HBB Build
run: bash cmake/build_hbb.sh
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "build/Ardens_linux_x64.zip"
release_windows_x86:
name: Release (Windows x86)
needs: [release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Configure
run: cmake -B ${{github.workspace}}/build -A Win32 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build/_deps
key: windows_x86-cache-fetchcontent
- name: Build
run: |
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -A Win32 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/Ardens.exe" "Ardens.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ArdensPlayer.exe" "ArdensPlayer.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ardens_libretro.dll" "ardens_libretro.dll"
cmake -E tar "cfv" "Ardens_windows_x86.zip" --format=zip "Ardens.exe" "ArdensPlayer.exe" "ardens_libretro.dll"
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_windows_x86.zip"
release_windows_x64:
name: Release (Windows x64)
needs: [release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Configure
run: cmake -B ${{github.workspace}}/build -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Cache FetchContent
id: cache-fetchcontent
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build/_deps
key: windows_x64-cache-fetchcontent
- name: Build
run: |
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -A x64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/Ardens.exe" "Ardens.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ArdensPlayer.exe" "ArdensPlayer.exe"
cmake -E copy "${{github.workspace}}/build/${{env.BUILD_TYPE}}/ardens_libretro.dll" "ardens_libretro.dll"
cmake -E tar "cfv" "Ardens_windows_x64.zip" --format=zip "Ardens.exe" "ArdensPlayer.exe" "ardens_libretro.dll"
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_windows_x64.zip"
release_macos_x64:
name: Release (MacOS x64)
needs: [release]
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
mkdir Ardens_macos
cmake -E copy_directory "${{github.workspace}}/build/Ardens.app" "Ardens_macos/Ardens.app"
cmake -E copy_directory "${{github.workspace}}/build/ArdensPlayer.app" "Ardens_macos/ArdensPlayer.app"
cmake -E copy "${{github.workspace}}/build/ardens_libretro.dylib" "Ardens_macos/ardens_libretro.dylib"
hdiutil create -fs JHFS+ -format UDZO "Ardens_macos_x64.dmg" -srcfolder Ardens_macos
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_macos_x64.dmg"
release_macos_arm64:
name: Release (MacOS arm64)
needs: [release]
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Cache LLVM host
id: cache-llvm-host
uses: actions/cache@v3
with:
path: ${{github.workspace}}/build_llvm
key: macos-arm64-cache-llvm-host
- name: Build LLVM host
if: steps.cache-llvm-host.outputs.cache-hit != 'true'
run: |
wget -q https://github.com/llvm/llvm-project/releases/download/llvmorg-16.0.0/llvm-project-16.0.0.src.tar.xz
tar -xf llvm-project-16.0.0.src.tar.xz
cmake -B ${{github.workspace}}/build_llvm -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_ENABLE_PROJECTS="clang" -S llvm-project-16.0.0.src/llvm
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- llvm-tblgen
cmake --build ${{github.workspace}}/build_llvm --config ${{env.BUILD_TYPE}} -- clang-tblgen
- name: Configure
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DLLVM_TABLEGEN=${{github.workspace}}/build_llvm/bin/llvm-tblgen -DCLANG_TABLEGEN=${{github.workspace}}/build_llvm/bin/clang-tblgen
- name: Build
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target Ardens
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ArdensPlayer
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARDENS_LIBRETRO=1
cmake --build ${{github.workspace}}/build -j --config ${{env.BUILD_TYPE}} --target ardens_libretro
mkdir Ardens_macos
cmake -E copy_directory "${{github.workspace}}/build/Ardens.app" "Ardens_macos/Ardens.app"
cmake -E copy_directory "${{github.workspace}}/build/ArdensPlayer.app" "Ardens_macos/ArdensPlayer.app"
cmake -E copy "${{github.workspace}}/build/ardens_libretro.dylib" "Ardens_macos/ardens_libretro.dylib"
hdiutil create -fs JHFS+ -format UDZO "Ardens_macos_arm64.dmg" -srcfolder Ardens_macos
- name: Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release upload "${{ needs.release.outputs.tag }}" "Ardens_macos_arm64.dmg"