Skip to content

Automated update to the latest commits from QuantLib and Quantlib-SWIG #1735

Automated update to the latest commits from QuantLib and Quantlib-SWIG

Automated update to the latest commits from QuantLib and Quantlib-SWIG #1735

name: Build the QuantLib maven artefact
on:
push: { }
pull_request: { }
workflow_dispatch: { }
env:
QUANTLIB_VERSION: 1.37.0-SNAPSHOT
JAVA_PATH: java
JAVA_TARGET_PATH: java/target
JAVA_RESOURCES_NATIVE_LIBS_PATH: java/src/main/resources/native
jobs:
build-for-deploy:
name: Build for deployment (jdk${{ matrix.java-version }} on ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
java-version:
- 17
os:
- macos-13
- windows-2019
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Build native library for ${{ runner.os }}
uses: ./.github/actions/build_native_library
with:
runner-name: ${{ matrix.os }}
java-version: ${{ matrix.java-version }}
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-secret-key-password: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}
upload-path: ${{ env.JAVA_RESOURCES_NATIVE_LIBS_PATH }}
deploy-quantlib-snapshot:
name: Build for deployment (jdk${{ matrix.java-version }} on ${{ matrix.os }})
needs: [ build-for-deploy ]
permissions:
contents: read
packages: write
strategy:
fail-fast: true
matrix:
java-version:
- 17
os:
- ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"
- name: Download macOS native library
uses: actions/download-artifact@v4
with:
name: native-library-macOS
path: ${{ env.JAVA_RESOURCES_NATIVE_LIBS_PATH }}
- name: Download Windows native library
uses: actions/download-artifact@v4
with:
name: native-library-Windows
path: ${{ env.JAVA_RESOURCES_NATIVE_LIBS_PATH }}
- name: Delete native library artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: native-library-*
failOnError: true
- name: Set up JDK ${{ matrix.java-version }}
uses: ./.github/actions/build_native_library/setup/jdk
with:
java-version: ${{ matrix.java-version }}
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
- name: Set the maven module version
working-directory: ${{ env.JAVA_PATH }}
run: |
./mvnw --batch-mode --show-version versions:set -DnewVersion=${{ env.QUANTLIB_VERSION }}
- name: Build native library for ${{ runner.os }} and jdk ${{ matrix.java-version }}
uses: ./.github/actions/build_native_library
with:
runner-name: ${{ matrix.os }}
java-version: ${{ matrix.java-version }}
gpg-secret-key: ${{ secrets.GPG_SECRET_KEY }}
gpg-secret-key-password: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}
- name: Deploy the maven module
if: github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
working-directory: ${{ env.JAVA_PATH }}
run: |
./mvnw --batch-mode --show-version clean deploy -P enable-gpg-plugin
- name: Upload quantlib-${{ env.QUANTLIB_VERSION }}
uses: actions/upload-artifact@v4
with:
name: quantlib-${{ env.QUANTLIB_VERSION }}
if-no-files-found: error
path: |
${{ env.JAVA_TARGET_PATH }}/*.pom
${{ env.JAVA_TARGET_PATH }}/*.jar
${{ env.JAVA_TARGET_PATH }}/*.asc