Skip to content

test: enforce test coverage (#178) #114

test: enforce test coverage (#178)

test: enforce test coverage (#178) #114

on:
push:
branches:
- main
name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: simple
command: manifest
default-branch: main
- name: Dump Release Please Output
env:
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
run: |
echo "$RELEASE_PLEASE_OUTPUT"
outputs:
release_created: ${{ steps.release.outputs.release_created }}
kotlin-release:
needs: release-please
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
# The logic below handles the github release:
- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/checkout@v4
with:
ref: ${{ needs.release-please.outputs.release_tag_name }}
- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
gpg --pinentry-mode=loopback --passphrase $GPG_SIGNING_KEY_PASSWORD --export-secret-key $GPG_SIGNING_KEY_ID > ~/.gnupg/secring.gpg
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
- name: Add signing secrets to gradle.properties
run: |
mkdir -p ~/.gradle/
echo "signing.keyId=$GPG_SIGNING_KEY_ID" >> ~/.gradle/gradle.properties
echo "signing.password=$GPG_SIGNING_KEY_PASSWORD" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=/home/runner/.gnupg/secring.gpg" >> ~/.gradle/gradle.properties
env:
GPG_SIGNING_KEY_ID: ${{ secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY_PASSWORD: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'zulu'
- name: Grant Permission for Gradlew to Execute
run: chmod +x gradlew
- name: Publish to Sonatype
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --no-daemon --stacktrace
- name: Clean up signing secrets
run: rm ~/.gradle/gradle.properties