Skip to content

Update README.md

Update README.md #63

Workflow file for this run

name: CI
on:
push:
branches: '*'
tags: '*'
pull_request:
jobs:
linux-x86-natives:
runs-on: ubuntu-latest
container: ubuntu:18.04
steps:
- name: Install curl & newer git
run: |
apt update
apt install software-properties-common -y
add-apt-repository ppa:git-core/ppa -y
apt update
apt install curl git -y
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache natives
uses: actions/cache@v2
id: cache-natives
with:
path: |
src/main/resources/natives/linux-x86
src/main/resources/natives/linux-x86-64
src/main/resources/natives/linux-musl-x86-64
key: linux-x86-${{ hashFiles('natives/**') }}
- name: Set up JDK
uses: actions/setup-java@v1
if: steps.cache-natives.outputs.cache-hit != 'true'
with:
java-version: 15
- name: Install x86 compilers
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
apt update
apt install libc6-dev-i386 linux-libc-dev g++-multilib -y
curl -sL https://github.com/natanbc/actions-binaries/releases/download/1/x86_64-linux-musl-cross.tgz -o - | tar xzf -
- name: Build x86 natives
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
git config --global --add safe.directory '*'
chmod +x gradlew
export PATH="$PATH:$(pwd)/x86_64-linux-musl-cross/bin"
./gradlew buildLinuxGlibc32 buildLinuxGlibc64 buildLinuxMusl64
- uses: actions/upload-artifact@v2
with:
name: linux-x86-natives
path: src/main/resources/natives/*
linux-arm-natives:
runs-on: ubuntu-latest
container: ubuntu:18.04
env:
TZ: Etc/UTC
DEBIAN_FRONTEND: noninteractive
steps:
- uses: actions/checkout@v2
- name: Cache natives
uses: actions/cache@v2
id: cache-natives
with:
path: |
src/main/resources/natives/linux-arm
src/main/resources/natives/linux-aarch64
src/main/resources/natives/linux-musl-aarch64
key: linux-arm-${{ hashFiles('natives/**') }}
- name: Set up JDK
uses: actions/setup-java@v3
if: steps.cache-natives.outputs.cache-hit != 'true'
with:
distribution: zulu
java-version: 13
- name: Install ARM compilers
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
# installing these two breaks i386 compilation
# https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1300211
apt update
apt install curl git -y
apt install g++-arm-linux-gnueabihf -y
apt install g++-aarch64-linux-gnu -y
curl -sL https://github.com/natanbc/actions-binaries/releases/download/1/aarch64-linux-musl-cross.tgz -o - | tar xzf -
- name: Build ARM natives
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
chmod +x gradlew
export PATH="$PATH:$(pwd)/aarch64-linux-musl-cross/bin"
./gradlew buildLinuxGlibcArm buildLinuxGlibcAarch64 buildLinuxMuslAarch64
- uses: actions/upload-artifact@v2
with:
name: linux-arm-natives
path: src/main/resources/natives/*
mac-natives:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache natives
uses: actions/cache@v2
id: cache-natives
with:
path: |
src/main/resources/natives/darwin
key: mac-${{ hashFiles('natives/**') }}
- name: Set up JDK
uses: actions/setup-java@v1
if: steps.cache-natives.outputs.cache-hit != 'true'
with:
java-version: 15
- name: Build darwin natives
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
chmod +x gradlew
./gradlew buildDarwin
- uses: actions/upload-artifact@v2
with:
name: mac-natives
path: src/main/resources/natives/*
windows-natives:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Cache natives
uses: actions/cache@v2
id: cache-natives
with:
path: |
src/main/resources/natives/win-x86
src/main/resources/natives/win-x86-64
key: win-${{ hashFiles('natives/**') }}
- name: Set up JDK
uses: actions/setup-java@v1
if: steps.cache-natives.outputs.cache-hit != 'true'
with:
java-version: 15
- name: Build natives
if: steps.cache-natives.outputs.cache-hit != 'true'
run: |
.\gradlew.bat buildWin
- uses: actions/upload-artifact@v2
with:
name: windows-natives
path: src/main/resources/natives/*
build:
needs: [linux-x86-natives, linux-arm-natives, mac-natives, windows-natives]
runs-on: ubuntu-20.04
env:
MAVEN_USERNAME: ${{ vars.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
steps:
- uses: actions/checkout@v2
- run: mkdir -p src/main/resources/natives
- uses: actions/download-artifact@v2
with:
name: linux-x86-natives
path: src/main/resources/natives/
- uses: actions/download-artifact@v2
with:
name: linux-arm-natives
path: src/main/resources/natives/
- uses: actions/download-artifact@v2
with:
name: mac-natives
path: src/main/resources/natives/
- uses: actions/download-artifact@v2
with:
name: windows-natives
path: src/main/resources/natives/
- name: Compile java
run: |
chmod +x gradlew
# this builds the java code without building the natives
./gradlew publishToMavenLocal
- uses: actions/upload-artifact@v2
with:
name: jar
path: build/libs/*.jar
- name: Maven upload
run: ./gradlew publish -PMAVEN_USERNAME=$MAVEN_USERNAME -PMAVEN_PASSWORD=$MAVEN_PASSWORD