-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (116 loc) · 4.42 KB
/
build-test.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
name: Build Test
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
makeLinux:
name: "Make Natives - Linux"
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup C++
uses: aminya/setup-cpp@v1
with:
compiler: gcc
- name: Setup Dependencies
run: |
sudo dpkg --add-architecture amd64
sudo dpkg --add-architecture i386
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
sudo rm /etc/apt/sources.list
echo "deb [arch=amd64,i386] http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -sc) main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu.list
echo "deb [arch=amd64,i386] http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -sc)-updates main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu-updates.list
echo "deb [arch=amd64,i386] http://azure.archive.ubuntu.com/ubuntu/ $(lsb_release -sc)-security main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu-security.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc) main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu-ports.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc)-updates main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu-ports-updates.list
echo "deb [arch=arm64,armhf] http://azure.ports.ubuntu.com/ubuntu-ports/ $(lsb_release -sc)-security main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/ubuntu-ports-security.list
sudo apt-get update -y
sudo apt-get install -y gcc:amd64 g++:amd64 gcc-i686-linux-gnu:amd64 g++-i686-linux-gnu:amd64 gcc-aarch64-linux-gnu:amd64 g++-aarch64-linux-gnu:amd64 gcc-arm-linux-gnueabihf:amd64 g++-arm-linux-gnueabihf:amd64
sudo apt-get install -y libx11-dev:amd64 libxrandr-dev:amd64 libx11-dev:i386 libxrandr-dev:i386 libx11-dev:arm64 libxrandr-dev:arm64 libx11-dev:armhf libxrandr-dev:armhf
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Compile Natives
run: ./gradlew make
- name: Upload Natives
uses: actions/upload-artifact@v4
with:
name: "linux-natives"
path: |
build/natives/*.so
makeWindows:
name: "Make Natives - Windows"
runs-on: windows-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup C++
uses: aminya/setup-cpp@v1
with:
compiler: msvc
vcvarsall: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Compile Natives
run: ./gradlew make
- name: Upload Natives
uses: actions/upload-artifact@v4
with:
name: "windows-natives"
path: |
build/natives/*.dll
build:
name: "Build"
needs: [ makeLinux, makeWindows ]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Download Natives
uses: actions/download-artifact@v4
with:
pattern: "*-natives"
path: artifacts/
merge-multiple: true
- name: Extract Natives
run: |
ls artifacts/
mkdir -p build/natives/
cp artifacts/*/* build/natives/
ls build/natives/
- name: Build Artifacts
run: ./gradlew build
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: "builds"
path: |
build/libs/SRD-*-client.jar
build/libs/SRD-*-server.jar
build/libs/SRD-*-manager.jar