Skip to content

Commit 960f6ee

Browse files
committed
Add GitHub publish on release action
1 parent cac5b23 commit 960f6ee

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

.github/maven-central-settings.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
3+
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
<servers>
6+
<server>
7+
<id>ossrh</id>
8+
<username>${env.MAVEN_USERNAME}</username>
9+
<password>${env.MAVEN_PASSWORD}</password>
10+
</server>
11+
</servers>
12+
</settings>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish JRE11 to the Maven Central
2+
on:
3+
release:
4+
types: [created]
5+
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
environment: maven-central
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v4
16+
with:
17+
java-version: 11
18+
distribution: 'temurin'
19+
server-id: ossrh
20+
- name: Import GPG Key
21+
uses: crazy-max/ghaction-import-gpg@v6
22+
with:
23+
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
24+
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
25+
- name: Publish package
26+
run: mvn -B -Pmaven-central -Dgpg.passphrase=${{secrets.MAVEN_GPG_PASSPHRASE}} -s .github/maven-central-settings.xml deploy
27+
env:
28+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
29+
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

0 commit comments

Comments
 (0)