Publish package to the Maven Central Repository #15
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
| name: Publish package to the Maven Central Repository | |
| on: | |
| release: | |
| types: [ published ] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Decode the secret key | |
| run: echo $GPG_KEYRING_FILE_CONTENT | base64 --decode > ~/secring.gpg | |
| env: | |
| GPG_KEYRING_FILE_CONTENT: "${{ secrets.GPG_KEYRING_FILE_CONTENT }}" | |
| - name: Publish package | |
| run: ./gradlew publish -Psigning.secretKeyRingFile=$(echo ~/secring.gpg) -Psigning.password=$GPG_PASSWORD -Psigning.keyId=$GPG_KEY_ID | |
| env: | |
| NEXUS_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
| NEXUS_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
| GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
| GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
| update-api-documentation: | |
| runs-on: ubuntu-latest | |
| needs: publish | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'adopt' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Generate API documentation | |
| run: ./gradlew dokkaHtmlMultiModule | |
| - name: Deploy API documentation to Github Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| BRANCH: gh-pages | |
| FOLDER: build/dokka/htmlMultiModule |