2023-03-19 13:50:06 +00:00
|
|
|
name: Native Image
|
|
|
|
|
|
|
|
on:
|
2023-03-25 13:45:43 +00:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
release-version:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-03-19 13:50:06 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-03-26 10:25:25 +00:00
|
|
|
build_non_win_images:
|
|
|
|
name: 'Build Native Image ${{ matrix.platform }}'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ macos-latest, windows-latest, ubuntu-latest ]
|
|
|
|
include:
|
|
|
|
- os: 'ubuntu-latest'
|
|
|
|
platform: 'linux-amd64'
|
|
|
|
- os: 'macos-latest'
|
|
|
|
platform: 'darwin-amd64'
|
|
|
|
- os: 'windows-latest'
|
|
|
|
platform: 'win-amd64'
|
|
|
|
runs-on: ${{matrix.os}}
|
2023-03-19 13:50:06 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout the repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2023-03-26 10:25:25 +00:00
|
|
|
- uses: graalvm/setup-graalvm@v1
|
|
|
|
with:
|
|
|
|
version: '22.3.1'
|
|
|
|
java-version: '17'
|
|
|
|
components: 'native-image'
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-03-25 13:45:43 +00:00
|
|
|
- uses: actions/cache/restore@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
build/libs
|
|
|
|
build/publications
|
2023-07-04 08:15:07 +00:00
|
|
|
plantuml-asl/build/libs
|
|
|
|
plantuml-bsd/build/libs
|
|
|
|
plantuml-epl/build/libs
|
|
|
|
plantuml-lgpl/build/libs
|
2023-04-05 10:13:14 +00:00
|
|
|
plantuml-mit/build/libs
|
2023-10-04 18:05:20 +00:00
|
|
|
plantuml-gplv2/build/libs
|
2023-03-26 10:25:25 +00:00
|
|
|
key: "libs-${{ github.run_id }}"
|
2023-03-25 13:45:43 +00:00
|
|
|
fail-on-cache-miss: true
|
2023-03-26 10:25:25 +00:00
|
|
|
enableCrossOsArchive: true
|
2023-03-19 13:50:06 +00:00
|
|
|
|
|
|
|
- name: Generate GraalVM configuration
|
|
|
|
run: |
|
|
|
|
mkdir native-image-config-dir
|
2023-03-26 10:25:25 +00:00
|
|
|
echo 'Bob->Alice: Hello' | java -agentlib:native-image-agent=config-output-dir=native-image-config-dir -jar "./build/libs/plantuml-${{ inputs.release-version }}.jar" -tpng -pipe > out.png
|
2023-03-19 13:50:06 +00:00
|
|
|
|
|
|
|
- name: Generate native image
|
|
|
|
run: |
|
2023-03-26 10:25:25 +00:00
|
|
|
native-image -H:ConfigurationFileDirectories=native-image-config-dir --no-fallback --report-unsupported-elements-at-runtime -jar "build/libs/plantuml-${{ inputs.release-version }}.jar" -H:Path="build/libs" -H:Name="plantuml-${{ matrix.platform }}-${{ inputs.release-version }}"
|
2023-03-19 13:50:06 +00:00
|
|
|
|
2023-03-25 13:45:43 +00:00
|
|
|
- name: Cache native image
|
|
|
|
uses: actions/cache/save@v3
|
2023-03-19 13:50:06 +00:00
|
|
|
with:
|
2023-03-26 10:25:25 +00:00
|
|
|
path: "build/libs/plantuml-${{ matrix.platform }}-*"
|
|
|
|
key: "native-image-${{ matrix.platform }}-${{ github.run_id }}"
|
|
|
|
enableCrossOsArchive: true
|