mcp-jdbc
by quarkiverse
- .github
- workflows
name: Build artifacts
# loosly based on https://github.com/jreleaser/helloworld-java-graalvm
# modifed to grab multiple target native raw images rather than jpackage.
on:
workflow_call:
inputs:
project-version:
required: true
type: string
project-list:
default: '-pl shared,filesystem,kubernetes'
required: false
type: string
maven-options:
default: ''
required: false
type: string
java-version:
default: '17'
required: false
type: string
java-distro:
default: 'temurin'
required: false
type: string
graal-distro:
default: 'graalvm-community' # mandrel once figure out which version is needed
required: false
type: string
graal-version:
default: '21.0.2'
required: false
type: string
graal-java-version:
default: '21'
required: false
type: string
jobs:
assemble:
name: 'Building artifacts for ${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, macos-14, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Setup Graal
uses: graalvm/setup-graalvm@v1
with:
version: ${{ inputs.graal-version }}
java-version: ${{ inputs.graal-java-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
distribution: ${{ inputs.graal-distro }}
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distro }}
cache: maven
- name: Build
run: ./mvnw -ntp -B ${{inputs.maven-options}} ${{ inputs.project-list }} -Dnative verify
- name: Upload native artifacts
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: native-image-${{ runner.os }}-${{ runner.arch }}
path: | # TODO: no better way to find the native images?
**/target/mcp-server-*-linux-x86_64
**/target/mcp-server-*-osx-aarch_64
**/target/mcp-server-*-osx-x86_64
**/target/mcp-server-*-windows-x86_64.exe