Skip to content

Commit 10b4fbe

Browse files
authored
publish.yml
Created publish yml
1 parent 8c137d5 commit 10b4fbe

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: release and push to central
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Java for publishing to Maven Central Repository
12+
uses: actions/setup-java@v1
13+
with:
14+
java-version: 1.8
15+
server-id: ossrh
16+
server-username: MAVEN_USERNAME
17+
server-password: MAVEN_PASSWORD
18+
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
19+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
20+
- name: build artifact
21+
run: mvn clean package
22+
- name: Create release
23+
uses: ncipollo/release-action@v1
24+
with:
25+
allowUpdates: true
26+
artifacts: "${{ github.workspace }}/target/*.jar"
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Publish to the Maven Central Repository
29+
run: |
30+
mvn \
31+
--no-transfer-progress \
32+
--batch-mode \
33+
deploy
34+
env:
35+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
36+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
37+
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

0 commit comments

Comments
 (0)