diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7836ef9..e69c1ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: build_bloscjni: strategy: matrix: - os: [ ubuntu-latest, windows-latest, macos-12 ] + os: [ ubuntu-latest, windows-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -41,8 +41,14 @@ jobs: -shared -o ..\\src\\main\\resources\\libbloscjni.dll \ bloscjni.c ..\\c-blosc\\build\\blosc\\libblosc.a + - name: Install CMake 3.x (Mac) + if: ${{ matrix.os == 'macos-latest' }} + uses: lukka/get-cmake@latest + with: + cmakeVersion: "~3" + - name: Build c-blosc (Mac arm64) - if: ${{ matrix.os == 'macos-12' }} + if: ${{ matrix.os == 'macos-latest' }} run: | cd c-blosc mkdir build-arm64 @@ -57,19 +63,20 @@ jobs: cmake --build . -j8 --config Release --target blosc_static - name: Build c-blosc (Mac x86_64) - if: ${{ matrix.os == 'macos-12' }} + if: ${{ matrix.os == 'macos-latest' }} run: | cd c-blosc mkdir build-x86_64 cd build-x86_64 cmake .. \ + -DCMAKE_OSX_ARCHITECTURES=x86_64 \ -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_BUILD_TYPE=Release cmake --build . -j8 --config Release --target blosc_static - name: Build bloscjni (Mac universal) - if: ${{ matrix.os == 'macos-12' }} + if: ${{ matrix.os == 'macos-latest' }} run: | cd bloscjni cc \ @@ -110,7 +117,7 @@ jobs: docker run -i -v$(pwd):/app -w /app centos7-jdk8 bash <com.scalableminds blosc-java - 0.2-1.21.4 + 0.3-1.21.6 2023 blosc-java @@ -76,7 +76,7 @@ org.jreleaser jreleaser-maven-plugin - 1.7.0 + 1.15.0 @@ -85,17 +85,13 @@ - - + + ALWAYS - https://oss.sonatype.org/service/local - https://oss.sonatype.org/content/repositories/snapshots/ - - false - false + https://central.sonatype.com/api/v1/publisher target/staging-deploy - - + + diff --git a/src/main/java/com/scalableminds/bloscjava/Blosc.java b/src/main/java/com/scalableminds/bloscjava/Blosc.java index fa4b8e6..b13117f 100644 --- a/src/main/java/com/scalableminds/bloscjava/Blosc.java +++ b/src/main/java/com/scalableminds/bloscjava/Blosc.java @@ -172,6 +172,11 @@ private static File loadLibraryFromJarToTemp() throws IOException { // attempt to look up the static library in the jar file String libraryFileName = filePrefix + extension; + // On Linux, select arch-specific library + if (extension.equals(".so")) { + String arch = System.getProperty("os.arch").toLowerCase(); + libraryFileName = filePrefix + "-" + arch + extension; + } is = Blosc.class.getClassLoader().getResourceAsStream(libraryFileName); if (is == null) {