-
Notifications
You must be signed in to change notification settings - Fork 1.6k
110 lines (93 loc) · 3.19 KB
/
buildMultiplatform.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
# Jobs to test the code base and build the client and server app
name: Build Multiplatform
on:
push:
# This is an expensive run, and we don't need it on *every single* push.
# Once when deploying a version is a good compromise.
tags:
- '*'
jobs:
# Job to build the android files on a Ubuntu host
build-android:
strategy:
matrix:
java_version:
- 17
runs-on: ubuntu-latest
name: Build Android (Java ${{ matrix.java_version }})
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
cache: 'gradle'
distribution: 'temurin'
java-version: ${{ matrix.java_version }}
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build Android debug and release files
run: |
mkdir whatsNewDirectory
echo "Nothing changed so far" > whatsNewDirectory/whatsnew-en-US
set -x
./gradlew :android:bundleDebug
./gradlew :android:assembleDebug
./gradlew :android:bundleRelease
./gradlew :android:assembleRelease
- name: Upload Android artifacts
uses: actions/upload-artifact@v4
with:
name: Android (built with Java ${{ matrix.java_version }})
path: |
android/build/outputs/apk/*/*.apk
android/build/outputs/bundle/*/*.aab
retention-days: 1
continue-on-error: true
# Job to build the desktop and server JAR files on all available platforms
build-desktop:
defaults:
run:
# Ensures that a UNIX-like shell is available (default would be Powershell on Windows)
shell: sh
name: Build Desktop for ${{ matrix.os }} (Java ${{ matrix.java_version }})
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
java_version:
- 17
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
cache: 'gradle'
distribution: 'temurin'
java-version: ${{ matrix.java_version }}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build the Desktop app
run: ./gradlew desktop:dist
- name: Build the Java server
run: ./gradlew server:dist
- name: Upload Desktop artifacts
uses: actions/upload-artifact@v4
with:
name: Desktop (built with Java ${{ matrix.java_version }})
path: desktop/build/libs/*.jar
retention-days: 1
# Only run this step on ubuntu-latest, since Java is cross-platform anyways
if: ${{ matrix.os == 'ubuntu-latest' }}
continue-on-error: true
- name: Upload Java server artifacts
uses: actions/upload-artifact@v4
with:
name: Server (built with Java ${{ matrix.java_version }})
path: server/build/libs/*.jar
retention-days: 1
# Only run this step on ubuntu-latest, since Java is cross-platform anyways
if: ${{ matrix.os == 'ubuntu-latest' }}
continue-on-error: true