Skip to content

RELEASE Build

RELEASE Build #4

Workflow file for this run

# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: RELEASE Build
on:
workflow_dispatch
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Eclipse Temurin OpenJDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build macOS natives
run: |
# See https://github.com/actions/virtual-environments/issues/2557
sudo mv /Library/Developer/CommandLineTools/SDKs/* /tmp
sudo mv /Applications/Xcode.app /Applications/Xcode.app.bak
sudo mv /Applications/Xcode_13.2.app /Applications/Xcode.app
sudo xcode-select -switch /Applications/Xcode.app
/usr/bin/xcodebuild -version
./gradlew jniGen jnigenBuildIOS jnigenBuildMacOsX64 jnigenBuildMacOsXARM64
- name: Upload macOS/iOS natives
uses: actions/upload-artifact@v2.1.4
with:
name: macos-natives
path: libs
linux:
needs: macos
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup Eclipse Temurin OpenJDK 11
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
- run: echo "http://ports.ubuntu.com/ubuntu-ports" | sudo tee -a /etc/apt/apt-mirrors.txt
- 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 || true
- name: Install Windows compilers
run: sudo apt-get -yq install g++-mingw-w64-i686 g++-mingw-w64-x86-64
- name: Install Linux cross-compilation toolchains
run: |
sudo apt-get -yq install gcc g++ gcc-multilib g++-multilib linux-libc-dev:i386
sudo apt-get -yq install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
sudo apt-get -yq install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
- name: Download macOS/iOS natives
uses: actions/download-artifact@v2.0.5
with:
name: macos-natives
path: libs
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
export NDK_HOME=$ANDROID_NDK_HOME
./gradlew jniGen jnigenBuildLinux64 jnigenBuildLinuxARM jnigenBuildLinuxARM64 jnigenBuildWindows64 jnigenBuildWindows jnigenBuildAndroid
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Release build deploy
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -PRELEASE=true -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
- name: Upload all output libs
uses: actions/upload-artifact@v2.1.4
with:
name: output-libs
path: build/libs/