Move towards setting up artifacts. #9
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| tags: [v*] | |
| 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 architecture | |
| run: | | |
| if [ "${{ matrix.os }}" = 'ubuntu-24.04' ]; then | |
| echo "ARCH=amd64" >> $GITHUB_ENV | |
| elif [ "${{ matrix.os }}" = 'ubuntu-24.04-arm' ]; then | |
| echo "ARCH=arm64" >> $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.ARCH }} | |
| outputs: type=local,dest=./output | |
| - name: Copy files | |
| run: | | |
| mkdir -p artifacts | |
| version="$(cat quantlib-version)" | |
| cp "output/build/quantlib-$version.jar" "artifacts/${{ env.ARCH }}-quantlib-$version.jar" | |
| cp "output/build/quantlib-$version.pom" "artifacts/${{ env.ARCH }}-quantlib-$version.pom" | |
| - name: List files | |
| run: find ./artifacts -type f | |
| # TODO - draft release | |
| # - name: Draft release | |
| # if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push' | |
| # with: | |
| # draft: true | |
| # files: output/build/* | |
| # fail_on_unmatched_files: true | |