fix: add explicity username and password on deploy #18
This file contains hidden or 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: Publish package to GitHub Packages | ||
| on: | ||
| push: | ||
| branches: | ||
| - '*' | ||
| # tags: | ||
| # - '*' | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '22' | ||
| distribution: 'corretto' | ||
| server-id: central | ||
| - id: install-secret-key | ||
| name: Install gpg secret key | ||
| env: | ||
| GPG_PASSWORD_KEY: ${{ secrets.GPG_PASSWORD_KEY }} | ||
| run: | | ||
| cat <(echo -e "${{ secrets.GPG_SECRET_KEY }}") | gpg --batch --import | ||
| gpg --list-secret-keys --keyid-format LONG | ||
| gpg --pinentry-mode loopback --passphrase "$GPG_PASSWORD_KEY" --sign README.md | ||
| - id: publish-to-central | ||
| name: Publish to Central Repository | ||
| bash: shell | ||
| env: | ||
| CENTRAL_MAVEN_USERNAME: ${{ secrets.CENTRAL_MAVEN_USERNAME }} | ||
| CENTRAL_MAVEN_PASSWORD: ${{ secrets.CENTRAL_MAVEN_PASSWORD }} | ||
| GPG_PASSWORD_KEY: ${{ secrets.GPG_PASSWORD_KEY }} | ||
| GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }} | ||
| run: | | ||
| mvn \ | ||
| --no-transfer-progress \ | ||
| --batch-mode \ | ||
| -Dgpg.passphrase="$GPG_PASSWORD_KEY" \ | ||
| -Dgpg.keyname="$GPG_KEY_NAME" \ | ||
| -Dgpg.arguments="--pinentry-mode loopback" \ | ||
| -DskipTests \ | ||
| -Dcentral.username="$CENTRAL_MAVEN_USERNAME" \ | ||
| -Dcentral.password="$CENTRAL_MAVEN_PASSWORD" \ | ||
| clean deploy | ||