Skip to content

GraalVM Native Image builds #69

GraalVM Native Image builds

GraalVM Native Image builds #69

Workflow file for this run

name: GraalVM Native Image builds
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
matrix:
# os: [macos-latest, ubuntu-latest]
os: [ubuntu-24.04]
steps:
- uses: actions/checkout@v6
- uses: graalvm/setup-graalvm@v1
with:
java-version: '25'
distribution: 'graalvm'
cache: 'maven'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: maven version
run: mvn --version
- name: ldd (glibc) version
run: ldd --version
- name: native image version
run: |
echo "GRAALVM_HOME: $GRAALVM_HOME"
echo "JAVA_HOME: $JAVA_HOME"
java --version
native-image --version
- name: login to docker hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build with Maven
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
mvn clean package -Pnative -Dgit.commit.id.abbrev="${GITHUB_SHA:0:8}"
else
mvn clean package -Pnative,mac -DskipTests
fi
- name: Upload binary
uses: actions/upload-artifact@v7
with:
name: ebean-insight-${{ matrix.os }}
path: server/target/ebean-insight
if-no-files-found: error
- name: Upload MCP binary
uses: actions/upload-artifact@v7
with:
name: ebean-insight-mcp-${{ matrix.os }}
path: mcp/target/ebean-insight-mcp
if-no-files-found: error
- name: Stage server binary for release
if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'Linux'
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
STAGE="ebean-insight-server-${TAG}-linux-x64"
mkdir -p "$STAGE"
cp server/target/ebean-insight "$STAGE/"
chmod +x "$STAGE/ebean-insight"
cp docs/install-server.md "$STAGE/" 2>/dev/null || true
cp LICENSE "$STAGE/" 2>/dev/null || true
zip -r "${STAGE}.zip" "$STAGE"
sha256sum "${STAGE}.zip" > "${STAGE}.zip.sha256"
ls -la "${STAGE}.zip" "${STAGE}.zip.sha256"
- name: Stage MCP binary for release
if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'Linux'
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
STAGE="ebean-insight-mcp-${TAG}-linux-x64"
mkdir -p "$STAGE"
cp mcp/target/ebean-insight-mcp "$STAGE/"
chmod +x "$STAGE/ebean-insight-mcp"
cp docs/install-mcp.md "$STAGE/" 2>/dev/null || true
cp LICENSE "$STAGE/" 2>/dev/null || true
zip -r "${STAGE}.zip" "$STAGE"
sha256sum "${STAGE}.zip" > "${STAGE}.zip.sha256"
ls -la "${STAGE}.zip" "${STAGE}.zip.sha256"
- name: Attach native binaries to GitHub Release
if: startsWith(github.ref, 'refs/tags/v') && runner.os == 'Linux'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: |
ebean-insight-server-*-linux-x64.zip
ebean-insight-server-*-linux-x64.zip.sha256
ebean-insight-mcp-*-linux-x64.zip
ebean-insight-mcp-*-linux-x64.zip.sha256