Skip to content

Commit

Permalink
feature: add maven release to github release action
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoesle committed Apr 8, 2024
1 parent b40ba92 commit c90c471
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/workflow-build-and-release-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
with:
java-version: '17'
distribution: 'corretto'
server-id: "ossrh"
server-username: ${{ secrets.nexus_username }}
server-password: ${{ secrets.nexus_password }}
- name: PREP / Set up QEMU
if: inputs.docker-release == true
uses: docker/setup-qemu-action@v3
Expand All @@ -59,6 +62,26 @@ jobs:
run: |
chmod +x ./mvnw
./mvnw versions:set --batch-mode -DremoveSnapshot -DprocessAllModules
#
# The GPG key is stored in the secret using the text 'PGP Private Key' format
# Import it to GPG keyring and trust it.
#
- name: RELEASE / Import GPG key
# if: inputs.maven-release == true
run: echo "${{ secrets.gpg_private_key }}" | gpg --import --no-tty --batch --yes --always-trust

#
# Show available keys. This will hide the key name (since it is in the secrets), but show for example expiration date
#
- name: RELEASE / List GPG keys available
# if: inputs.maven-release == true
run: gpg --list-secret-keys --keyid-format=long

- name: RELEASE / Build and Release Maven
if: inputs.maven-release == true
run: ./mvnw --batch-mode --no-transfer-progress deploy --activate-profiles release -DskipTests -Dgpg.keyname="${{ secrets.gpg_keyname }}" -Dgpg.passphrase="${{ secrets.gpg_passphrase }}"

- name: RELEASE / Build and Release Maven
if: inputs.maven-release == true
uses: samuelmeuli/action-maven-publish@v1
Expand Down

0 comments on commit c90c471

Please sign in to comment.