1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-15 01:44:05 +00:00
plantuml/.github/workflows/native-image.yml
dependabot[bot] 4217882d8a
chore(deps): bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 02:11:38 +00:00

65 lines
2.1 KiB
YAML

name: Native Image
on:
workflow_call:
inputs:
release-version:
required: true
type: string
jobs:
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}}
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: graalvm/setup-graalvm@v1
with:
version: '22.3.1'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache/restore@v4
with:
path: |
build/libs
build/publications
plantuml-asl/build/libs
plantuml-bsd/build/libs
plantuml-epl/build/libs
plantuml-lgpl/build/libs
plantuml-mit/build/libs
plantuml-gplv2/build/libs
key: "libs-${{ github.run_id }}"
fail-on-cache-miss: true
enableCrossOsArchive: true
- name: Generate GraalVM configuration
run: |
mkdir native-image-config-dir
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
- name: Generate native image
run: |
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 }}"
- name: Cache native image
uses: actions/cache/save@v4
with:
path: "build/libs/plantuml-${{ matrix.platform }}-*"
key: "native-image-${{ matrix.platform }}-${{ github.run_id }}"
enableCrossOsArchive: true