fix: simple #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Maven Package | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
server-id: ossrh | |
settings-path: ${{ github.workspace }} | |
- name: Import GPG key | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
run: | | |
echo "$GPG_PRIVATE_KEY" | gpg --batch --yes --import | |
gpg --list-secret-keys | |
- name: Verify GPG Passphrase | |
env: | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
run: | | |
echo "test message" | gpg --batch --yes --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" --sign --local-user [email protected] | |
- name: Set up Maven settings | |
run: | | |
mkdir -p ~/.m2 | |
echo "<settings> | |
<servers> | |
<server> | |
<id>ossrh</id> | |
<username>${{ secrets.OSSRH_USERNAME }}</username> | |
<password>${{ secrets.OSSRH_PASSWORD }}</password> | |
</server> | |
</servers> | |
<profiles> | |
<profile> | |
<id>gpg-sign</id> | |
<properties> | |
<gpg.executable>gpg</gpg.executable> | |
<gpg.keyname>[email protected]</gpg.keyname> | |
<gpg.passphrase>${{ secrets.GPG_PASSPHRASE }}</gpg.passphrase> | |
</properties> | |
</profile> | |
</profiles> | |
<activeProfiles> | |
<activeProfile>gpg-sign</activeProfile> | |
</activeProfiles> | |
</settings>" > ~/.m2/settings.xml | |
- name: Publish to OSSRH | |
run: mvn deploy | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |