Skip to content

Commit 727365c

Browse files
author
Build Pipeline
committed
update action
1 parent 74a27c4 commit 727365c

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

.github/workflows/maven-publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ jobs:
2020
uses: actions/setup-java@v1
2121
with:
2222
java-version: 1.8
23-
24-
- name: Build with Maven
23+
- name: GPG Setup
24+
env:
25+
GPG_KEY_BASE64: ${{ secrets.GPG_KEY_BASE64 }}
26+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
27+
run: ./gpg-setup.sh
28+
- name: Deploy to OSS Sonatype
2529
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2631
OSS_SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
2732
run: mvn -B -Prelease source:jar javadoc:jar deploy --file pom.xml -s settings-template.xml -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}

gpg-setup.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
#
4+
# Prepare GPG Key is expected to be in base64
5+
# Exported with gpg -a --export-secret-keys "your@email" | base64 > gpg.base64
6+
#
7+
printf "$GPG_KEY_BASE64" | base64 --decode > gpg.asc
8+
echo ${GPG_PASSPHRASE} | gpg --batch --yes --passphrase-fd 0 --import gpg.asc
9+
gpg -k

0 commit comments

Comments
 (0)