-
Notifications
You must be signed in to change notification settings - Fork 31
203 lines (197 loc) · 6.75 KB
/
build.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
name: Build
on:
push:
branches:
- main
jobs:
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Fetch YaPB Graphs from DB
run: scripts/yapb_graph_dl.sh
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Build
run: ./gradlew assembleDebug
- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/debug
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "34.0.0"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: android
path: app/build/outputs/apk/debug/app-debug-signed.apk
# psvita:
# name: PS Vita
# runs-on: ubuntu-latest
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# submodules: recursive
# - name: Setup PS Vita SDK
# run: scripts/psvita_sdk.sh
windows:
name: Windows
runs-on: windows-latest
strategy:
matrix:
arch: ['x86', 'amd64']
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Visual Studio
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Configure project
run: cmake --preset "win32-release-${{ matrix.arch }}"
- name: Run appversion.sh
run: regamedll/version/appversion.sh "${{ github.workspace }}/3rdparty/ReGameDLL_CS"
shell: bash
working-directory: 3rdparty/ReGameDLL_CS
- name: Build
run: cmake --build .
working-directory: build
- name: Generate extras.pk3
run: Compress-Archive -Path 3rdparty/cs16client-extras/* -Destination build/extras.pk3 -CompressionLevel NoCompression
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: win32-${{ matrix.arch }}
path: |
build/3rdparty/ReGameDLL_CS/regamedll/mp.dll
build/3rdparty/ReGameDLL_CS/regamedll/mp_amd64.dll
build/3rdparty/mainui_cpp/menu.dll
build/3rdparty/mainui_cpp/menu_amd64.dll
build/cl_dll/client.dll
build/cl_dll/client_amd64.dll
build/extras.pk3
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
matrix:
arch: ['i386', 'amd64']
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libatomic1:i386 libgcc-s1:i386 \
libstdc++6:i386 gcc-multilib g++-multilib cmake \
ninja-build libfontconfig-dev:i386 libfontconfig-dev
- name: Configure project
run: |
if [[ ${{ matrix.arch }} == i386 ]]; then
export CC="gcc -m32"
export CXX="g++ -m32"
fi
cmake --preset "linux-release-${{ matrix.arch }}"
- name: Build
run: cmake --build .
working-directory: build
- name: Generate extras.pk3
run: zip -0 -r build/extras.pk3 3rdparty/cs16client-extras
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.arch }}
path: |
build/3rdparty/ReGameDLL_CS/regamedll/cs.so
build/3rdparty/ReGameDLL_CS/regamedll/cs_amd64.so
build/3rdparty/mainui_cpp/menu.so
build/3rdparty/mainui_cpp/menu_amd64.so
build/cl_dll/client.so
build/cl_dll/client_amd64.so
build/extras.pk3
release:
name: Release
runs-on: ubuntu-latest
needs: [android, windows, linux]
steps:
- name: Fetch artifacts
uses: actions/download-artifact@v3
- name: Remove old release
uses: dev-drprasad/[email protected]
with:
tag_name: continuous
delete_release: true
github_token: ${{ secrets.REPO_TOKEN }}
repo: Velaron/cs16-client
- name: Repackage binaries
run: |
mv android/app-debug-signed.apk cs16-client.apk
mkdir -p cstrike/{dlls,cl_dlls}
mv win32-x86/3rdparty/ReGameDLL_CS/regamedll/mp.dll cstrike/dlls
mv win32-x86/3rdparty/mainui_cpp/menu.dll cstrike/cl_dlls
mv win32-x86/cl_dll/client.dll cstrike/cl_dlls
mv win32-x86/extras.pk3 cstrike
zip -r cs16-client_win32_x86.zip cstrike/
rm -r cstrike
mkdir -p cstrike/{dlls,cl_dlls}
mv win32-amd64/3rdparty/ReGameDLL_CS/regamedll/mp_amd64.dll cstrike/dlls
mv win32-amd64/3rdparty/mainui_cpp/menu_amd64.dll cstrike/cl_dlls
mv win32-amd64/cl_dll/client_amd64.dll cstrike/cl_dlls
mv win32-amd64/extras.pk3 cstrike
zip -r cs16-client_win32_amd64.zip cstrike/
rm -r cstrike
mkdir -p cstrike/{dlls,cl_dlls}
mv linux-i386/3rdparty/ReGameDLL_CS/regamedll/cs.so cstrike/dlls
mv linux-i386/3rdparty/mainui_cpp/menu.so cstrike/cl_dlls
mv linux-i386/cl_dll/client.so cstrike/cl_dlls
mv linux-i386/extras.pk3 cstrike
tar -czvf cs16-client_linux_i386.tar.gz cstrike/
rm -r cstrike
mkdir -p cstrike/{dlls,cl_dlls}
mv linux-amd64/3rdparty/ReGameDLL_CS/regamedll/cs_amd64.so cstrike/dlls
mv linux-amd64/3rdparty/mainui_cpp/menu_amd64.so cstrike/cl_dlls
mv linux-amd64/cl_dll/client_amd64.so cstrike/cl_dlls
mv linux-amd64/extras.pk3 cstrike
tar -czvf cs16-client_linux_amd64.tar.gz cstrike/
sleep 60s
- name: Purge artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: "*"
- name: Upload new release
uses: svenstaro/upload-release-action@v2
with:
repo_name: Velaron/cs16-client
repo_token: ${{ secrets.REPO_TOKEN }}
file_glob: true
file: cs16-client*
tag: continuous
overwrite: true
prerelease: true
release_name: CS16Client development build