-
Notifications
You must be signed in to change notification settings - Fork 42
56 lines (49 loc) · 1.62 KB
/
maven-central-push.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
name: Java CI with Maven (Push)
on:
push:
branches: [master]
jobs:
check-pr-labels:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
labels: ${{ steps.get-pr.outputs.pr_labels }}
steps:
- name: Get Pull Request information
uses: 8BitJonny/[email protected]
id: get-pr
build:
runs-on: ubuntu-latest
needs: [check-pr-labels]
if: contains(needs.check-pr-labels.outputs.labels, 'release')
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: "11"
distribution: "adopt"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to Maven Central Packages
run: mvn deploy -B --file pom-maven-central.xml
env:
MAVEN_USERNAME: ${{ secrets.JIRAID }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.JIRAPASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Maven version
uses: JActions/[email protected]
id: get-version
- name: Create a Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: ${{ steps.get-version.outputs.version }}
prerelease: false
title: "Release ${{ steps.get-version.outputs.version }}"