Sign and Publish KMP Library #8
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: Sign and Publish KMP Library | |
on: | |
workflow_dispatch: | |
inputs: | |
versionName: | |
description: 'Version Name (eg. 0.9.0)' | |
required: true | |
jobs: | |
build: | |
name: 🔨 Build, Test & Publish KMP | |
runs-on: macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build with gradle | |
run: ./gradlew :daraja:build --stacktrace | |
- name: Execute unit tests | |
run: ./gradlew :daraja:allTests --stacktrace | |
- name: Sign and Publish Android Library | |
run: ./gradlew clean publishAllPublicationsToSonatypeRepository --max-workers 1 --stacktrace | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
POM_VERSION: ${{ github.event.inputs.versionName }} | |
POM_NAME: ${{ secrets.POM_NAME }} | |
POM_DESCRIPTION: ${{ secrets.POM_DESCRIPTION }} | |
POM_GROUPID: ${{ secrets.POM_GROUPID }} | |
POM_ARTIFACTID: ${{secrets.POM_ARTIFACTID}} | |
POM_URL: ${{ secrets.POM_URL }} | |
POM_DEVELOPER_ID: ${{ secrets.POM_DEVELOPER_ID }} | |
POM_DEVELOPER_NAME: ${{ secrets.POM_DEVELOPER_NAME }} | |
POM_DEVELOPER_EMAIL: ${{ secrets.POM_DEVELOPER_EMAIL }} | |
POM_LICENSE_NAME: ${{ secrets.POM_LICENSE_NAME }} | |
POM_LICENSE_URL: ${{ secrets.POM_LICENSE_URL }} | |
POM_ISSUE_SYSTEM: ${{ secrets.POM_ISSUE_SYSTEM }} | |
POM_ISSUE_URL: ${{ secrets.POM_ISSUE_SYSTEM }} | |
POM_SCM_CONNECTION: ${{ secrets.POM_SCM_CONNECTION }} | |
POM_SCM_DEVELOPER_CONNECTION: ${{ secrets.POM_SCM_DEVELOPER_CONNECTION }} | |
POM_SCM_URL: ${{ secrets.POM_SCM_URL }} | |
SIGNING_ID: ${{ secrets.SIGNING_ID }} | |
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
draft: true | |
prerelease: true | |
tag_name: ${{ github.event.inputs.versionName }} | |
name: Release ${{ github.event.inputs.versionName }} |