Skip to content

Build zed-java-api natives #62

Build zed-java-api natives

Build zed-java-api natives #62

Workflow file for this run

name: Build zed-java-api natives
on:
workflow_dispatch:
permissions:
contents: write
# For the Linux builds, see https://www.stereolabs.com/docs/docker/building-arm-container-on-x86
jobs:
# build-linux-x86_64:
# runs-on: [ubuntu-22.04]
# container:
# image: stereolabs/zed:5.1-devel-cuda12.8-ubuntu22.04
# steps:
# - name: Install dependencies
# run: |
# apt-get update
# apt-get install git wget curl build-essential -y
# - uses: actions/checkout@v6
# - name: Mark workspace as safe
# run: |
# git config --global --add safe.directory "$GITHUB_WORKSPACE"
# - uses: actions/setup-java@v4
# with:
# distribution: 'temurin'
# java-version: '17'
# - name: Compile native library (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 (x86_64)'
# push: true
# build-linux-l4t:
# runs-on: [ubuntu-22.04-arm]
# container:
# image: stereolabs/zed:5.1-devel-l4t-r35.4
# needs: [build-linux-x86_64]
# steps:
# - name: Install dependencies
# run: |
# apt-get update
# apt-get install git wget curl build-essential openjdk-17-jdk -y
## Cannot use for now, see https://github.com/actions/setup-node/issues/922
## - uses: actions/checkout@v4
# - name: Checkout
# run: |
# mkdir -p /work && cd /work
# git clone https://github.com/ihmcrobotics/zed-java-api
# cd zed-java-api
# git checkout ${{ github.ref_name }}
## Cannot use for now, see https://github.com/actions/setup-node/issues/922
## - uses: actions/setup-java@v4
## with:
## distribution: 'temurin'
## java-version: '17'
# - name: Compile native library (arm64)
# run: |
# cd /work/zed-java-api
# LINUX_CROSS_COMPILE_ARM=1 bash cppbuild.bash
# - name: Commit generated java and native libraries
# run: |
# git config --global user.name 'ihmc-rosie'
# git config --global user.email 'rosie@ihmc.us'
# git config --global url."https://github.com/".insteadOf git@github.com:
# cd /work/zed-java-api
# git remote set-url origin https://${{ secrets.ROSIE_PERSONAL_ACCESS_TOKEN }}@github.com/ihmcrobotics/zed-java-api.git
# git add *.so
# git commit -m 'Rebuild natives for Linux (arm64)'
# git push
## Cannot use for now, see https://github.com/actions/setup-node/issues/922
## - name: Commit generated java and native libraries
## uses: EndBug/add-and-commit@v9
## with:
## add: '*.so' # Only commit generated java from Linux x86_64
## author_name: ihmc-rosie
## author_email: rosie@ihmc.us
## message: 'Rebuild natives for Linux (arm64)'
## push: true
# - name: Clean workspace
# if: ${{ always() }}
# run: rm -rf /work/*
build-windows:
runs-on: [windows-2022]
# needs: [build-linux-l4t]
steps:
- uses: actions/checkout@v6
- name: Pull repo
run: |
git reset --hard
git pull
- uses: Jimver/cuda-toolkit@v0.2.29
id: cuda-toolkit
with:
cuda: '12.8.0'
method: 'network'
- name: Install dependencies
run: |
python -m pip install gdown
gdown https://drive.google.com/uc?id=1s0Pec1WOa10ZU6yaIG0xdH45VcTF24M1
tar -xvf ZEDSDK-Windows-5.1.2.tar.gz -C "C:\\Program Files (x86)"
- uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: 2022
- 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