Skip to content

Commit

Permalink
Clean up workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed May 28, 2024
1 parent 1637349 commit ea5eb8d
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 51 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/build_or_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,74 +7,89 @@ jobs:
strategy:
matrix:
include:
# Win x86
- os: windows-2022
arch: x86
java_arch: x86
msvc_arch: amd64_x86
args: -DtargetArch=x86
# Win x64
- os: windows-2022
arch: x64
msvc_arch: amd64
# Win Arm64
- os: windows-2022
arch: arm64
java_arch: x64
msvc_arch: amd64_arm64
extra_java: 17
vendor: zulu
args: -DtargetArch=arm64 -DtargetJavaHomeVar=JAVA_HOME_17_ARM64

# Mac Intel (x64)
- os: macos-13
arch: x64
args: -Dtarget.java.home="$JAVA_HOME_8_X64"
args: -DtargetJavaHome="$JAVA_HOME_8_X64"
# Mac Silicon (arm64)
- os: macos-14
arch: arm64
java_arch: arm64

# Linux i386
- os: ubuntu-20.04
arch: i386
java_arch: x64
linux_arch: i386
packages: gcc-multilib
extra_java: 11
vendor: zulu
args: -Dtarget.java.home="$JAVA_HOME_11_I386" -Dtarget.arch=i386
args: -DtargetJavaHome="$JAVA_HOME_11_I386" -DtargetArch=i386
# Linux amd64 Java 8
- os: ubuntu-20.04
arch: amd64
java_arch: x64
# Linux amd64 Java 11+
- os: ubuntu-20.04
arch: amd64
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- if: (matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04') && matrix.linux_arch

# Setup build dependencies
- if: matrix.linux_arch
run: |
sudo dpkg --add-architecture ${{ matrix.linux_arch }} && sudo apt-get clean && sudo apt-get update
sudo apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install ${{ matrix.packages }} libx11-dev:${{ matrix.linux_arch }} libxrandr-dev:${{ matrix.linux_arch }} libxext-dev:${{ matrix.linux_arch }} libxcursor-dev:${{ matrix.linux_arch }} libxxf86vm-dev:${{ matrix.linux_arch }}
- if: (matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04') && matrix.arch == 'amd64'
run: sudo apt install libx11-dev libxrandr-dev libxext-dev libxcursor-dev libxxf86vm-dev
- if: matrix.os == 'windows-latest' || matrix.os == 'windows-2022'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_arch }}

# Setup target java
- if: matrix.extra_java
name: Set up ${{ matrix.arch }} ${{ matrix.vendor }} JDK ${{ matrix.extra_java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.extra_java }}
distribution: ${{ matrix.vendor }}
architecture: ${{ matrix.arch }}
- if: (matrix.os == 'ubuntu-20.04' && matrix.arch == 'amd64' && matrix.extra_java == '11') != true && matrix.java_arch

