Update Maven workflow for JDK setup and packaging

This commit is contained in:
2025-11-23 22:00:49 +00:00
committed by GitHub
parent 72db59415f
commit 7cbecc4fab

View File

@@ -13,22 +13,27 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up JDK 17 - name: Set up JDK 17
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: '17' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
cache: maven cache: maven
- name: Build with Maven - name: Build with Maven
run: mvn -B package run: mvn -B package
working-directory: main working-directory: main
- name: Upload built JAR - name: Upload built JAR
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: package name: package
path: main/target/*.jar path: main/target/*.jar
- name: Generate dependency graph - name: Generate dependency graph
run: mvn -B -f main/pom.xml com.github.ferstl:depgraph-maven-plugin:4.0.1:graph run: mvn -B -f main/pom.xml com.github.ferstl:depgraph-maven-plugin:4.0.1:graph
- name: Upload dependency graph artifact - name: Upload dependency graph artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
@@ -48,18 +53,13 @@ jobs:
cache: maven cache: maven
- name: Build with Maven (Skip Tests) - name: Build with Maven (Skip Tests)
# We skip tests here because they ran on Linux already; saves billable minutes.
run: mvn -B package -DskipTests run: mvn -B package -DskipTests
working-directory: main working-directory: main
- name: Create JPackage App Image - name: Create JPackage App Image
shell: pwsh shell: pwsh
run: | run: |
# Create output directory to avoid recursive copying (Ouroboros fix)
New-Item -ItemType Directory -Force -Path "dist" New-Item -ItemType Directory -Force -Path "dist"
# Run jpackage
# Adjust 'main-1.0-SNAPSHOT.jar' if your pom versioning differs
jpackage --name "DTSS" ` jpackage --name "DTSS" `
--input main/target ` --input main/target `
--main-jar main-1.0-SNAPSHOT.jar ` --main-jar main-1.0-SNAPSHOT.jar `
@@ -70,10 +70,8 @@ jobs:
- name: Inject java.exe (Fix Process Spawning) - name: Inject java.exe (Fix Process Spawning)
shell: pwsh shell: pwsh
run: | run: |
# Your code spawns 'bin/java'. We must copy it from the host JDK into the bundle.
$javaPath = (Get-Command java).Source $javaPath = (Get-Command java).Source
Copy-Item -Path $javaPath -Destination "dist/DTSS/runtime/bin/" Copy-Item -Path $javaPath -Destination "dist/DTSS/runtime/bin/"
Write-Host "Injected java.exe into runtime/bin for process spawning support."
- name: Zip Windows Release - name: Zip Windows Release
shell: pwsh shell: pwsh