Merge pull request #13 from solrudev/develop #29
This file contains 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: ci | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- master | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build Ackpine | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@v1 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Validate binary compatibility | |
run: | | |
./gradlew apiCheck || { exit_code=$?; printf "*** This PR changes Ackpine's public API. If this is intentional, run './gradlew apiDump' and commit the new API dumps. ***"; exit $exit_code; } | |
- name: Build | |
run: | | |
./gradlew buildAckpine --stacktrace | |
publish: | |
name: Upload artifacts | |
runs-on: ubuntu-latest | |
if: github.repository == 'solrudev/Ackpine' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[docs]') | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Publish | |
run: | | |
./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 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 }} | |
publish-docs: | |
name: Publish documentation | |
runs-on: ubuntu-latest | |
if: github.repository == 'solrudev/Ackpine' && github.ref == 'refs/heads/master' | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: adopt | |
java-version: 17 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11.4 | |
- name: Prepare API docs | |
run: | | |
./gradlew dokkaHtmlMultiModule | |
- name: Build MkDocs | |
run: | | |
pip3 install --upgrade pip && pip3 install mkdocs-material mkdocs-minify-plugin | |
mkdocs build | |
- name: Deploy docs | |
if: success() | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
BRANCH: gh-pages | |
FOLDER: site | |
SINGLE_COMMIT: true |