-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (46 loc) · 1.61 KB
/
publish.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
# This is a basic workflow to help you get started with Actions
name: Java CI with Maven
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Verify with Maven
if: github.event_name == 'pull_request'
run: mvn -B clean verify
- name: Verify javadoc
if: github.event_name == 'pull_request'
run: mvn -B -Prelease javadoc:test-javadoc
- name: Compile
run: mvn -B -Prelease compile
- name: Javadoc
run: mvn -B -Prelease javadoc:jar
- name: Source
run: mvn -B -Prelease source:jar
- name: Publish to Apache Maven Central
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: mvn -B -Prelease deploy
env:
OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}