-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (90 loc) · 2.98 KB
/
Copy pathbuild.yml
File metadata and controls
104 lines (90 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build and Package
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master ]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Create Maven settings.xml for private packages
run: |
mkdir -p ~/.m2
cat > ~/.m2/settings.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>api</id>
<username>ady88</username>
<password>${{ secrets.PACKAGES_TOKEN }}</password>
</server>
<server>
<id>core</id>
<username>ady88</username>
<password>${{ secrets.PACKAGES_TOKEN }}</password>
</server>
<server>
<id>github</id>
<username>ady88</username>
<password>${{ secrets.PACKAGES_TOKEN }}</password>
</server>
</servers>
</settings>
EOF
- name: Clean and compile
run: mvn clean compile
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Copy dependencies for jlink
run: mvn dependency:copy-dependencies -DoutputDirectory=target/dependencies
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Test jlink compatibility
run: |
echo "=== Testing jlink compatibility for helper.lib module ==="
# Include dependencies in module path for jlink
jlink --module-path target/classes:target/dependencies:$JAVA_HOME/jmods \
--add-modules helper.lib \
--output custom-runtime-lib \
--compress 2
echo "Helper-lib jlink test successful"
ls -la custom-runtime-lib/
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Run tests
run: mvn test
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Package JAR
run: mvn package
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: helper-lib-jar
path: target/*.jar
retention-days: 30
- name: Deploy to GitHub Packages
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')
run: mvn deploy -DskipTests
env:
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN }}