Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

.github/workflows/deploy-native-artifact.yml #36

.github/workflows/deploy-native-artifact.yml

.github/workflows/deploy-native-artifact.yml #36

name: Binary Artifacts native
on:
workflow_dispatch:
release:
types: [ published ]
jobs:
build:
name: graalvm ${{ matrix.graalvm_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
graalvm_version: latest
asset_name: linux-amd64
executable-suffix: ''
- os: macos-latest
graalvm_version: latest
asset_name: macos-amd64
executable-suffix: ''
- os: windows-latest
graalvm_version: latest
asset_name: windows-amd64
executable-suffix: '.exe'
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- uses: graalvm/setup-graalvm@v1
with:
version: ${{ matrix.graalvm_version }}
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Native Binary
run: mvn -Pnative package -DskipTests=true
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.asset_name }}${{ matrix.executable-suffix }}
path: target/app${{ matrix.executable-suffix }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/app${{ matrix.executable-suffix }}
asset_name: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.asset_name }}${{ matrix.executable-suffix }}
tag: ${{ github.ref }}