Automated update to the latest commits from QuantLib and Quantlib-SWIG #658
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build the QuantLib maven artefact | |
on: | |
push: { } | |
pull_request: { } | |
workflow_dispatch: { } | |
env: | |
QUANTLIB_VERSION: 1.33.0-SNAPSHOT | |
JAVA_PATH: java | |
JAVA_TARGET_PATH: java/target | |
JAVA_RESOURCES_NATIVE_LIBS_PATH: java/src/main/resources/native | |
jobs: | |
build-for-deploy: | |
strategy: | |
fail-fast: false | |
matrix: | |
java-version: | |
- 17 | |
os: | |
- macos-12 | |
- 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: | |
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@v3 | |
with: | |
name: native-library-macOS | |
path: ${{ env.JAVA_RESOURCES_NATIVE_LIBS_PATH }} | |
- name: Download Windows native library | |
uses: actions/download-artifact@v3 | |
with: | |
name: native-library-Windows | |
path: ${{ env.JAVA_RESOURCES_NATIVE_LIBS_PATH }} | |
- name: Delete native library artifacts | |
uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: native-library-* | |
- 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: Upload quantlib-${{ env.QUANTLIB_VERSION }} | |
uses: actions/upload-artifact@v3 | |
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 | |
- 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 |