-
Notifications
You must be signed in to change notification settings - Fork 33
174 lines (174 loc) · 5.57 KB
/
deploy.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
name: Deploy Workflow
on:
push:
tags:
- "*"
jobs:
build-linux:
name: Build Linux
timeout-minutes: 30
runs-on: ubuntu-latest
container: rust:1.78.0
steps:
- name: Checkout code from repository
uses: actions/checkout@v4
- name: Build Base
run: cargo build --release
- name: Build SDL
run: |
cd frontends/sdl
apt-get update && apt-get install -y -q zip
cargo install cargo-vcpkg && cargo vcpkg -v build
cargo build --release
- name: Build Libretro
run: |
cd frontends/libretro
cargo build --release
- name: Bundle files
run: |
cp -p frontends/libretro/res/boytacean_libretro.info target/release/boytacean_libretro.info
- name: Transform filenames
run: |
cd target/release
mv boytacean-sdl boytacean-sdl-linux-x64
mv libboytacean_libretro.so boytacean_libretro.so
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: boytacean-linux
path: |
target/release/boytacean_libretro.info
target/release/boytacean-sdl-linux-x64
target/release/libboytacean.so
target/release/boytacean_libretro.so
retention-days: 5
build-windows:
name: Build Windows
timeout-minutes: 30
runs-on: windows-latest
steps:
- name: Checkout code from repository
uses: actions/checkout@v4
- name: Setup Rust
run: |
rustup install 1.78.0
rustup override set 1.78.0
rustup default stable-msvc
- name: Build Base
run: cargo build --release
- name: Build SDL
run: |
cd frontends/sdl
cargo install cargo-vcpkg && cargo vcpkg -v build
cargo build --release
- name: Build Libretro
run: |
cd frontends/libretro
cargo build --release
- name: Transform filenames
run: |
cd target/release
mv boytacean-sdl.exe boytacean-sdl-win32-x64.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: boytacean-win32
path: |
target/release/boytacean-sdl-win32-x64.exe
target/release/boytacean.dll
target/release/boytacean_libretro.dll
retention-days: 5
build-mac:
name: Build Mac
timeout-minutes: 30
runs-on: macos-latest
steps:
- name: Checkout code from repository
uses: actions/checkout@v4
- name: Setup Rust
run: |
rustup install 1.78.0
rustup override set 1.78.0
- name: Build Base
run: cargo build --release
- name: Build SDL
run: |
cd frontends/sdl
cargo install cargo-vcpkg && cargo vcpkg -v build
cargo build --release
- name: Build Libretro
run: |
cd frontends/libretro
cargo build --release
- name: Transform filenames
run: |
cd target/release
mv boytacean-sdl boytacean-sdl-mac-x64
mv libboytacean_libretro.dylib boytacean_libretro.dylib
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: boytacean-mac
path: |
target/release/boytacean-sdl-mac-x64
target/release/libboytacean.dylib
target/release/boytacean_libretro.dylib
retention-days: 5
build-wasm:
name: Build WASM
timeout-minutes: 30
runs-on: ubuntu-latest
container: rust:1.78.0
steps:
- name: Checkout code from repository
uses: actions/checkout@v4
- name: Install Dependencies
run: |
apt-get update
apt-get install -y -q cmake
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build WASM
run: wasm-pack build --release --target=web --out-dir=frontends/web/lib -- --features wasm
- name: Install Node.js 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Build Web code
run: |
cd frontends/web
npm install && NODE_ENV=production npm run build
- name: Bundle files
run: |
apt-get update && apt-get install -y -q zip
cd frontends/web
zip -r -j boytacean-wasm.zip dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: boytacean-wasm
path: frontends/web/boytacean-wasm.zip
retention-days: 5
release:
name: Release
needs: [build-linux, build-windows, build-mac, build-wasm]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create release
uses: softprops/action-gh-release@v2
with:
files: |
boytacean-linux/boytacean_libretro.info
boytacean-linux/boytacean-sdl-linux-x64
boytacean-linux/libboytacean.so
boytacean-linux/boytacean_libretro.so
boytacean-win32/boytacean-sdl-win32-x64.exe
boytacean-win32/boytacean.dll
boytacean-win32/boytacean_libretro.dll
boytacean-mac/boytacean-sdl-mac-x64
boytacean-mac/libboytacean.dylib
boytacean-mac/boytacean_libretro.dylib
boytacean-wasm/boytacean-wasm.zip