|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: CI |
| 4 | + |
| 5 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 6 | +# events but only for the master branch |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [ master,development ] |
| 10 | + pull_request: |
| 11 | + branches: [ master,development ] |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} |
| 16 | + |
| 17 | +jobs: |
| 18 | + |
| 19 | + build_mac_java: |
| 20 | + timeout-minutes: 30 |
| 21 | + runs-on: macos-14 |
| 22 | + steps: |
| 23 | + - name: Install common dependencies |
| 24 | + run: | |
| 25 | + brew install googletest |
| 26 | + pip install trimesh pytest maven |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - uses: jwlawson/actions-setup-cmake@v2 |
| 29 | + with: |
| 30 | + cmake-version: 4.0.2 |
| 31 | + - name: Install Java and Maven |
| 32 | + run: | |
| 33 | + wget https://cdn.azul.com/zulu/bin/zulu21.46.19-ca-fx-jdk21.0.9-macosx_aarch64.tar.gz |
| 34 | + tar -xzf zulu21.46.19-ca-fx-jdk21.0.9-macosx_aarch64.tar.gz |
| 35 | + echo "JAVA_HOME=$(pwd)/zulu21.46.19-ca-fx-jdk21.0.9-macosx_aarch64" >> $GITHUB_ENV |
| 36 | + echo "PATH=$(pwd)/zulu21.46.19-ca-fx-jdk21.0.9-macosx_aarch64/bin:$PATH" >> $GITHUB_ENV |
| 37 | + - name: Build |
| 38 | + run: | |
| 39 | + mkdir build |
| 40 | + cd build |
| 41 | + cmake -DMANIFOLD_CROSS_SECTION=ON -DMANIFOLD_USE_BUILTIN_CLIPPER2=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DMANIFOLD_STRICT=ON -DMANIFOLD_USE_BUILTIN_TBB=ON -DMANIFOLD_DEBUG=ON -DMANIFOLD_ASSERT=ON -DMANIFOLD_PYBIND=OFF -DMANIFOLD_PAR=ON .. && make |
| 42 | + cd .. |
| 43 | + mkdir -p ./bindings/java/src/main/resources/manifold3d/natives/mac-arm64/ |
| 44 | + ls -al ./build/src/ |
| 45 | + cp ./build/src/libmanifold.dylib ./bindings/java/src/main/resources/manifold3d/natives/mac-arm64/ |
| 46 | + cp ./build/bindings/c/libmanifoldc.dylib ./bindings/java/src/main/resources/manifold3d/natives/mac-arm64/ |
| 47 | + mvn test --file bindings/java/pom.xml |
| 48 | + - name: Upload native libraries |
| 49 | + uses: actions/upload-artifact@v4 |
| 50 | + with: |
| 51 | + name: native-libs-mac-arm64 |
| 52 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 53 | + build_linux_java_ARM: |
| 54 | + name: JAVA Linux_ARM Build |
| 55 | + timeout-minutes: 45 |
| 56 | + runs-on: ubuntu-24.04-arm |
| 57 | + env: |
| 58 | + CC: gcc-14 |
| 59 | + CXX: g++-14 |
| 60 | + steps: |
| 61 | + - uses: actions/setup-python@v5 |
| 62 | + with: |
| 63 | + python-version: '3.x' |
| 64 | + - name: Install dependencies |
| 65 | + run: | |
| 66 | + sudo apt-get update |
| 67 | + sudo apt-get install libgtest-dev libassimp-dev git libtbb-dev pkg-config libpython3-dev lcov |
| 68 | + python -m pip install -U trimesh pytest |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + - uses: jwlawson/actions-setup-cmake@v2 |
| 71 | + with: |
| 72 | + cmake-version: 4.0.2 |
| 73 | + - name: Pull a JavaFX JDK |
| 74 | + run: wget https://cdn.azul.com/zulu/bin/zulu21.46.19-ca-fx-jdk21.0.9-linux_aarch64.tar.gz |
| 75 | + |
| 76 | + - name: Set Java |
| 77 | + uses: actions/setup-java@v1 |
| 78 | + with: |
| 79 | + java-version: 21 |
| 80 | + jdkFile: ./zulu21.46.19-ca-fx-jdk21.0.9-linux_aarch64.tar.gz |
| 81 | + - name: Build With parallelization |
| 82 | + run: | |
| 83 | + bash bindings/java/scripts/linux/buildC-arm.sh |
| 84 | + mvn test --file bindings/java/pom.xml |
| 85 | + - name: Upload native libraries |
| 86 | + uses: actions/upload-artifact@v4 |
| 87 | + with: |
| 88 | + name: native-libs-linux-arm64 |
| 89 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 90 | + build_linux_java_x86: |
| 91 | + name: JAVA Linux_x86 Build |
| 92 | + timeout-minutes: 45 |
| 93 | + runs-on: ubuntu-24.04 |
| 94 | + env: |
| 95 | + CC: gcc-14 |
| 96 | + CXX: g++-14 |
| 97 | + steps: |
| 98 | + - uses: actions/setup-python@v5 |
| 99 | + with: |
| 100 | + python-version: '3.x' |
| 101 | + - name: Install dependencies |
| 102 | + run: | |
| 103 | + sudo apt-get update |
| 104 | + sudo apt-get install libgtest-dev libassimp-dev git libtbb-dev pkg-config libpython3-dev lcov |
| 105 | + python -m pip install -U trimesh pytest |
| 106 | + - uses: actions/checkout@v4 |
| 107 | + - uses: jwlawson/actions-setup-cmake@v2 |
| 108 | + with: |
| 109 | + cmake-version: 4.0.2 |
| 110 | + - name: Pull a JavaFX JDK |
| 111 | + run: wget https://cdn.azul.com/zulu/bin/zulu21.46.19-ca-fx-jdk21.0.9-linux_x64.tar.gz |
| 112 | + |
| 113 | + - name: Set Java |
| 114 | + uses: actions/setup-java@v1 |
| 115 | + with: |
| 116 | + java-version: 21 |
| 117 | + jdkFile: ./zulu21.46.19-ca-fx-jdk21.0.9-linux_x64.tar.gz |
| 118 | + - name: Build With parallelization |
| 119 | + run: | |
| 120 | + bash bindings/java/scripts/linux/buildC.sh |
| 121 | + mvn test --file bindings/java/pom.xml |
| 122 | + - name: Upload native libraries |
| 123 | + uses: actions/upload-artifact@v4 |
| 124 | + with: |
| 125 | + name: native-libs-linux-x86 |
| 126 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 127 | + build_windows_java_x86: |
| 128 | + name: Windows JAVA |
| 129 | + timeout-minutes: 30 |
| 130 | + runs-on: windows-2025 |
| 131 | + steps: |
| 132 | + - uses: actions/checkout@v4 |
| 133 | + - uses: jwlawson/actions-setup-cmake@v2 |
| 134 | + with: |
| 135 | + cmake-version: 4.0.2 |
| 136 | + - uses: ilammy/msvc-dev-cmd@v1 |
| 137 | + - name: Pull a JavaFX JDK |
| 138 | + run: curl -O https://cdn.azul.com/zulu/bin/zulu21.46.19-ca-fx-jdk21.0.9-win_x64.zip |
| 139 | + |
| 140 | + - name: Set Java |
| 141 | + uses: actions/setup-java@v1 |
| 142 | + with: |
| 143 | + java-version: 21 |
| 144 | + jdkFile: ./zulu21.46.19-ca-fx-jdk21.0.9-win_x64.zip |
| 145 | + - name: Build for Java |
| 146 | + shell: powershell |
| 147 | + run: | |
| 148 | + cmake . -DMANIFOLD_CROSS_SECTION=ON -DMANIFOLD_USE_BUILTIN_CLIPPER2=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DMANIFOLD_STRICT=ON -DMANIFOLD_USE_BUILTIN_TBB=ON -DMANIFOLD_DEBUG=ON -DMANIFOLD_ASSERT=ON -DMANIFOLD_PAR=ON -A x64 -B build |
| 149 | + cd build |
| 150 | + cmake --build . --target ALL_BUILD --config Release |
| 151 | + cd .. |
| 152 | + mkdir -p bindings\java\src\main\resources\manifold3d\natives\win-x86_64\ |
| 153 | + Get-ChildItem -Path . -Recurse -Filter *.dll | Select-Object -ExpandProperty FullName |
| 154 | + cp build\lib\Release\manifold.dll bindings\java\src\main\resources\manifold3d\natives\win-x86_64\ |
| 155 | + cp build\lib\Release\manifoldc.dll bindings\java\src\main\resources\manifold3d\natives\win-x86_64\ |
| 156 | + mvn test --file bindings/java/pom.xml |
| 157 | + - name: Upload native libraries |
| 158 | + uses: actions/upload-artifact@v4 |
| 159 | + with: |
| 160 | + name: native-libs-windows-x86 |
| 161 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 162 | + deploy_java: |
| 163 | + runs-on: ubuntu-latest |
| 164 | + needs: [ build_linux_java_x86,build_linux_java_ARM,build_windows_java_x86 ,build_mac_java] |
| 165 | + steps: |
| 166 | + - uses: actions/checkout@v4 |
| 167 | + - name: Download native libraries |
| 168 | + uses: actions/download-artifact@v4 |
| 169 | + with: |
| 170 | + name: native-libs-mac-arm64 |
| 171 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 172 | + - name: Download native libraries |
| 173 | + uses: actions/download-artifact@v4 |
| 174 | + with: |
| 175 | + name: native-libs-linux-arm64 |
| 176 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 177 | + - name: Download native libraries |
| 178 | + uses: actions/download-artifact@v4 |
| 179 | + with: |
| 180 | + name: native-libs-windows-x86 |
| 181 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 182 | + - name: Download native libraries |
| 183 | + uses: actions/download-artifact@v4 |
| 184 | + with: |
| 185 | + name: native-libs-linux-x86 |
| 186 | + path: bindings/java/src/main/resources/manifold3d/natives/ |
| 187 | + - name: List shared libraries |
| 188 | + run: | |
| 189 | + ls -al bindings/java/src/main/resources/manifold3d/natives/ |
| 190 | + ls -al bindings/java/src/main/resources/manifold3d/natives/linux-x86_64 |
| 191 | + ls -al bindings/java/src/main/resources/manifold3d/natives/linux-arm64 |
| 192 | + ls -al bindings/java/src/main/resources/manifold3d/natives/win-x86_64 |
| 193 | + ls -al bindings/java/src/main/resources/manifold3d/natives/mac-arm64 |
| 194 | + - name: Pull a JavaFX JDK |
| 195 | + run: wget https://cdn.azul.com/zulu/bin/zulu21.46.19-ca-fx-jdk21.0.9-linux_x64.tar.gz |
| 196 | + |
| 197 | + - name: Set Java |
| 198 | + uses: actions/setup-java@v1 |
| 199 | + with: |
| 200 | + java-version: 21 |
| 201 | + jdkFile: ./zulu21.46.19-ca-fx-jdk21.0.9-linux_x64.tar.gz |
| 202 | + - name: Build Jar |
| 203 | + run: | |
| 204 | + ls -al bindings/java/scripts/ |
| 205 | + export VERSION=$(bash bindings/java/scripts/findVersion.sh) |
| 206 | + bash bindings/java/scripts/clojar.sh |
| 207 | + env: |
| 208 | + CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }} |
| 209 | + CLOJARS_TOKEN: ${{ secrets.CLOJARS_TOKEN }} |
0 commit comments