Skip to content

Publish artifacts to Maven Central #11

Publish artifacts to Maven Central

Publish artifacts to Maven Central #11

Workflow file for this run

name: Publish artfiacts to Maven Central
on:
workflow_dispatch:
jobs:
build-native:
runs-on: ${{ matrix.os }}
env:
target-path: ${{ matrix.platform }}-${{ matrix.arch }}
strategy:
matrix:
platform: [linux, win32, darwin]
arch: [x86, x86-64, aarch64]
exclude:
- platform: darwin
arch: x86
- platform: win32
arch: aarch64
include:
- platform: darwin
os: macos-14
brew-packages: swig
- platform: darwin
arch: x86-64
env: CC='cc -target x86_64-apple-darwin20.1.0' CXX='c++ -std=c++11 -target x86_64-apple-darwin20.1.0'
- platform: linux
os: ubuntu-22.04
extra-packages: gcc-9 g++-9
env: CC=gcc-9 CXX=g++-9
- platform: linux
arch: aarch64
extra-packages: gcc-9-aarch64-linux-gnu g++-9-aarch64-linux-gnu
env: CC=aarch64-linux-gnu-gcc-9 CXX=aarch64-linux-gnu-g++-9
- platform: linux
arch: x86
extra-packages: gcc-9-multilib g++-9-multilib
env: CC='gcc-9 -m32' CXX='g++-9 -m32'
- platform: win32
os: windows-2022
- platform: win32
arch: x86
env: CC='gcc -m32' CXX='g++ -m32'
steps:
- uses: actions/checkout@v4
with:
repository: supranational/blst
ref: v0.3.15
- if: ${{ matrix.extra-packages }}
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.extra-packages }}
- if: ${{ matrix.brew-packages }}
run: brew install ${{ matrix.brew-packages }}
- name: Build native image
run: |
cd bindings/java
${{ matrix.env }} ./build.sh
- uses: actions/upload-artifact@v4
with:
name: blst-${{ env.target-path }}.zip
path: |
bindings/java/supranational/blst
!bindings/java/supranational/blst/*.class
publish:
runs-on: ubuntu-latest
needs: build-native
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
gpg-private-key: ${{ secrets.OSSRH_GPG_KEY }}
gpg-passphrase: ${{ secrets.OSSRH_GPG_PASSPHRASE }}
- run: |
mkdir -p java/src/main/resources
- uses: actions/download-artifact@v4
- run: |
find .
mvn package