-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from clEsperanto/deploy-to-scijava
Deploy to scijava
- Loading branch information
Showing
27 changed files
with
862 additions
and
65 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-build.sh | ||
sh ci-build.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
curl -fsLO https://raw.githubusercontent.com/scijava/scijava-scripts/main/ci-setup-github-actions.sh | ||
sh ci-setup-github-actions.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,164 @@ | ||
--- | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
- deploy-to-scijava | ||
tags: | ||
- "*-[0-9]+.*" | ||
paths-ignore: | ||
- .github/workflows/build_fast.yaml | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
branches: | ||
- main | ||
env: | ||
opencl-icd-loader-git-tag: "v2023.04.17" | ||
opencl-headers-git-tag: "v2023.04.17" | ||
|
||
opencl-icd-loader-git-tag: v2023.04.17 | ||
opencl-headers-git-tag: v2023.04.17 | ||
jobs: | ||
build: | ||
build-os: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
name: [ubuntu, windows, macos] | ||
name: | ||
- ubuntu | ||
- windows | ||
- macos | ||
include: | ||
- name: ubuntu | ||
os: ubuntu-latest | ||
c-compiler: "gcc" | ||
cxx-compiler: "g++" | ||
cmake-build-type: "Release" | ||
c-compiler: gcc | ||
cxx-compiler: g++ | ||
cmake-build-type: Release | ||
cmake-build-flag: "" | ||
- name: windows | ||
os: windows-latest | ||
c-compiler: "cl.exe" | ||
cxx-compiler: "cl.exe" | ||
cmake-build-type: "Release" | ||
cmake-build-flag: "-A x64" | ||
c-compiler: cl.exe | ||
cxx-compiler: cl.exe | ||
cmake-build-type: Release | ||
cmake-build-flag: -A x64 | ||
- name: macos | ||
os: macos-13 | ||
c-compiler: "clang" | ||
cxx-compiler: "clang++" | ||
cmake-build-type: "Release" | ||
os: macos-14 | ||
c-compiler: clang | ||
cxx-compiler: clang++ | ||
cmake-build-type: Release | ||
cmake-build-flag: "" | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "11" | ||
distribution: adopt | ||
- name: Install ocl-icd-loader - windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
cd .. | ||
- name: Set up JDK | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader | ||
- name: Install ocl-icd-loader - windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
cd .. | ||
git clone --branch ${{ env.opencl-icd-loader-git-tag }} https://github.com/KhronosGroup/OpenCL-ICD-Loader | ||
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers | ||
cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build" | ||
cmake --build "./OpenCL-Headers/build" --parallel 6 --target install | ||
cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build" -A x64 | ||
cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release | ||
shell: bash -l {0} | ||
git clone --branch ${{ env.opencl-headers-git-tag }} https://github.com/KhronosGroup/OpenCL-Headers | ||
cmake -S "./OpenCL-Headers" -B "./OpenCL-Headers/build" | ||
cmake --build "./OpenCL-Headers/build" --parallel 6 --target install | ||
cmake -D CMAKE_PREFIX_PATH="./OpenCL-Headers" -D OPENCL_ICD_LOADER_HEADERS_DIR="./OpenCL-Headers/" -S "./OpenCL-ICD-Loader" -B "./OpenCL-ICD-Loader/build" -A x64 | ||
cmake --build "./OpenCL-ICD-Loader/build" --parallel 6 --target install --config Release | ||
shell: bash -l {0} | ||
- name: Increase swapfile on Ubuntu | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo swapoff -a | ||
sudo fallocate -l 15G /swapfile | ||
sudo chmod 600 /swapfile | ||
sudo mkswap /swapfile | ||
sudo swapon /swapfile | ||
sudo swapon --show | ||
- name: Install openCL on Ubuntu | ||
if: runner.os == 'Linux' | ||
run: sudo apt install ocl-icd-opencl-dev | ||
- name: Build with Maven | ||
run: mvn clean install -DskipTests | ||
shell: bash | ||
- name: Run Java class (only possible on MacOS intel) | ||
if: contains(matrix.os, 'macos') | ||
run: > | ||
if [[ $(uname -m) == 'x86_64' ]]; then | ||
mvn dependency:build-classpath -Dmdep.outputFile=classpath.txt | ||
java -cp target/classes:$(cat classpath.txt) net.clesperanto.ClesperantoJ | ||
fi | ||
- name: Get Maven Version and Upload Artifact | ||
shell: bash | ||
run: | | ||
MVN_VERSION=$(mvn -q \ | ||
-Dexec.executable=echo \ | ||
-Dexec.args='${project.version}' \ | ||
--non-recursive \ | ||
exec:exec) | ||
MVN_NAME=$(mvn -q \ | ||
-Dexec.executable=echo \ | ||
-Dexec.args='${project.name}' \ | ||
--non-recursive \ | ||
exec:exec) | ||
echo "version=${MVN_VERSION}" >> $GITHUB_OUTPUT | ||
echo "name=${MVN_NAME}" >> $GITHUB_OUTPUT | ||
id: mvn_info | ||
- name: Upload native library | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.name }}-artifact | ||
path: target/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar | ||
build: | ||
needs: build-os | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "8" | ||
distribution: zulu | ||
cache: maven | ||
- name: Download all platform-specific JAR files | ||
uses: actions/download-artifact@v4 | ||
- name: Get Maven Version | ||
run: | | ||
MVN_VERSION=$(mvn -q \ | ||
-Dexec.executable=echo \ | ||
-Dexec.args='${project.version}' \ | ||
--non-recursive \ | ||
exec:exec) | ||
MVN_NAME=$(mvn -q \ | ||
-Dexec.executable=echo \ | ||
-Dexec.args='${project.name}' \ | ||
--non-recursive \ | ||
exec:exec) | ||
echo "version=${MVN_VERSION}" >> $GITHUB_OUTPUT | ||
echo "name=${MVN_NAME}" >> $GITHUB_OUTPUT | ||
id: mvn_info | ||
- name: Extract compiled native libraries to target fodler libs | ||
run: | | ||
jar xf ubuntu-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/linux-x86_64 | ||
- name: Increase swapfile on Ubuntu | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo swapoff -a | ||
sudo fallocate -l 15G /swapfile | ||
sudo chmod 600 /swapfile | ||
sudo mkswap /swapfile | ||
sudo swapon /swapfile | ||
sudo swapon --show | ||
jar xf windows-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/windows-x86_64 | ||
- name: Install openCL on Ubuntu | ||
if: runner.os == 'Linux' | ||
run: sudo apt install ocl-icd-opencl-dev | ||
jar xf macos-artifact/${{steps.mvn_info.outputs.name}}-${{steps.mvn_info.outputs.version}}.jar net/clesperanto/macosx-arm64 | ||
- name: Build with Maven | ||
run: mvn clean install -DskipTests | ||
shell: bash | ||
mkdir -p libs | ||
- name: Run Java class (only possible on MacOS) | ||
if: contains(matrix.os, 'macos') | ||
run: | | ||
mvn dependency:build-classpath -Dmdep.outputFile=classpath.txt | ||
java -cp target/classes:$(cat classpath.txt) net.clesperanto.ClesperantoJ | ||
mv net/clesperanto/* libs/ | ||
- name: Set up CI environment | ||
run: .github/setup.sh | ||
- name: Execute the build | ||
run: .github/build.sh | ||
env: | ||
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | ||
OSSRH_PASS: ${{ secrets.OSSRH_PASS }} | ||
SIGNING_ASC: ${{ secrets.SIGNING_ASC }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: build fast | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- deploy-to-scijava | ||
tags: | ||
- "*-[0-9]+.*" | ||
pull_request: | ||
branches: | ||
- main | ||
env: | ||
opencl-icd-loader-git-tag: v2023.04.17 | ||
opencl-headers-git-tag: v2023.04.17 | ||
jobs: | ||
build: | ||
runs-on: macos-13 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: "8" | ||
distribution: zulu | ||
cache: maven | ||
- name: Check secrets are set | ||
run: | | ||
if [ -z "$GPG_KEY_NAME" ]; then echo "GPG_KEY_NAME is not set"; fi | ||
if [ -z "$GPG_PASSPHRASE" ]; then echo "GPG_PASSPHRASE is not set"; fi | ||
if [ -z "$MAVEN_USER" ]; then echo "MAVEN_USER is not set"; fi | ||
if [ -z "$MAVEN_PASS" ]; then echo "MAVEN_PASS is not set"; fi | ||
if [ -z "$OSSRH_PASS" ]; then echo "OSSRH_PASS is not set"; fi | ||
if [ -z "$SIGNING_ASC" ]; then echo "SIGNING_ASC is not set"; fi | ||
- name: Set up CI environment | ||
run: .github/setup.sh | ||
- name: Execute the build | ||
run: .github/build.sh | ||
env: | ||
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
MAVEN_USER: ${{ secrets.MAVEN_USER }} | ||
MAVEN_PASS: ${{ secrets.MAVEN_PASS }} | ||
OSSRH_PASS: ${{ secrets.OSSRH_PASS }} | ||
SIGNING_ASC: ${{ secrets.SIGNING_ASC }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
name: ClesperantoJ tests | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2024 Stéphane Rigaud, Robert Haase, Institut Pasteur Paris, Max Planck Institute for Molecular Cell Biology and Genetics Dresden, ScaDS.AI, Leipzig University | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors | ||
may be used to endorse or promote products derived from this software without | ||
specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. |
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
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
32 changes: 32 additions & 0 deletions
32
src/main/java/net/clesperanto/ImagePlusClesperantoJExample.java
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
Oops, something went wrong.