Skip to content

Commit 365e4bb

Browse files
Update build.yml
1 parent 6f21d2d commit 365e4bb

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,45 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
pull-requests: read
12+
913
jobs:
1014
build:
1115
name: 🔨 Build and Package
1216
runs-on: ubuntu-latest
13-
17+
1418
steps:
1519
- name: 🧩 Checkout source code
1620
uses: actions/checkout@v4
17-
21+
1822
- name: ☕ Set up Java
1923
uses: actions/setup-java@v4
2024
with:
2125
distribution: 'temurin'
2226
java-version: '21'
2327
cache: maven
24-
28+
29+
- name: 🔧 Make Maven wrapper executable
30+
run: chmod +x mvnw
31+
2532
- name: 🧰 Build using Maven Wrapper
2633
run: ./mvnw -B clean package
27-
34+
2835
- name: 📦 Upload built JAR artifact
36+
if: success()
2937
uses: actions/upload-artifact@v4
3038
with:
31-
name: MyCMD-GUI
39+
name: MyCMD-GUI-${{ github.sha }}
3240
path: target/*.jar
41+
retention-days: 30
42+
43+
- name: 📊 Upload test results (if any)
44+
if: always()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: test-results-${{ github.sha }}
48+
path: target/surefire-reports/
49+
retention-days: 7
50+
continue-on-error: true

0 commit comments

Comments
 (0)