-
Notifications
You must be signed in to change notification settings - Fork 74
192 lines (191 loc) · 6.08 KB
/
build.yml
File metadata and controls
192 lines (191 loc) · 6.08 KB
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
name: Build and Deploy
on: [ push, pull_request ]
jobs:
android:
name: Android
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Build and Sign APK
env:
KEYSTORE_FILE_PATH: ${{ github.workspace }}/signingkey.jks
KEYSTORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
if [[ -n "${{ secrets.SIGNING_KEY }}" ]]; then
echo "${{ secrets.SIGNING_KEY }}" | base64 --decode > ${{ env.KEYSTORE_FILE_PATH }}
./gradlew assembleGitContinuous
mv app/build/outputs/apk/git/continuous/app-git-continuous.apk CS16Client-Android.apk
else
./gradlew assembleGitDebug
mv app/build/outputs/apk/git/debug/app-git-debug.apk CS16Client-Android.apk
fi
working-directory: android
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Android
path: android/CS16Client-Android.apk
psvita:
name: PS Vita
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libatomic1 libgcc-s1 \
libstdc++6 gcc-multilib g++-multilib \
ninja-build libfontconfig-dev
- name: Setup VitaSDK
run: |
scripts/psvita_sdk.sh
echo "VITASDK=/usr/local/vitasdk" >> $GITHUB_ENV
echo "$VITASDK/bin" >> $GITHUB_PATH
- name: Configure CMake
run: cmake --preset "psvita-release"
- name: Generate configuration files
working-directory: build
run: ${{ github.workspace }}/scripts/psvita_generate_configs.sh
- name: Build and Package
working-directory: build
run: |
cmake --build . --parallel $(nproc)
cpack --config CPackConfig.cmake
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: PSVita
path: build/*.zip
windows:
name: Windows
runs-on: windows-latest
strategy:
matrix:
arch: [ 'x86', 'amd64' ]
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Setup Visual Studio
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Configure
run: cmake --preset "win32-ci-${{ matrix.arch }}"
- name: Build and Package
run: |
cmake --build .
cpack --config CPackConfig.cmake
working-directory: build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: build/*.zip
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
matrix:
arch: [ 'i386', 'amd64' ]
fail-fast: false
steps:
- name: Checkout sources
uses: actions/checkout@v4
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 \
ninja-build libfontconfig-dev:i386 libfontconfig-dev
- name: Configure
run: cmake --preset "linux-ci-${{ matrix.arch }}"
- name: Build and Package
run: |
cmake --build .
cpack --config CPackConfig.cmake
working-directory: build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: build/*.tar.gz
macos:
name: macOS
strategy:
matrix:
os: [ 'macos-15-intel', 'macos-latest' ]
arch: [ 'x86_64', 'arm64' ]
exclude:
- os: macos-15-intel
arch: arm64
- os: macos-latest
arch: x86_64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Install dependencies
run: brew install cmake gcc ninja fontconfig
- name: Configure
run: cmake --preset "macos-ci-${{ matrix.arch }}"
- name: Build and Package
run: |
cmake --build .
cpack --config CPackConfig.cmake
working-directory: build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.arch }}
path: build/*.zip
release:
name: Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && always()
needs: [ android, windows, linux, psvita, macos ]
steps:
- name: Fetch artifacts
uses: actions/download-artifact@v4
- name: Remove old release
run: |
TAG_NAME=${{ github.ref_name == 'main' && 'continuous' || format('continuous-{0}', github.ref_name) }}
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
if gh release list --repo ${{ github.repository }} | grep -q -e "$TAG_NAME"; then
gh release delete "$TAG_NAME" --yes --cleanup-tag --repo ${{ github.repository }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload new release
run: |
gh release create ${{ env.TAG_NAME }} --title "CS16Client development build" --prerelease */CS16Client-* \
--repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}