# Setup runtime java
- if: matrix.java_arch
name: Set up ${{ matrix.java_arch }} zulu JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
architecture: ${{ matrix.java_arch }}
- if: (matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04') && matrix.arch == 'amd64'
run: sudo apt install libx11-dev libxrandr-dev libxext-dev libxcursor-dev libxxf86vm-dev
- if: matrix.os == 'windows-latest' || matrix.os == 'windows-2022'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc_arch }}
- if: (matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04')
run: echo "${{ matrix.java_test_home }}"

# Build natives
- name: Build natives
run: ./gradlew compile_native ${{ matrix.args }} --stacktrace
env:
ARCHITECTURE: ${{ matrix.arch }}

- uses: actions/upload-artifact@v4
with:
name: natives-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.extra_java }}-${{ matrix.java_arch }}
Expand All @@ -97,21 +112,21 @@ jobs:
packages: gcc-aarch64-linux-gnu libc6-dev-arm64-cross g++-aarch64-linux-gnu
extra_java: 11
vendor: zulu
args: -Dtarget.java.home="$JAVA_HOME_11_AARCH64" -Dtarget.arch=aarch64
args: -DtargetJavaHome="$JAVA_HOME_11_AARCH64" -DtargetArch=aarch64
- os: ubuntu:20.04
arch: ppc64le
java_arch: x64
linux_arch: ppc64el
packages: gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross g++-powerpc64le-linux-gnu
extra_java: 11
vendor: temurin
args: -Dtarget.java.home="$JAVA_HOME_11_PPC64LE" -Dtarget.arch=ppc64le
args: -DtargetJavaHome="$JAVA_HOME_11_PPC64LE" -DtargetArch=ppc64le
- os: ubuntu:20.04
arch: riscv64
java_arch: x64
linux_arch: riscv64
packages: gcc-riscv64-linux-gnu libc6-dev-riscv64-cross g++-riscv64-linux-gnu
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-riscv64" -Dtarget.arch=riscv64
args: -DtargetJavaHome="/usr/lib/jvm/java-11-openjdk-riscv64" -DtargetArch=riscv64
continue-on-error: true
steps:
- uses: actions/checkout@v4
Expand All @@ -131,17 +146,9 @@ jobs:
java-version: ${{ matrix.extra_java }}
distribution: ${{ matrix.vendor }}
architecture: ${{ matrix.arch }}
- if: (matrix.os == 'ubuntu-20.04' && matrix.arch == 'amd64' && matrix.extra_java == '11') != true
name: Set up ${{ matrix.java_arch }} zulu JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
architecture: ${{ matrix.java_arch }}
- name: Build natives
run: ./gradlew compile_native ${{ matrix.args }} --stacktrace
env:
ARCHITECTURE: ${{ matrix.arch }}
TARGET_JAVA: /usr/lib/jvm/java-11-openjdk-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
Expand All @@ -156,11 +163,11 @@ jobs:
- arch: armhf
image: oldstable-backports
packages: gcc-arm-linux-gnueabihf libc6-dev-armhf-cross g++-arm-linux-gnueabihf
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-armhf" -Dtarget.arch=armhf
args: -DtargetJavaHome="/usr/lib/jvm/java-11-openjdk-armhf" -DtargetArch=armhf
- arch: armel
image: oldstable-backports
packages: gcc-arm-linux-gnueabi libc6-dev-armel-cross g++-arm-linux-gnueabi
args: -Dtarget.java.home="/usr/lib/jvm/java-11-openjdk-armel" -Dtarget.arch=armel
args: -DtargetJavaHome="/usr/lib/jvm/java-11-openjdk-armel" -DtargetArch=armel
# - arch: powerpc
# image: sid
# packages: gcc-powerpc-linux-gnu libc6-dev-powerpc-cross g++-powerpc-linux-gnu
Expand All @@ -183,16 +190,9 @@ jobs:
- run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install ${{ matrix.packages }}
- run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install libx11-dev:${{ matrix.arch }} libxrandr-dev:${{ matrix.arch }} libxext-dev:${{ matrix.arch }} libxcursor-dev:${{ matrix.arch }} libxxf86vm-dev:${{ matrix.arch }}
- run: apt-get -yq -f --allow-unauthenticated --no-install-suggests --no-install-recommends install openjdk-11-jdk:${{ matrix.arch }}
- name: Set up x64 zulu JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
architecture: x64
- name: Build natives
run: ./gradlew compile_native ${{ matrix.args }} --stacktrace
env:
ARCHITECTURE: ${{ matrix.arch }}
TARGET_JAVA: /usr/lib/jvm/java-11-openjdk-${{ matrix.arch }}
- uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions gradle/linux.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
def ENV = System.getenv()

def os_arch = getArch(System.getProperty("os.arch"))
def target_arch = getArch(System.getProperty("target.arch", os_arch))
def target_arch = getArch(System.getProperty("targetArch", os_arch))

def java_home = System.getProperty("target.java.home", System.getProperty("java.home"))
def java_version = System.getProperty("target.java.version", System.getProperty("java.version"))
def java_home = System.getProperty("targetJavaHome", System.getProperty("java.home"))
def java_version = System.getProperty("targetJavaVersion", System.getProperty("java.version"))

def extra_suffix = ""

Expand Down
12 changes: 2 additions & 10 deletions gradle/macosx.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import org.apache.tools.ant.taskdefs.condition.Os
def ENV = System.getenv()

def os_arch = getArch(System.getProperty("os.arch"))
def target_arch = getArch(System.getProperty("target.arch", os_arch))
def target_arch = getArch(System.getProperty("targetArch", os_arch))

def java_home = System.getProperty("target.java.home", System.getProperty("java.home"))
def java_home = System.getProperty("targetJavaHome", System.getProperty("java.home"))

def javavmroot = java_home

Expand Down Expand Up @@ -34,14 +34,6 @@ try {
ignored.printStackTrace()
}

if (developer_path == "/Developer" && ENV.ARCHITECTURE) {
developer_path = (ENV.XCODE_13_DEVELOPER_DIR ? ENV.XCODE_13_DEVELOPER_DIR : (
ENV.XCODE_14_DEVELOPER_DIR ? ENV.XCODE_14_DEVELOPER_DIR : (
ENV.XCODE_15_DEVELOPER_DIR ? ENV.XCODE_15_DEVELOPER_DIR : "/Developer"
)
))
}



def sdk_path = "Platforms/MacOSX.platform/Developer/SDKs"
Expand Down
8 changes: 4 additions & 4 deletions gradle/windows.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ if (alternative_java_home != null && alternative_java_home != "") {
}

def sdkhome = ENV.VCToolsInstallDir ? ENV.VCToolsInstallDir : ENV.MSVC
def sdkhomelib = sdkhome + "/lib/x64"
def sdkhomelib = sdkhome + "/lib"

if (target_arch == "i386") {
sdkhomelib = sdkhome + "/lib"
if (target_arch == "amd64") {
sdkhomelib = sdkhomelib + "/x64"
} else if (target_arch == "aarch64") {
sdkhomelib = sdkhome + "/lib/arm64"
sdkhomelib = sdkhomelib + "/arm64"
}

def dllname = "lwjgl-windows-${target_arch}.dll"
Expand Down

0 comments on commit ea5eb8d

Please sign in to comment.