-
Notifications
You must be signed in to change notification settings - Fork 6
30 lines (27 loc) · 1.03 KB
/
publish.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
name: Deploy
on: deployment
jobs:
build:
if: github.event.deployment.environment == 'production'
name: Deploy to maven central
runs-on: ubuntu-latest
env:
MAVEN_GPG_SIGN_KEY: '${{ secrets.MAVEN_GPG_SIGN_KEY }}'
username: '${{ secrets.maven_deploy_username }}'
password: '${{ secrets.maven_deploy_password }}'
passphrase: '${{ secrets.gpg_passphrase }}'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: setup
run: |
echo -e "$MAVEN_GPG_SIGN_KEY" | gpg --batch --import -
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys $gpgkey
rm -rf $HOME/.m2/settings.xml
echo -e "<settings>\n<servers>\n<server>\n<id>ossrh</id>\n<username>$username</username>\n<password>$password</password>\n</server>\n</servers>\n</settings>" > $HOME/.m2/settings.xml
- name: Deploy
run: |
mvn clean deploy -Dgpg.passphrase=$passphrase