Skip to content

Generate Docs, publish docs and build & publish the code #89

Generate Docs, publish docs and build & publish the code

Generate Docs, publish docs and build & publish the code #89

Workflow file for this run

name: Generate Docs, publish docs and build & publish the code
on:
release:
types: [ prereleased ] # We'll run this workflow when a new GitHub pre-release is created
# 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 "[email protected]"
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 }}
branch: dev
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
#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 }}