Skip to content

Create Executables

Create Executables #18

Workflow file for this run

# This is a basic workflow that is manually triggered
name: Create Executables
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-image:
name: 'Build Native Image'
needs: get-version
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ld-binary: [target/ld-cli, target/ld-cli.exe]
exclude:
- os: ubuntu-latest
ld-binary: target/ld-cli.exe
- os: macos-latest
ld-binary: target/ld-cli.exe
- os: windows-latest
ld-binary: target/ld-cli
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Setup GraalVM Environment'
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '21'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build Native Image'
run: mvn package -P native
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Upload'
uses: actions/upload-artifact@v2
with:
name: ld-cli-${{ needs.get-version.outputs.BUILD_VERSION }}-${{ matrix.os }}
path: |
${{ matrix.ld-binary }}
if-no-files-found: error
get-version:
name: 'Get Build Version'
runs-on: ubuntu-latest
outputs:
BUILD_VERSION: ${{ steps.extraction.outputs.BUILD_VERSION }}
steps:
- name: 'Checkout'
uses: actions/checkout@v2
id: checkout
- id: extraction
name: 'Extract Version'
run: |
echo "::set-output name=BUILD_VERSION::$( grep '<version>' pom.xml | head -1 | sed 's/[[:alpha:]|<|>|/|[:space:]]//g' | awk -F- '{print $1}')"