-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.41 KB
/
merge-to-master.yaml
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
name: Merge to Master
on:
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v4.2.1
with:
java-version: 8.0.412+8
distribution: 'adopt'
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- uses: s4u/maven-settings-action@v3.0.0
with:
servers: |
[{
"id": "central",
"username": "${{ secrets.OSSRH_USERNAME }}",
"password": "${{ secrets.OSSRH_TOKEN }}"
}]
- name: Bump version and push tag
id: version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_branches: master
create_annotated_tag: false
tag_prefix: ''
default_bump: false
- name: Bump version in pom.xml
run: mvn versions:set -DnewVersion=${{ steps.version.outputs.new_tag }}
- name: Build with Maven
if: steps.version.outputs.new_tag != undefined
run: mvn -B package --file pom.xml
- name: Publish to Maven Central
if: steps.version.outputs.new_tag != undefined
run: mvn deploy