-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (33 loc) · 1.13 KB
/
push-snapshots.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
name: Deploy snapshots
# see https://docs.github.com/en/actions/guides/publishing-java-packages-with-maven
on:
push:
branches:
- main
jobs:
release:
name: Release on Sonatype OSS
runs-on: ubuntu-latest
if: github.repository_owner == 'intoolswetrust'
steps:
- uses: actions/checkout@v2
- name: Set up Apache Maven Central
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Apache Maven Central
run: |
PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
if [[ "$PROJECT_VERSION" == *-SNAPSHOT ]]; then
mvn --batch-mode -Prelease deploy
fi
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}