Copy fonts from JVM lib folder, to attempt standalone behaviour #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Java CI | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build-java: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up GraalVM 21 | |
uses: graalvm/[email protected] | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
- name: Read/Write Properties File | |
uses: kurt-code/[email protected] | |
id: read-properties | |
with: | |
operation: 'read' | |
file-path: 'src/main/resources/application.properties' | |
keys: 'trivysummary.version' | |
- name: Get the Read properties | |
run: | | |
echo "version: ${{ steps.read-properties.outputs.trivysummary_version }}" | |
echo "github.ref: ${{ github.ref }}" | |
- name: Build and Test with Gradle | |
run: gradle test --warning-mode all | |
- name: Create distributable ZIP file with Gradle | |
run: gradle distZip --warning-mode all | |
- name: Upload release artefact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jar-distributable | |
path: build/distributions/trivysummary-${{ steps.read-properties.outputs.trivysummary_version }}.zip | |
retention-days: 1 | |
- name: Publish with Gradle | |
if: endsWith(steps.read-properties.outputs.trivysummary_version, '-SNAPSHOT') || (startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, steps.read-properties.outputs.trivysummary_version)) | |
run: gradle publish -Pmvnpub.user="${{ secrets.MAVENREPO_USER }}" -Pmvnpub.key="${{ secrets.MAVENREPO_TOKEN }}" --warning-mode all | |
build-native-ubuntu: | |
needs: build-java | |
name: Build TrivySummary natively on Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up GraalVM 21 | |
uses: graalvm/[email protected] | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
- name: Read/Write Properties File | |
uses: kurt-code/[email protected] | |
id: read-properties | |
with: | |
operation: 'read' | |
file-path: 'src/main/resources/application.properties' | |
keys: 'trivysummary.version' | |
- name: Build natively with Gradle | |
run: gradle clean nativeCompile nativeTest | |
- name: Package native code for release | |
run: | | |
sudo apt install zip -q | |
mkdir dist | |
cd build/native/nativeCompile | |
ls | |
zip -qq -r ../../../dist/trivysummary-linux-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.zip . -i * | |
cd ../../.. | |
- name: Upload release artefact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-distributable | |
path: dist/trivysummary-linux-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.zip | |
retention-days: 1 | |
build-native-windows: | |
needs: | |
- build-java | |
- build-native-ubuntu | |
name: Build TrivySummary natively on Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Set up GraalVM 21 | |
uses: graalvm/[email protected] | |
with: | |
java-version: '21' | |
distribution: 'graalvm' | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
native-image-job-reports: 'true' | |
- name: Read/Write Properties File | |
uses: kurt-code/[email protected] | |
id: read-properties | |
with: | |
operation: 'read' | |
file-path: 'src/main/resources/application.properties' | |
keys: 'trivysummary.version' | |
- name: Build natively with Gradle | |
run: gradle clean nativeCompile nativeTest | |
- name: Package native code for release | |
run: | | |
mkdir dist | |
cd build/native/nativeCompile | |
rm *.args | |
ls | |
tar -a -c -f ../../../dist/trivysummary-windows-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.zip *.* | |
cd ../../.. | |
- name: Upload release artefact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-distributable | |
path: dist/trivysummary-windows-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.zip | |
retention-days: 1 | |
release: | |
needs: | |
- build-java | |
- build-native-ubuntu | |
- build-native-windows | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: Read/Write Properties File | |
uses: kurt-code/[email protected] | |
id: read-properties | |
with: | |
operation: 'read' | |
file-path: 'src/main/resources/application.properties' | |
keys: 'trivysummary.version' | |
- name: Create dist folder to download to | |
run: | | |
mkdir dist | |
- name: Download release artefacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: dist | |
merge-multiple: true | |
- name: "Create Release" | |
id: create_release | |
uses: softprops/[email protected] | |
if: startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, steps.read-properties.outputs.trivysummary_version) | |
with: | |
tag_name: ${{ steps.read-properties.outputs.trivysummary_version }} | |
name: Release ${{ steps.read-properties.outputs.trivysummary_version }} | |
body_path: CHANGELOG.txt | |
token: ${{ secrets.MAVENREPO_TOKEN }} | |
files: dist/* |