Build ihmc-matrix-library natives #1
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: Build ihmc-matrix-library natives | |
on: | |
workflow_dispatch: | |
jobs: | |
build-linux: | |
runs-on: [ubuntu-20.04] | |
strategy: | |
matrix: | |
platform: [x86_64, arm64] | |
max-parallel: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull repo | |
run: | | |
git reset --hard | |
git pull | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install build-essential g++ gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu cmake git swig -y | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Check Java/Gradle versions | |
run: | | |
java --version | |
gradle --version | |
- name: Compile native library (arm64) | |
if: matrix.platform == 'arm64' | |
run: | | |
LINUX_CROSS_COMPILE_ARM=1 bash cppbuild.bash | |
- name: Compile native library (x86_64) | |
if: matrix.platform == 'x86_64' | |
run: | | |
bash cppbuild.bash | |
- name: Commit generated java and native libraries | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.java *.so' # Only commit generated java from Linux | |
author_name: ihmc-rosie | |
author_email: rosie@ihmc.us | |
message: 'Rebuild natives for Linux' | |
push: true | |
build-windows: | |
runs-on: [windows-2019] | |
needs: [build-linux] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull repo | |
run: | | |
git reset --hard | |
git pull | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
vsversion: 2019 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Check Java/Gradle versions | |
run: | | |
java --version | |
gradle --version | |
- name: Compile native library | |
run: | | |
bash.exe cppbuild.bash | |
- name: Commit native libraries | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.dll' # Only commit generated java from Linux | |
author_name: ihmc-rosie | |
author_email: rosie@ihmc.us | |
message: 'Rebuild natives for Windows' | |
push: true | |
build-macos: | |
runs-on: [macos-12] | |
needs: [build-windows] | |
strategy: | |
matrix: | |
platform: [x86_64, arm64] | |
max-parallel: 1 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull repo | |
run: | | |
git reset --hard | |
git pull | |
- name: Install dependencies | |
run: | | |
brew install coreutils | |
sudo xcode-select --switch /Applications/Xcode_13.1.app | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Check Java/Gradle versions | |
run: | | |
java --version | |
gradle --version | |
- name: Compile native library (arm64) | |
if: matrix.platform == 'arm64' | |
run: | | |
MAC_CROSS_COMPILE_ARM=1 bash cppbuild.bash | |
- name: Compile native library (x86_64) | |
if: matrix.platform == 'x86_64' | |
run: | | |
bash cppbuild.bash | |
- name: Commit generated java and native libraries | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: '*.jnilib' # Only commit generated java from Linux | |
author_name: ihmc-rosie | |
author_email: rosie@ihmc.us | |
message: 'Rebuild natives for macOS' | |
push: true |