Skip to content

Commit 8af6d07

Browse files
committed
Add release workflow
1 parent 8bf7e35 commit 8af6d07

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See:
2+
# https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven
3+
# https://central.sonatype.org/pages/apache-maven.html
4+
# https://github.com/actions/setup-java
5+
6+
name: release
7+
8+
on:
9+
workflow_dispatch:
10+
11+
jobs:
12+
release:
13+
environment: maven_central
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout sources
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Maven Central repository
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '11'
23+
distribution: 'temurin'
24+
server-id: ossrh
25+
server-username: MAVEN_USERNAME # env variable to use for username in release
26+
server-password: MAVEN_PASSWORD # env variable to use for password in release
27+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28+
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release
29+
30+
- name: Set up Git user
31+
run: |
32+
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
33+
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
34+
35+
- name: Release
36+
run: |
37+
mvn -B release:prepare release:perform
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
42+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)