Skip to content

ENG-19397: add gpg key import #2

ENG-19397: add gpg key import

ENG-19397: add gpg key import #2

Workflow file for this run

name: Publish Package to Maven Central Repository
env:
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_KEY }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} #
MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.NEXUS_PASSWORD }}
on:
# repository_dispatch:
# types: [API-DocumentationV3-Publish]
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
jobs:
build-and-publish:
name: >-
Build and Publish
runs-on: gcp-runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 1.11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
- name: Import GPG key
run: |
echo "${{ secrets.MAVEN_GPG_KEY }}" | base64 --decode > private_key.gpg
gpg --batch --import private_key.gpg
rm private_key.gpg
- name: Build
run: mvn -B package --file pom.xml
- name: Prepare Maven environnement for deployment to Sonatype
run: export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
- name: Publish
run: mvn clean deploy
github-release:
name: >-
Upload to Github Release
needs:
- build-and-publish
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""