Release v1.2.0 alpha02 #85
Workflow file for this run
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: Build | |
on: | |
push: | |
branches: [ "main" ] | |
tags: | |
- 'v*' | |
paths-ignore: | |
- '**/README.md' | |
pull_request: | |
branches: [ "main" ] | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
# 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@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup gradle | |
uses: gradle/[email protected] | |
- name: Check api | |
run: ./gradlew apiCheck | |
build: | |
strategy: | |
matrix: | |
config: [ | |
{ target: android, os: ubuntu-latest, tasks: testDebugUnitTest testReleaseUnitTest, continueOnError: false }, | |
{ target: apple, os: macos-latest, tasks: iosX64Test iosSimulatorArm64Test, continueOnError: false }, | |
] | |
runs-on: ${{ matrix.config.os }} | |
name: Build ${{ matrix.config.target }} | |
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/[email protected] | |
- 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 | |
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/[email protected] | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Generate docs with dokka | |
run: ./gradlew dokkaHtmlMultiModule | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: ${{ github.workspace }}/build/dokka/htmlMultiModule | |
- name: Release to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
- 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 }} | |
create-staging-repository: | |
runs-on: ubuntu-latest | |
name: Create staging repository | |
needs: release | |
outputs: | |
repository_id: ${{ steps.create.outputs.repository_id }} | |
steps: | |
- id: create | |
uses: nexus-actions/[email protected] | |
with: | |
username: ${{ secrets.SONATYPE_USERNAME }} | |
password: ${{ secrets.SONATYPE_PASSWORD }} | |
staging_profile_id: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | |
description: Created by GitHub Actions | |
base_url: https://s01.oss.sonatype.org/service/local/ | |
publish: | |
name: Publish to Maven | |
runs-on: macos-latest | |
needs: create-staging-repository | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Setup gradle | |
uses: gradle/[email protected] | |
- name: Write secrets to local.properties | |
run: | | |
echo sonatypeUsername="${SONATYPE_USERNAME}" >> "local.properties" | |
echo sonatypePassword="${SONATYPE_PASSWORD}" >> "local.properties" | |
echo gpgKeyPassword="${GPG_KEY_PASSWORD}" >> "local.properties" | |
echo gpgKeySecret="${GPG_KEY_SECRET}" >> "local.properties" | |
env: | |
SONATYPE_REPOSITORY_ID: ${{ needs.create-staging-repository.outputs.repository_id }} | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_KEY_PASSWORD: ${{ secrets.GPG_KEY_PASSWORD }} | |
GPG_KEY_SECRET: ${{ secrets.GPG_KEY_SECRET }} | |
- name: Release to sonatype | |
run: ./gradlew publishAllPublicationsToMavenRepository | |
close-staging-repository: | |
name: Close staging repository | |
runs-on: ubuntu-latest | |
needs: [ create-staging-repository, publish ] | |
if: ${{ always() && needs.create-staging-repository.result == 'success' }} | |
steps: | |
- name: Close staging repository | |
uses: nexus-actions/release-nexus-staging-repo@6632a81bfab63557b2717e8423b0a620ae5aa414 | |
with: | |
username: ${{ secrets.SONATYPE_USERNAME }} | |
password: ${{ secrets.SONATYPE_PASSWORD }} | |
staging_repository_id: ${{ needs.create-staging-repository.outputs.repository_id }} | |
base_url: https://s01.oss.sonatype.org/service/local/ |