Skip to content

[cd skip] Update release workflow #74

[cd skip] Update release workflow

[cd skip] Update release workflow #74

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: SNAPSHOT Build
on:
push:
branches: [ master ]
jobs:
macos:
if: "!contains(github.event.head_commit.message, 'cd skip')"
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:
if: "!contains(github.event.head_commit.message, 'cd skip')"
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: Publish SNAPSHOT artifacts
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew publish -PSNAPSHOT=true
- name: Upload all output libs
uses: actions/upload-artifact@v2.1.4
with:
name: output-libs
path: build/libs/