Skip to content

Use x86_64 and aarch64. #16

Use x86_64 and aarch64.

Use x86_64 and aarch64. #16

Workflow file for this run

name: CI
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
permissions:
attestations: write
contents: write
id-token: write
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set env
run: |
echo "QUANTLIB_VERSION=$(cat quantlib-version)" >> $GITHUB_ENV
if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then
echo "DOCKER_ARCH=amd64" >> $GITHUB_ENV
echo "RELEASE_ARCH=x86_64" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then
echo "DOCKER_ARCH=arm64" >> $GITHUB_ENV
echo "RELEASE_ARCH=aarch64" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: false
target: export
platforms: linux/${{ env.DOCKER_ARCH }}
outputs: type=local,dest=./output
- name: Copy artifacts
if: github.event_name == 'push'
run: |
mkdir -p artifacts
cp "output/build/quantlib-${{ env.QUANTLIB_VERSION }}.jar" "artifacts/${{ env.RELEASE_ARCH }}-quantlib-${{ env.QUANTLIB_VERSION }}.jar"
cp "output/build/quantlib-${{ env.QUANTLIB_VERSION }}.pom" "artifacts/${{ env.RELEASE_ARCH }}-quantlib-${{ env.QUANTLIB_VERSION }}.pom"
- name: Attest artifacts
if: github.event_name == 'push'
uses: actions/attest@v4
with:
subject-path: 'artifacts/*'
- name: Upload artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v6
with:
name: ${{ env.RELEASE_ARCH }}-quantlib-${{ env.QUANTLIB_VERSION }}
path: artifacts/
if-no-files-found: error
retention-days: 2
release:
needs: [build]
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Set env
run: |
echo "QUANTLIB_VERSION=$(cat quantlib-version)" >> $GITHUB_ENV
- name: Download x86_64 artifacts
uses: actions/download-artifact@v8
with:
name: x86_64-quantlib-${{ env.QUANTLIB_VERSION }}
path: artifacts/
- name: Download aarch64 artifacts
uses: actions/download-artifact@v8
with:
name: aarch64-quantlib-${{ env.QUANTLIB_VERSION }}
path: artifacts/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: true
files: artifacts/*
fail_on_unmatched_files: true