Skip to content

Workflow file for this run

name: Generate Docs, publish docs and build & publish the code
on:
release:
# We'll run this workflow when a new GitHub release is created
types: [ released ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
pull-requests: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
generate-docs:
name: Generate docs for current version and updates docs folder
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Generate Dokka HTML
run: ./gradlew dokkahtml
- name: Commit changes
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "Docs updated"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish:
name: Release build and publish
runs-on: ubuntu-latest
needs: generate-docs
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
- name: Change wrapper permissions
run: chmod +x ./gradlew
# Builds the release artifacts of the library
- name: Release build
run: ./gradlew publishToMavenLocal
# Generates other artifacts (javadocJar is optional)
# - name: Source jar and dokka
# run: ./gradlew androidSourcesJar javadocJar
#Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishAllPublicationsToSonatypeRepository closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}