version 3.6.0 #7
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: Build and Publish | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- 'v*' | |
paths-ignore: | |
- '**/README.md' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/setup-gradle | |
- name: Check api | |
run: ./gradlew apiCheck | |
build: | |
strategy: | |
matrix: | |
config: [ | |
{ target: android, os: ubuntu-latest, tasks: testDebugUnitTest, continueOnError: false }, | |
] | |
runs-on: ${{ matrix.config.os }} | |
name: Test ${{ matrix.config.target }} | |
needs: check | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/setup-gradle | |
- name: Test ${{ matrix.config.target }} targets | |
continue-on-error: ${{ matrix.config.continueOnError }} | |
run: ./gradlew ${{ matrix.config.tasks }} | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: macOS-latest | |
needs: | |
- build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup environment | |
uses: ./.github/setup-gradle | |
- name: Generate docs with dokka | |
run: ./gradlew dokkaHtmlMultiModule #TODO Needs to be uploaded to Github Pages | |
- name: Publish to MavenCentral | |
run: ./gradlew publishAndReleaseToMavenCentral --no-configuration-cache | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }} | |
- name: Create new release from tag | |
env: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true | |
token: ${{ env.github_token }} | |