attempt building on 20.04 docker, expected to fail #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
jobs: | |
macos: | |
runs-on: macos-11 | |
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:20.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: sudo 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 |