Skip to content

Commit

Permalink
add jar build
Browse files Browse the repository at this point in the history
  • Loading branch information
eisber committed Feb 27, 2023
1 parent 22584d4 commit 42efde4
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 49 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/build_jar.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Java JAR

on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build_jni:
name: jni on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
outdir: linux_64
- os: windows-latest
outdir: windows_64
- os: macos-latest
outdir: osx_64
steps:
- uses: actions/checkout@v3

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
# stable doesn't have --out-dir
toolchain: nightly

- name: Build
working-directory: ./jni
# TODO: 32bit vs 64bit?
# https://github.com/scijava/native-lib-loader
run: cargo build --release -Z unstable-options --out-dir ../build/natives/${{ env.outdir }}

- uses: actions/upload-artifact@v3
with:
name: natives
path: ./build/*

build_java:
name: java
runs-on: ubuntu-latest
needs: [build_jni]

steps:
- name: Load outputs
uses: actions/download-artifact@v3
with:
name: natives
path: natives

- name: debug
run: find natives
49 changes: 0 additions & 49 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,52 +51,3 @@ jobs:
with:
name: dist
path: ./dist/*.tar.gz

build_jni:
name: jni on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
outdir: linux_64
- os: windows-latest
outdir: windows_64
- os: macos-latest
outdir: osx_64
steps:
- uses: actions/checkout@v3

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
# stable doesn't have --out-dir
toolchain: nightly

- name: Build
working-directory: ./jni
# TODO: 32bit vs 64bit?
# https://github.com/scijava/native-lib-loader
run: cargo build --release -Z unstable-options --out-dir ../build/natives/${{ env.outdir }}

- uses: actions/upload-artifact@v3
with:
name: natives
path: ./build/*

build_java:
name: java
runs-on: ubuntu-latest
needs: [build_jni]

steps:
- name: Load outputs
uses: actions/download-artifact@v3
with:
name: natives
path: natives

- name: debug
run: find natives

0 comments on commit 42efde4

Please sign in to comment.