Init and Update #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 | |
| on: | |
| push: | |
| branches: [ publishing ] | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Check api | |
| run: ./gradlew apiCheck | |
| release: | |
| name: Release to Sonatype | |
| if: ${{ github.event_name != 'pull_request' }} | |
| runs-on: macos-latest | |
| needs: | |
| - check | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Write secrets to local.properties | |
| if: ${{ github.event_name != 'pull_request' }} | |
| run: | | |
| echo sonatypeUsername="${SONATYPE_USERNAME}" >> "local.properties" | |
| echo sonatypePassword="${SONATYPE_PASSWORD}" >> "local.properties" | |
| echo gpgKeyId="${GPG_KEY_ID}" >> "local.properties" | |
| echo gpgKeySecret="${GPG_KEY_SECRET}" >> "local.properties" | |
| echo gpgKeyPassword="${GPG_KEY_PASSWORD}" >> "local.properties" | |
| env: | |
| SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
| SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
| GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | |
| GPG_KEY_SECRET: ${{ secrets.GPG_KEY_SECRET }} | |
| GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} | |
| - name: Release to sonatype | |
| run: ./gradlew publish | |
| documentation: | |
| name: Publish documentation | |
| if: ${{ github.event_name != 'pull_request' }} | |
| runs-on: ubuntu-latest | |
| needs: | |
| - check | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v3 | |
| - name: Generate api docs with dokka | |
| run: ./gradlew dokkaHtml | |
| - name: Upload pages | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs | |
| - name: Release to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |