-
Notifications
You must be signed in to change notification settings - Fork 2
299 lines (263 loc) · 11.4 KB
/
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Extract version name
id: extract_name
run: echo "name=$(echo ${GITHUB_REF##*/})" >>$GITHUB_OUTPUT
shell: bash
- name: Create release
id: create_release
uses: ncipollo/release-action@v1
with:
name: Release ${{ steps.extract_name.outputs.name }}
build-server:
name: Build server
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout to push branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Extract version from tag
uses: damienaicheh/[email protected]
- name: Set up JDK 19
uses: actions/setup-java@v1
with:
java-version: 19
- name: Build distribution file
if: job.status == 'success'
run: |
chmod +x ./gradlew
./gradlew server:shadowJar
shell: bash
env:
VERSION: ${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
- name: Upload jar artifact file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./server/build/libs/server-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-all.jar
asset_name: MiniGames-Server-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.jar
asset_content_type: application/x-java-archive
- name: Upload jar artifact file to workflow run results
uses: actions/upload-artifact@v2
with:
name: MiniGamesServer-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.jar
path: server/build/libs/server-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}-all.jar
build-desktop:
name: Build desktop release
strategy:
matrix:
platform: [ ubuntu-20.04, windows-2019, macos-12 ]
runs-on: ${{ matrix.platform }}
needs: release
steps:
- name: Checkout to push branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Extract version from tag
uses: damienaicheh/[email protected]
- name: Set up JDK 19
uses: actions/setup-java@v1
with:
java-version: 19
- name: Build distribution file
if: job.status == 'success'
run: |
export GRADLE_USER_HOME=$(pwd)/.gradle
export DESKTOP_CLIENT_API_HOST=${{ secrets.API_HOST }}
export REST_CLIENT_API_SCHEME=https
export WEBSOCKET_CLIENT_API_SCHEME=wss
chmod +x ./gradlew
./gradlew desktop-app:packageDistributionForCurrentOS
shell: bash
env:
VERSION: ${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
- name: Upload deb artifact file to workflow run results
uses: actions/upload-artifact@v2
if: runner.os == 'Linux'
with:
name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.deb
path: desktop-app/build/compose/binaries/main/deb/minigames_${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}_amd64.deb
- name: Upload deb artifact file to release
uses: actions/upload-release-asset@v1
if: runner.os == 'Linux'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./desktop-app/build/compose/binaries/main/deb/minigames_${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}_amd64.deb
asset_name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.deb
asset_content_type: application/x-deb
- name: Upload msi installer file to workflow run results
uses: actions/upload-artifact@v2
if: runner.os == 'Windows'
with:
name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.msi
path: desktop-app/build/compose/binaries/main/msi/MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.msi
- name: Upload msi installer file to release
uses: actions/upload-release-asset@v1
if: runner.os == 'Windows'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./desktop-app/build/compose/binaries/main/msi/MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.msi
asset_name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.msi
asset_content_type: application/x-ms-dos-executable
- name: Upload dmg image file to workflow run results
uses: actions/upload-artifact@v2
if: runner.os == 'macOS'
with:
name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.dmg
path: desktop-app/build/compose/binaries/main/dmg/MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.dmg
- name: Upload dmg image file to release
uses: actions/upload-release-asset@v1
if: runner.os == 'macOS'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./desktop-app/build/compose/binaries/main/dmg/MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.dmg
asset_name: MiniGames-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.dmg
asset_content_type: application/octet-stream
build-android:
name: Build android release
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout to push branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Extract version from tag
uses: damienaicheh/[email protected]
- name: Set up JDK 19
uses: actions/setup-java@v1
with:
java-version: 19
- name: Decode Keystore
id: decode_keystore
uses: timheuer/[email protected]
with:
fileName: 'mini-games.jks'
encodedString: ${{ secrets.KEYSTORE }}
- name: Build APK file
if: job.status == 'success'
run: |
export GRADLE_USER_HOME=$(pwd)/.gradle
export ANDROID_CLIENT_API_HOST=${{ secrets.API_HOST }}
export REST_CLIENT_API_SCHEME=https
export WEBSOCKET_CLIENT_API_SCHEME=wss
chmod +x ./gradlew
./gradlew android-app:assembleDebug
./gradlew android-app:assembleRelease android-app:bundleRelease -Pandroid.injected.signing.store.file=$SIGNING_STORE_FILE -Pandroid.injected.signing.store.password=$SIGNING_STORE_PASSWORD -Pandroid.injected.signing.key.alias=$SIGNING_KEY_ALIAS -Pandroid.injected.signing.key.password=$SIGNING_KEY_PASSWORD
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
SIGNING_STORE_FILE: ${{ steps.decode_keystore.outputs.filePath }}
VERSION: ${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
BUMP_FILE_VERSION_CODE: true
- name: Upload debug artifact file to workflow run results
uses: actions/upload-artifact@v2
with:
name: MiniGames-Debug-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.apk
path: android-app/build/outputs/apk/debug/android-app-debug.apk
- name: Upload release artifact file to workflow run results
uses: actions/upload-artifact@v2
with:
name: MiniGames-Release-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.apk
path: android-app/build/outputs/apk/release/android-app-release.apk
- name: Upload release bundle file to workflow run results
uses: actions/upload-artifact@v2
with:
name: MiniGames-Release-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.aab
path: android-app/build/outputs/bundle/release/android-app-release.aab
- name: Upload debug artifact file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./android-app/build/outputs/apk/debug/android-app-debug.apk
asset_name: MiniGames-Debug-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload release artifact file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./android-app/build/outputs/apk/release/android-app-release.apk
asset_name: MiniGames-Release-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload release bundle file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./android-app/build/outputs/bundle/release/android-app-release.aab
asset_name: MiniGames-Release-${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}.aab
asset_content_type: application/x-authorware-bin
- name: Upload release bundle file to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: ml.dev.kotlin.minigames
releaseFiles: ./android-app/build/outputs/bundle/release/android-app-release.aab
track: production
releaseName: ${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCH }}
- name: Commit version code changes
run: |
git config --global user.name "${{ secrets.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ secrets.CI_COMMIT_EMAIL }}"
git commit version.properties -m "update version properties"
git push origin HEAD:master
build-web:
name: Build web release
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout to push branch
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up JDK 19
uses: actions/setup-java@v1
with:
java-version: 19
- name: Build Wasm Distribution
if: job.status == 'success'
run: |
export GRADLE_USER_HOME=$(pwd)/.gradle
export WEB_CLIENT_API_HOST=${{ secrets.API_HOST }}
export REST_CLIENT_API_SCHEME=https
export WEBSOCKET_CLIENT_API_SCHEME=wss
chmod +x ./gradlew
./gradlew web-app:wasmJsBrowserDistribution
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./web-app/build/dist/wasmJs/productionExecutable
force_orphan: true
cname: mini-games.procyk.in