forked from saidsay-so/VitaPad
-
Notifications
You must be signed in to change notification settings - Fork 2
228 lines (204 loc) · 6.95 KB
/
latest_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
name: PS Vita server and Windows MSYS2 client builds
on:
push:
branches:
- main
- dev
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'README.md'
- 'gyro_accel_tester'
- 'demo'
pull_request:
branches:
- main
- dev
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'README.md'
- 'gyro_accel_tester'
- 'demo'
jobs:
update_release_tags:
runs-on: ubuntu-latest
steps:
- name: Create development latest release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' }}
uses: "slord399/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev_latest"
prerelease: true
title: "Development latest build"
- name: Create latest stable release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
uses: "slord399/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest stable build"
build_vita_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install flatc
run: |
sudo apt update
sudo apt install -y make git-core cmake python3
git clone --branch v24.3.25 https://github.com/google/flatbuffers.git
cd flatbuffers
cmake -G "Unix Makefiles"
make -j
sudo make install
sudo ldconfig
- name: Install VitaSDK
run: |
echo "VITASDK=/usr/local/vitasdk" >> $GITHUB_ENV
git clone https://github.com/vitasdk/vdpm
cd vdpm
export VITASDK=/usr/local/vitasdk
export PATH="$VITASDK/bin:$PATH"
./bootstrap-vitasdk.sh
./install-all.sh
./vdpm flatbuffers
- name: Build VitaOxiPad
run: |
cmake -S server -B build -D CMAKE_BUILD_TYPE=Debug && cmake --build build
cp ./build/VitaOxiPad ./build/VitaOxiPad.elf
- name: Upload VPK as artifact
uses: actions/upload-artifact@v4
with:
name: VitaOxiPad.vpk
path: ./build/VitaOxiPad.vpk
- name: Upload ELF as artifact
uses: actions/upload-artifact@v4
with:
name: VitaOxiPad.elf
path: ./build/VitaOxiPad.elf
build_windows_client:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >
git
mingw-w64-ucrt-x86_64-gcc
mingw-w64-i686-gcc
mingw-w64-x86_64-rust
mingw-w64-i686-rust
mingw-w64-x86_64-flatbuffers
make
wget
cmake
- name: Cache Cargo registry and build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install dependencies
run: |
pacman -S --noconfirm mingw-w64-x86_64-rust mingw-w64-i686-rust mingw-w64-x86_64-flatbuffers mingw-w64-x86_64-cargo-c mingw-w64-i686-cargo-c make wget cmake
wget https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-flatbuffers-23.5.26-2-any.pkg.tar.zst
pacman -U --noconfirm mingw-w64-i686-flatbuffers-23.5.26-2-any.pkg.tar.zst
- name: Build Windows x64 Client
run: |
export PATH="${{ steps.msys2.outputs.msys2-location }}/mingw64/bin:${PATH}"
cd ./client
cargo check --all-targets
cargo test --all-targets
cargo build --release --bin cli
cp ./target/release/cli.exe ./target/release/VitaOxiPad-x64.exe
- name: Upload Windows x64 binary as artifact
uses: actions/upload-artifact@v4
with:
name: VitaOxiPad-x64.exe
path: ./client/target/release/VitaOxiPad-x64.exe
- name: Build Windows x32 Client
run: |
export PATH="${{ steps.msys2.outputs.msys2-location }}/mingw32/bin:${PATH}"
cd ./client
cargo check --all-targets
cargo test --all-targets
CARGO_TARGET_ARCH="i686" cargo build --release --bin cli
cp ./target/release/cli.exe ./target/release/VitaOxiPad-x32.exe
- name: Upload Windows x32 binary as artifact
uses: actions/upload-artifact@v4
with:
name: VitaOxiPad-x32.exe
path: ./client/target/release/VitaOxiPad-x32.exe
upload_release:
needs: [build_vita_server, build_windows_client]
runs-on: ubuntu-latest
steps:
- name: Download VitaOxiPad.vpk artifact
uses: actions/download-artifact@v4
with:
name: VitaOxiPad.vpk
path: ./release
- name: Download VitaOxiPad.elf artifact
uses: actions/download-artifact@v4
with:
name: VitaOxiPad.elf
path: ./release
- name: Download VitaOxiPad-x64.exe artifact
uses: actions/download-artifact@v4
with:
name: VitaOxiPad-x64.exe
path: ./release
- name: Download VitaOxiPad-x32.exe artifact
uses: actions/download-artifact@v4
with:
name: VitaOxiPad-x32.exe
path: ./release
- name: Upload latest development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev'}}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./release/*
tag: dev_latest
overwrite: true
file_glob: true
prerelease: true
- name: Upload latest stable release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./release/*
tag: latest
overwrite: true
file_glob: true
prerelease: true
- name: Check Dev secret availability
id: secret-check
shell: bash
run: |
if [ "${{ secrets.VT_API_KEY }}" != '' ]; then
echo "vt_available=true" >> $GITHUB_OUTPUT;
else
echo "vt_available=false" >> $GITHUB_OUTPUT;
fi
- name: Virustotal Windows binary files scan
if: ${{steps.secret-check.outputs.vt_available == 'true' && github.event_name != 'pull_request' }}
uses: cssnr/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
vt_api_key: ${{ secrets.VT_API_KEY }}
update_release: true
file_globs: |
./release/VitaOxiPad-x64.exe
./release/VitaOxiPad-x32.exe