Skip to content

Build Native Image

Build Native Image #7

Workflow file for this run

name: Build Native Image
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Match tags like 1.0.0, 2.1.3, etc.
jobs:
build-native:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: graalvm/setup-graalvm@v1
with:
java-version: '21' # See 'Options' section below for all supported versions
distribution: 'graalvm' # See 'Options' section below for all available distributions
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install FUSE3
run: |
sudo apt-get update
sudo apt-get install -y fuse3 libfuse3-dev
- name: Build the project
run: |
mvn package
- name: Archive native image
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: native-image
path: target/hdfs-mount
release:
runs-on: ubuntu-latest
needs: build-native
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download native image
uses: actions/download-artifact@v4
with:
name: native-image
- name: Get commit message
id: get_commit_message
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
COMMIT_MESSAGE=$(git log -1 --pretty=%B "$TAG_NAME")
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
echo "$COMMIT_MESSAGE" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub release
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: ./artifacts/native-image/*
body: |
Release for tag `${{ github.ref_name }}`
**Changes:**
${{ steps.get_commit_message.outputs.commit_message }}