-
Notifications
You must be signed in to change notification settings - Fork 291
42 lines (36 loc) · 1.45 KB
/
release.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
# See:
# https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven
# https://central.sonatype.org/pages/apache-maven.html
# https://github.com/actions/setup-java
name: release
on:
workflow_dispatch:
jobs:
release:
environment: maven_central
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Maven Central repository
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
server-id: ossrh
server-username: MAVEN_USERNAME # env variable to use for username in release
server-password: MAVEN_PASSWORD # env variable to use for password in release
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release
- name: Set up Git user
run: |
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: Release
run: |
mvn -B -Dusername=${{ secrets.GH_USERNAME }} -Dpassword=${{ secrets.GH_ACCESS_TOKEN }} release:prepare
mvn -B release:perform
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}