-
-
Notifications
You must be signed in to change notification settings - Fork 11
37 lines (37 loc) · 1.53 KB
/
publish_to_mvn-central.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
name: Publish package to the Maven Central Repository
on:
# push:
# branches: [ v0.9-DEV ]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Install gpg key and publish package
run: |
echo -e "Releasing ${{ github.ref_name }}"
echo -e "$(tty)"
gpg --version
mvn -version
# This avoids gpg: signing failed: Inappropriate ioctl for device error
# See https://github.com/keybase/keybase-issues/issues/2798
export GPG_TTY=$(tty)
# export GPG_TTY=`tty`
# https://gist.github.com/sualeh/ae78dc16123899d7942bc38baba5203c
echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}" | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
# mvn --batch-mode deploy -Drevision=${{ github.ref_name }} -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DperformRelease=true
mvn --batch-mode clean deploy -Drevision=${{ github.ref_name }} -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} -DperformRelease=true
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}