-
Notifications
You must be signed in to change notification settings - Fork 17
178 lines (172 loc) · 5.57 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
name: Build
on:
push:
branches:
- master
jobs:
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- 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 assembleRelease
working-directory: android
- name: Sign APK
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: android
path: android/app/build/outputs/apk/release/app-release-unsigned-signed.apk
windows:
name: Windows
runs-on: windows-latest
strategy:
matrix:
arch: ['x86']
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: Build
run: cmake --build .
working-directory: build
- name: Generate extras.pk3
run: Compress-Archive -Path android/app/src/main/assets/* -Destination build/extras.pk3 -CompressionLevel NoCompression
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: win32-${{ matrix.arch }}
path: |
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 android/app/src/main/assets
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.arch }}
path: |
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 }}
- name: Repackage binaries
run: |
mv android/app-release-unsigned-signed.apk tf15-client.apk
mkdir -p tfc/dlls
mkdir -p tfc/cl_dlls
mv win32-x86/3rdparty/mainui_cpp/menu.dll tfc/cl_dlls
mv win32-x86/cl_dll/client.dll tfc/cl_dlls
mv win32-x86/extras.pk3 tfc
zip -r tf15-client_win32_x86.zip tfc/
rm -r tfc
# mkdir -p tfc/dlls
# mkdir -p tfc/cl_dlls
# mv win32-amd64/3rdparty/mainui_cpp/menu_amd64.dll tfc/cl_dlls
# mv win32-amd64/cl_dll/client_amd64.dll tfc/cl_dlls
# mv win32-amd64/extras.pk3 tfc
# zip -r tf15-client_win32_amd64.zip tfc/
# rm -r tfc
mkdir -p tfc/dlls
mkdir -p tfc/cl_dlls
mv linux-i386/3rdparty/mainui_cpp/menu.so tfc/cl_dlls
mv linux-i386/cl_dll/client.so tfc/cl_dlls
mv linux-i386/extras.pk3 tfc
tar -czvf tf15-client_linux_i386.tar.gz tfc/
rm -r tfc
mkdir -p tfc/dlls
mkdir -p tfc/cl_dlls
mv linux-amd64/3rdparty/mainui_cpp/menu_amd64.so tfc/cl_dlls
mv linux-amd64/cl_dll/client_amd64.so tfc/cl_dlls
mv linux-amd64/extras.pk3 tfc
tar -czvf tf15-client_linux_amd64.tar.gz tfc/
sleep 60s
- name: Purge artifacts
uses: geekyeggo/delete-artifact@v2
with:
name: "*"
- name: Upload new release
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
file: tf15-client*
tag: continuous
overwrite: true
prerelease: true
release_name: TF15Client development build