Skip to content

Reverted to SNAPSHOT build and attempting MacOS build again with JDK … #91

Reverted to SNAPSHOT build and attempting MacOS build again with JDK …

Reverted to SNAPSHOT build and attempting MacOS build again with JDK … #91

Workflow file for this run

name: Java CI
on:
push:
workflow_dispatch:
jobs:
build-java:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up JDK 21
uses: graalvm/[email protected]
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- 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
build-native:
needs: build-java
name: Build TrivySummary natively on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, macos-13, windows-latest, ubuntu-latest]
# os: [windows-latest, ubuntu-latest]
steps:
- uses: actions/[email protected]
- name: Set up JDK 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 nativeCompile
publish:
needs: build-native
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up JDK 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: 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
- 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: |
build/distributions/trivysummary-${{ steps.read-properties.outputs.trivysummary_version }}.zip
build/native/nativeCompile/trivysummary-windows-amd64-${{ steps.read-properties.outputs.trivysummary_version }}.exe
build/native/nativeCompile/trivysummary-linux-amd64-${{ steps.read-properties.outputs.trivysummary_version }}
build/native/nativeCompile/trivysummary-macos-x86-64-${{ steps.read-properties.outputs.trivysummary_version }}
build/native/nativeCompile/trivysummary-macos-aarch64-${{ steps.read-properties.outputs.trivysummary_version }}