diff --git a/.github/workflows/native-image.yml b/.github/workflows/native-image.yml index e1bddb689..d7e1eb072 100644 --- a/.github/workflows/native-image.yml +++ b/.github/workflows/native-image.yml @@ -1,4 +1,4 @@ -name: Native Image +name: Native Image Snapshot on: push: @@ -9,6 +9,7 @@ on: jobs: build: + if: "!contains(github.event.head_commit.message, 'skip ci')" strategy: matrix: os: [ubuntu-latest] @@ -19,15 +20,42 @@ jobs: - 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 + distribution: "graalvm-community" # See 'Options' section below for all available distributions github-token: ${{ secrets.GITHUB_TOKEN }} cache: "maven" native-image-job-reports: "true" - - name: Check GraalVM and Maven + - name: Build native image run: | echo "GRAALVM_HOME: $GRAALVM_HOME" echo "JAVA_HOME: $JAVA_HOME" java --version native-image --version - mvn --version + mvn package -Pnative -DskipTests + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build and Push multi-arch native Docker images + uses: docker/build-push-action@v6 + with: + context: ./core/Dockerfile.native + platforms: | + linux/amd64, + linux/arm64, + linux/ppc64le, + linux/s390x + push: true # push all images built + pull: true # pull all required images before building + # Tag with "latest" only if branch is master + tags: | + softinstigate/restheart-native:latest