mirror of
https://github.com/davidalves04/Trabalho-Pratico-SD.git
synced 2025-12-07 20:16:36 +00:00
Refactor GitHub Actions workflow for Maven build
This commit is contained in:
15
.github/workflows/maven.yml
vendored
15
.github/workflows/maven.yml
vendored
@@ -13,27 +13,22 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B package
|
||||
working-directory: main
|
||||
|
||||
- name: Upload built JAR
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: package
|
||||
path: main/target/*.jar
|
||||
|
||||
- name: Generate dependency graph
|
||||
run: mvn -B -f main/pom.xml com.github.ferstl:depgraph-maven-plugin:4.0.1:graph
|
||||
|
||||
- name: Upload dependency graph artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -44,18 +39,15 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- name: Build with Maven (Skip Tests)
|
||||
run: mvn -B package -DskipTests
|
||||
working-directory: main
|
||||
|
||||
- name: Create JPackage App Image
|
||||
shell: pwsh
|
||||
run: |
|
||||
@@ -66,18 +58,15 @@ jobs:
|
||||
--dest dist `
|
||||
--type app-image `
|
||||
--win-console
|
||||
|
||||
- name: Inject java.exe (Fix Process Spawning)
|
||||
- name: Inject java.exe
|
||||
shell: pwsh
|
||||
run: |
|
||||
$javaPath = (Get-Command java).Source
|
||||
Copy-Item -Path $javaPath -Destination "dist/DTSS/runtime/bin/"
|
||||
|
||||
- name: Zip Windows Release
|
||||
shell: pwsh
|
||||
run: |
|
||||
Compress-Archive -Path "dist/DTSS" -DestinationPath "dist/DTSS-Windows.zip"
|
||||
|
||||
- name: Upload Windows Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -96,13 +85,11 @@ jobs:
|
||||
with:
|
||||
name: package
|
||||
path: main/target/
|
||||
|
||||
- name: Download Windows Zip
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-package
|
||||
path: windows-dist/
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user