forked from MrStahlfelge/Jamepad
-
Notifications
You must be signed in to change notification settings - Fork 14
179 lines (160 loc) · 8.41 KB
/
pushaction.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
name: Compile and deploy snapshot artifacts
on: [push, pull_request] # Don't worry, the actual deployment is guarded with an "if" and only done on push to master
env:
GRADLE_USER_HOME: .gradle
# Needed in order to use Node 16. Node 20 does not work with glibc 2.17
# See https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
- name: Setup Gradle
uses: gradle/[email protected]
- run: mkdir -p SDL/build-macosarm64
# No --disable-video for macOS https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c70c727c98b24ad8b44e05285b8785be15062af0
- run: ../configure --host=aarch64-apple-darwin CFLAGS="-arch arm64 -fPIC -mmacosx-version-min=10.7" CPPFLAGS="-arch arm64 -fPIC -mmacosx-version-min=10.7" LDFLAGS="-arch arm64 -mmacosx-version-min=10.7" --disable-audio --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi --disable-joystick-mfi
working-directory: SDL/build-macosarm64
- run: make -j
working-directory: SDL/build-macosarm64
- run: mkdir -p SDL/build-macos64
# No --disable-video for macOS https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c70c727c98b24ad8b44e05285b8785be15062af0
- run: ../configure CFLAGS="-arch x86_64 -fPIC -mmacosx-version-min=10.7" CPPFLAGS="-arch x86_64 -fPIC -mmacosx-version-min=10.7" LDFLAGS="-arch x86_64 -mmacosx-version-min=10.7" --disable-audio --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi --disable-joystick-mfi
working-directory: SDL/build-macos64
- run: make -j
working-directory: SDL/build-macos64
- run: sudo make install
working-directory: SDL/build-macos64
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew jnigen jnigenBuild
- name: Upload macOS natives
uses: actions/upload-artifact@v3
with:
name: macos-natives
path: libs
linux:
needs: macos
runs-on: ubuntu-20.04
container: ubuntu:18.04
env:
ORG_GRADLE_PROJECT_GITHUB_USERNAME: ""
ORG_GRADLE_PROJECT_GITHUB_API_TOKEN: ""
steps:
- name: Install dependencies into minimal dockerfile
run: |
# ubuntu dockerfile is very minimal (only 122 packages are installed)
# need to install updated git (from official git ppa)
apt update
apt install -y software-properties-common
add-apt-repository ppa:git-core/ppa -y
# install dependencies expected by other steps
apt update
apt install -y git \
curl \
ca-certificates \
wget \
bzip2 \
zip \
unzip \
xz-utils \
openjdk-11-jdk-headless \
maven \
build-essential \
ant sudo locales
# set Locale to en_US.UTF-8 (avoids hang during compilation)
locale-gen en_US.UTF-8
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "LANGUAGE=en_US.UTF-8" >> $GITHUB_ENV
echo "LC_ALL=en_US.UTF-8" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
- name: Setup Gradle
uses: gradle/[email protected]
- run: sudo sed -i 's/deb http/deb [arch=amd64,i386] http/' /etc/apt/sources.list
- run: grep "ubuntu.com/ubuntu" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list
- run: sudo sed -i 's/amd64,i386/armhf,arm64/' /etc/apt/sources.list.d/ports.list
- run: sudo sed -i 's#http://.*/ubuntu#http://ports.ubuntu.com/ubuntu-ports#' /etc/apt/sources.list.d/ports.list
- name: Add extra platform architectures
run: sudo dpkg --add-architecture i386; sudo dpkg --add-architecture armhf; sudo dpkg --add-architecture arm64
- run: sudo apt-get update
- name: Install Windows compilers
run: sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64
- name: Install Linux x86 compilers/libraries
run: sudo apt-get -yq install gcc-multilib g++-multilib linux-libc-dev:i386
- name: Install Linux arm32 compilers/libraries
run: sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
- name: Install Linux arm64 compilers/libraries
run: sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
- name: Download macOS natives
uses: actions/download-artifact@v3
with:
name: macos-natives
path: libs
- run: find -type f -name "*.h" -exec sed -i 's/extern DECLSPEC//' {} \;
working-directory: SDL
- run: sed -i 's/#define SDL_DYNAMIC_API 1/#define SDL_DYNAMIC_API 0/' SDL/src/dynapi/SDL_dynapi.h
- run: mkdir -p SDL/build-linux64
- run: ../configure CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi
working-directory: SDL/build-linux64
- run: make -j
working-directory: SDL/build-linux64
- run: mkdir -p SDL/build-linux32
- run: ../configure CFLAGS="-fPIC -m32" CPPFLAGS="-fPIC -m32" LDFLAGS="-m32" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi
working-directory: SDL/build-linux32
- run: make -j
working-directory: SDL/build-linux32
- run: mkdir -p SDL/build-linuxarm32
- run: ../configure --host=arm-linux-gnueabihf CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi
working-directory: SDL/build-linuxarm32
- run: make -j
working-directory: SDL/build-linuxarm32
- run: mkdir -p SDL/build-linuxarm64
- run: ../configure --host=aarch64-linux-gnu CFLAGS="-fPIC" CPPFLAGS="-fPIC" --disable-audio --disable-video --disable-video-vulkan --disable-render --disable-filesystem --disable-threads --disable-directx --disable-mmx --disable-3dnow --disable-sse --disable-sse2 --disable-sse3 --disable-cpuinfo --disable-sensor --enable-hidapi
working-directory: SDL/build-linuxarm64
- run: make -j
working-directory: SDL/build-linuxarm64
- run: mkdir -p SDL/build-windows32
- run: ../configure --host=i686-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi
working-directory: SDL/build-windows32
- run: make -j
working-directory: SDL/build-windows32
- run: mkdir -p SDL/build-windows64
- run: ../configure --host=x86_64-w64-mingw32 --disable-audio --disable-render --disable-power --disable-filesystem --disable-hidapi
working-directory: SDL/build-windows64
- run: make -j
working-directory: SDL/build-windows64
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew jnigen jnigenBuild jnigenJarNativesDesktop
- name: Upload all output libs
uses: actions/upload-artifact@v3
with:
name: output-libs
path: build/libs/
- name: Snapshot build
run:
./gradlew build
- name: Snapshot deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx'
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run:
./gradlew publish