0.9.16 General modernisation #26
Workflow file for this run
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
| # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
| # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path | |
| name: Maven Package | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 21 | |
| distribution: 'zulu' | |
| server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | |
| server-username: MAVEN_USERNAME # env variable for username in deploy | |
| server-password: MAVEN_PASSWORD # env variable for token in deploy | |
| - name: Import GPG key | |
| run: | | |
| # Write key and convert escaped newlines (\n) to actual newlines | |
| echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}" > "$RUNNER_TEMP/private-key.asc" | |
| # Check file info | |
| echo "Key file size: $(wc -c < "$RUNNER_TEMP/private-key.asc") bytes" | |
| echo "Key file lines: $(wc -l < "$RUNNER_TEMP/private-key.asc") lines" | |
| # Verify it looks like a proper PGP key | |
| if grep -q "BEGIN PGP PRIVATE KEY BLOCK" "$RUNNER_TEMP/private-key.asc"; then | |
| echo "✓ File contains PGP key header" | |
| else | |
| echo "✗ File does NOT contain PGP key header!" | |
| exit 1 | |
| fi | |
| # Import the key | |
| gpg --batch --import "$RUNNER_TEMP/private-key.asc" | |
| # List imported keys | |
| echo "Successfully imported keys:" | |
| gpg --list-secret-keys --keyid-format LONG | |
| # Clean up | |
| rm "$RUNNER_TEMP/private-key.asc" | |
| - name: Publish package | |
| run: mvn --no-transfer-progress --batch-mode -DperformRelease=true clean deploy | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} |