-
-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (52 loc) · 1.73 KB
/
maven.yml
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
name: Maven
on: [push, pull_request]
jobs:
build:
name: Test with Java ${{ matrix.jdk }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
jdk: ['8', '11', '17', '21']
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.jdk }}
cache: 'maven'
- name: Build with Maven
run: mvn -B package --file pom.xml
# deploy:
# name: Deploy Artifact
# needs: build
# continue-on-error: true
# if: ${{ needs.build.result == 'success' && github.ref == 'refs/heads/main' }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up JDK 8
# uses: actions/setup-java@v4
# with:
# distribution: temurin
# java-version: 8
# cache: maven
# #server-id: github
# server-id: ossrh
# server-username: MAVEN_USERNAME
# server-password: MAVEN_PASSWORD
# gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
# gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
# - name: Maven Deploy (GitHub Packages)
# run: mvn deploy -Prelease,githubPackages -DskipTests=true
# with:
# server-id: github
# env:
# GITHUB_TOKEN: ${{ github.token }}
# - name: Maven Deploy (Maven Central)
# run: mvn deploy -Prelease -DskipTests=true
# env:
# MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
# MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
# MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}