Skip to content

Commit 3a825c9

Browse files
committed
Move towards setting up artifacts.
1 parent 182f61e commit 3a825c9

4 files changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,51 @@ on:
77
branches: [main]
88
tags: [v*]
99

10+
permissions:
11+
attestations: write
12+
contents: write
13+
id-token: write
14+
1015
jobs:
1116
build:
1217
strategy:
1318
fail-fast: false
1419
matrix:
1520
os: [ubuntu-24.04, ubuntu-24.04-arm]
1621
runs-on: ${{ matrix.os }}
17-
permissions:
18-
contents: write
1922
steps:
2023
- uses: actions/checkout@v6
2124

25+
- name: Set architecture
26+
run: |
27+
if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then
28+
echo "ARCH=amd64" >> $GITHUB_ENV
29+
elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then
30+
echo "ARCH=arm64" >> $GITHUB_ENV
31+
fi
32+
2233
- name: Set up Docker Buildx
2334
uses: docker/setup-buildx-action@v3
2435

25-
- name: Build (amd64)
26-
if: matrix.os == 'ubuntu-24.04'
36+
- name: Build
2737
uses: docker/build-push-action@v6
2838
with:
2939
context: .
3040
file: ./Dockerfile
3141
push: false
3242
target: export
33-
platforms: linux/amd64
43+
platforms: linux/${{ env.ARCH }}
3444
outputs: type=local,dest=./output
3545

36-
- name: Build (arm64)
37-
if: matrix.os == 'ubuntu-24.04-arm'
38-
uses: docker/build-push-action@v6
39-
with:
40-
context: .
41-
file: ./Dockerfile
42-
push: false
43-
target: export
44-
platforms: linux/arm64
45-
outputs: type=local,dest=./output
46+
- name: Copy files
47+
run: |
48+
mkdir -p artifacts
49+
version="$(cat quantlib-version)"
50+
cp "output/build/quantlib-$version.jar" "artifacts/${{ env.ARCH }}-quantlib-$version.jar"
51+
cp "output/build/quantlib-$version.pom" "artifacts/${{ env.ARCH }}-quantlib-$version.pom"
4652
4753
- name: List files
48-
run: find ./output -type f
54+
run: find ./artifacts -type f
4955

5056
# TODO - draft release
5157
# - name: Draft release

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM eclipse-temurin:25-jdk-alpine AS builder
2+
COPY quantlib-version /tmp/quantlib-version
23
COPY build.sh /tmp/build.sh
34
COPY test.scala /tmp/test.scala
45
RUN sh /tmp/build.sh

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -exo pipefail
55
export CPUS="$(nproc)"
66
export BOOST_VERSION=1.90.0
77
export MAVEN_VERSION=3.9.12
8-
export QUANTLIB_VERSION=1.41.0
8+
export QUANTLIB_VERSION="$(cat /tmp/quantlib-version)"
99
export SWIG_VERSION=4.4.1
1010

1111
apk add --no-cache --update --virtual .build-dependencies \

quantlib-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.41.0

0 commit comments

Comments
 (0)