Automatically update Java SDK #59
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 Maven Package | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '11' | |
| distribution: 'temurin' | |
| server-id: central | |
| overwrite-settings: false | |
| # Import GPG key for signing | |
| - name: Import GPG key | |
| run: | | |
| echo "$MAVEN_CENTRAL_SECRET_KEY" > private.key | |
| gpg --batch --import private.key | |
| # Optional: Check that the key was imported successfully | |
| gpg --list-keys | |
| env: | |
| MAVEN_CENTRAL_SECRET_KEY: ${{ secrets.MAVEN_CENTRAL_SECRET_KEY }} | |
| - name: Build with Maven | |
| run: mvn -B package --file pom.xml | |
| - name: Publish to Apache Maven | |
| run: mvn deploy -s settings.xml | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.MAVEN_CENTRAL_SECRET_KEY_PASSWORD }} | |
| GPG_KEY: ${{ secrets.MAVEN_CENTRAL_SECRET_KEY_KEY_ID }} | |
| MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} | |
| MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} |