-
Notifications
You must be signed in to change notification settings - Fork 39
40 lines (36 loc) · 956 Bytes
/
build.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
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java 11 and Apache Maven
uses: actions/setup-java@v1
with:
java-version: 11
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Build Project
run: mvn clean verify
- name: Publish Snapshots
if: github.ref == 'refs/heads/master'
run: |
# Find version
ver=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ $ver == *"SNAPSHOT"* ]]
then
mvn deploy
fi
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}