forked from LWJGL-CI/lwjgl3
-
Notifications
You must be signed in to change notification settings - Fork 3
232 lines (227 loc) · 7.65 KB
/
CI.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
# TODO: https://github.blog/changelog/2022-08-09-github-actions-the-ubuntu-18-04-actions-runner-image-is-being-deprecated-and-will-be-removed-by-12-1-22/
name: LWJGL Build
on: [workflow_dispatch]
env:
ANT_OPTS: -Xmx2G
LWJGL_BUILD_TYPE: nightly
jobs:
linux-cross:
name: Linux Cross
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ARCH: [arm32, arm64]
include:
- ARCH: arm32
PACKAGES: gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libc6-dev-armhf-cross rename
CROSS_ARCH: armhf
CROSS_PACKAGES: libgtk-3-dev:armhf libatk-bridge2.0-dev:armhf libgdk-pixbuf2.0-dev:armhf libglu-dev:armhf libgl1-mesa-glx:armhf libx11-dev:armhf
NATIVE_PARAMS: -Dgcc.libpath.opengl=/usr/lib/arm-linux-gnueabihf/mesa
- ARCH: arm64
PACKAGES: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross rename
CROSS_ARCH: arm64
CROSS_PACKAGES: libgtk-3-dev:arm64 libatk-bridge2.0-dev:arm64 libgdk-pixbuf2.0-dev:arm64 libglu-dev:arm64 libgl1-mesa-glx:arm64 libx11-dev:arm64
NATIVE_PARAMS: -Dgcc.libpath.opengl=/usr/lib/aarch64-linux-gnu/mesa
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- run: |
wget https://gist.github.com/hakerdefo/9c99e140f543b5089e32176fe8721f5f/raw/7ac6ccf882bb0d39297962f0baedce5721c9be65/sources.list
sudo cp sources.list /etc/apt/sources.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -yq install ${{matrix.PACKAGES}}
name: Install dependencies
- run: ${PWD}/refactor/Linux.sh
shell: bash
name : Refactor to org.lwjgl3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
name: Install JDK 17
- run: |
sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
sudo grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list
sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list
sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list
sudo dpkg --add-architecture ${{matrix.CROSS_ARCH}}
sudo apt-get clean
sudo apt-get update || true
name: Prepare cross-compilation
- run: sudo apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install ${{matrix.CROSS_PACKAGES}} -o Dpkg::Options::="--force-overwrite"
name: Install cross-compilation dependencies
- run: ant -emacs compile-templates clean-generated generate
name: Hydrate generator
- run: ant -emacs compile
name: Build Java
- run: ant -emacs compile-native ${{matrix.NATIVE_PARAMS}}
name: Build native
- run: |
find ./bin/libs/native
name : Try list natives files
- uses: actions/upload-artifact@v3
with:
path: |
bin/libs/native
name: Linux-${{matrix.ARCH}}
macos:
name: macOS
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
ARCH: [x64, arm64]
env:
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
name: Install JDK 17
- run: |
brew update
brew install rename
name: Install script dependency
- run: ${PWD}/refactor/MacOS.sh
shell: bash
name : Refactor to org.lwjgl3
- run: ant -emacs compile-templates clean-generated generate
name: Hydrate generator
- run: ant -emacs compile
name: Build Java
- run: ant -emacs compile-native
name: Build native
- run: ant -emacs tests
name: Run tests
if: contains(matrix.ARCH, 'arm') != true
- uses: actions/upload-artifact@v3
with:
path: |
bin/libs/native
name: MacOS-${{matrix.ARCH}}
windows:
name: Windows
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ARCH: [x86, x64, arm64]
include:
- ARCH: x86
JDK: zulu8.68.0.21-ca-fx-jdk8.0.362-win_i686
MSVC_ARCH: amd64_x86
- ARCH: x64
JDK: zulu8.68.0.21-ca-fx-jdk8.0.362-win_x64
MSVC_ARCH: amd64
- ARCH: arm64
JDK: zulu8.68.0.21-ca-fx-jdk8.0.362-win_x64
MSVC_ARCH: amd64_arm64
env:
ANT_OPTS: -Xmx2G
JAVA_HOME: ${{matrix.JDK}}
LWJGL_BUILD_ARCH: ${{matrix.ARCH}}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.MSVC_ARCH }}
- run: git clone https://github.com/LWJGL-CI/OculusSDK.git ../OculusSDK
name: Clone Oculus SDK
if: contains(matrix.ARCH, 'arm') != true
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
name: Install JDK 17
- run: .\refactor\Windows.ps1
shell: pwsh
name : Refactor to org.lwjgl3
- run: ant -emacs compile-templates clean-generated generate
shell: cmd
name: Generate bindings
- run: ant -emacs compile
shell: cmd
name: Build Java
- run: ant -emacs compile-native
shell: cmd
name: Build native
- uses: actions/upload-artifact@v3
with:
path: |
.\bin\libs\native
name: Windows-${{matrix.ARCH}}
linux:
name: Linux and everything
needs: [linux-cross, macos, windows]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ARCH: [x64]
include:
- ARCH: x64
PACKAGES: libx11-dev libxt-dev libgtk-3-dev
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 3
- run: |
sudo apt-get update
sudo apt-get -yq install ${{matrix.PACKAGES}} build-essential ant rename
name: Install LWJGL dependencies
- run: ${PWD}/refactor/Linux.sh
shell: bash
name : Refactor to org.lwjgl3
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
name: Install JDK 8
- run: echo $JAVA_HOME
name: Print java home
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
name: Install JDK 17
- run: |
git config --global --add safe.directory $PWD
ant -emacs compile-templates clean-generated generate
name: Hydrate generator
- run: ant -emacs compile
name: Build Java
- run: |
ant -emacs compile-native
name: Build native
- uses: actions/download-artifact@v3
with:
name: artifact
path: bin/libs/native
- name: Download custom glfw lib
run: |
wget https://github.com/CleanroomMC/glfw/releases/download/3.4.1/artifact.zip
unzip artifact.zip -d bin/libs/native/
- run: JAVA8_HOME=/opt/hostedtoolcache/Java_Zulu_jdk/8.0.362-9/x64 LWJGL_BUILD_OFFLINE=true ant -emacs release
name: Try Releasing
- run: |
find ./bin/RELEASE
name : List jar files
- run: |
ant -emacs tests
name: Run tests
- uses: actions/upload-artifact@v3
with:
path: |
bin/RELEASE/
name: Upload jars