Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alanocallaghan committed Feb 23, 2024
0 parents commit 8e47e16
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/jars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI CMake
on:
- workflow_call
- workflow_dispatch
jobs:
ci-cmake:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
linux-x86-64,
win32-x86-64,
darwin-x86-64,
darwin-aarch64
]
include:
- name: linux-x86-64
os: ubuntu-latest
compiler: gcc
artifact: blosc/libblosc.so

- name: win32-x86-64
os: windows-latest
compiler: cl
cmake-args: -A x64
artifact: blosc/Release/blosc.dll

- name: darwin-x86-64
os: macOS-12
compiler: gcc
artifact: blosc/libblosc.dylib

- name: darwin-aarch64
os: macOS-14
compiler: gcc
artifact: blosc/libblosc.dylib
steps:
- uses: actions/checkout@v4
with:
repository: Blosc/c-blosc
ref: v1.21.5

- name: Generate project files
run: |
cmake . ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE='Release' -DBUILD_SHARED_LIBS=OFF -DBUILD_FUZZERS=ON
env:
CC: ${{ matrix.compiler }}
CI: true

- name: Compile source code
run: |
cmake --build . --config 'Release'
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}
path: ${{ matrix.artifact }}

jar:
needs: ci-cmake
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:

- name: Download artifacts
uses: actions/download-artifact@v4

- name: Checkout
uses: actions/checkout@v4
with:
repository: Blosc/c-blosc
path: c-blosc

- name: Install java
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
- name: List files
run: |
ls -lah
tree .
- name: Build JARs
run: |
jar cvf blosc-darwin-aarch64.jar darwin-aarch64 c-blosc/LICENSE.txt c-blosc/LICENSES
jar cvf blosc-darwin-x86-64.jar darwin-x86-64 c-blosc/LICENSE.txt c-blosc/LICENSES
jar cvf blosc-linux-x86-64.jar linux-x86-64 c-blosc/LICENSE.txt c-blosc/LICENSES
jar cvf blosc-win32-x86-64.jar win32-x86-64 c-blosc/LICENSE.txt c-blosc/LICENSES
jar cvf blosc.jar linux-x86-64 darwin-x86-64 darwin-aarch64 win32-x86-64 c-blosc/LICENSE.txt c-blosc/LICENSES
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
path: blosc*.jar
name: blosc-jars
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish release to SciJava Maven

on:
release:
types: [published]

jobs:
jars:
name: Build jars
uses: ./.github/workflows/jars.yml

publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b

- name: Publish snapshot
uses: gradle/[email protected]
with:
arguments: publish -P release=true
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
34 changes: 34 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish snapshot to SciJava Maven

on:
workflow_dispatch:

jobs:
jars:
name: Build jars
uses: ./.github/workflows/jars.yml

publish:

runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Publish snapshot
uses: gradle/gradle-build-action@v2
with:
arguments: publish
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bench/bench
build/

*.sw?
.gradle
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Native library JARs of [c-blosc](https://github.com/Blosc/c-blosc)

This is a small repo to make native library JARs of c-blosc and publish them to SciJava Maven.

All of the useful stuff happens under `.github`.
51 changes: 51 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
plugins {
id 'maven-publish'
}

group = 'io.github.qupath'
version = '1.21.5-SNAPSHOT'


publishing {
repositories {
maven {
name = "SciJava"
def releasesRepoUrl = uri("https://maven.scijava.org/content/repositories/releases")
def snapshotsRepoUrl = uri("https://maven.scijava.org/content/repositories/snapshots")
// Use gradle -Prelease publish
url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
}
}
}

publications {
maven(MavenPublication) {
groupId group
version version
artifact (file("blosc-natives.jar"))
artifact (file("blosc-natives-darwin-aarch64.jar")) {
classifier "darwin-aarch64"
}
artifact (file("blosc-natives-darwin-x86-64.jar")) {
classifier "darwin-x86_64"
}
artifact (file("blosc-natives-win32-x86-64.jar")) {
classifier "win32-x86_64"
}
artifact (file("blosc-natives-linux-x86-64.jar")) {
classifier "linux-x86_64"
}
pom {
licenses {
license {
name = 'LGPL'
url = 'https://www.gnu.org/licenses/lgpl-3.0.en.html'
}
}
}
}
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "blosc"

0 comments on commit 8e47e16

Please sign in to comment.