Skip to content

Commit ba6f31b

Browse files
committed
Update GitHub Actions Workflow to modern actions and versions
1 parent faa2804 commit ba6f31b

1 file changed

Lines changed: 18 additions & 25 deletions

File tree

.github/workflows/maven.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,16 @@ jobs:
1717

1818
steps:
1919
- name: Check out Git repository
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v3
2121
with:
2222
submodules: true
2323

2424
- name: Set up Java and Maven
25-
uses: actions/setup-java@v1
25+
uses: actions/setup-java@v3
2626
with:
27+
distribution: zulu
2728
java-version: 11
28-
29-
- name: Cache Maven packages
30-
uses: actions/cache@v1
31-
with:
32-
path: ~/.m2
33-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
34-
restore-keys: ${{ runner.os }}-m2
29+
cache: maven
3530

3631
- name: Build with Maven
3732
run: mvn -B verify
@@ -48,27 +43,25 @@ jobs:
4843

4944
steps:
5045
- name: Check out Git repository
51-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
5247
with:
5348
submodules: true
5449

5550
- name: Set up Java and Maven
56-
uses: actions/setup-java@v1
51+
uses: actions/setup-java@v3
5752
with:
53+
distribution: zulu
5854
java-version: 11
59-
60-
- name: Cache Maven packages
61-
uses: actions/cache@v1
62-
with:
63-
path: ~/.m2
64-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
65-
restore-keys: ${{ runner.os }}-m2
55+
cache: maven
56+
server-id: ossrh
57+
server-username: MAVEN_USERNAME
58+
server-password: MAVEN_CENTRAL_TOKEN
59+
gpg-private-key: ${{ secrets.gpg_private_key }}
60+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
6661

6762
- name: Publish Maven package
68-
uses: samuelmeuli/action-maven-publish@v1
69-
with:
70-
gpg_private_key: ${{ secrets.gpg_private_key }}
71-
gpg_passphrase: ${{ secrets.gpg_passphrase }}
72-
nexus_username: ${{ secrets.nexus_username }}
73-
nexus_password: ${{ secrets.nexus_password }}
74-
maven_profiles: ossrh-deploy
63+
run: mvn -Possrh-deploy -B deploy
64+
env:
65+
MAVEN_GPG_PASSPHRASE: ${{ secrets.gpg_passphrase }}
66+
MAVEN_USERNAME: ${{ secrets.nexus_username }}
67+
MAVEN_CENTRAL_TOKEN: ${{ secrets.nexus_password }}

0 commit comments

Comments
 (0)