Sign and Publish Android Library #12
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 Android Library | |
on: | |
workflow_dispatch: | |
inputs: | |
androidVersionName: | |
description: 'Android Version Name (eg. 0.9.0)' | |
required: true | |
jobs: | |
build: | |
name: 🔨 Build | |
runs-on: ubuntu-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 | |
unit-tests: | |
name: 🧪 Run Tests | |
runs-on: ubuntu-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: Execute unit tests | |
run: ./gradlew :daraja:check --stacktrace | |
deploy-android: | |
name: 🚀 Sign and Publish Android Library | |
runs-on: ubuntu-latest | |
needs: [ build, unit-tests ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Clean & Build | |
run: ./gradlew :daraja:clean :daraja:build --stacktrace | |
- name: Sign and Publish Android Library | |
run: ./gradlew :daraja:publishAndroidReleasePublicationToSonatypeRepository --max-workers 1 --stacktrace | |
env: | |
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
POM_VERSION: ${{ github.event.inputs.androidVersionName }} | |
POM_NAME: ${{ secrets.POM_NAME }} | |
POM_DESCRIPTION: ${{ secrets.POM_DESCRIPTION }} | |
POM_GROUPID: ${{ secrets.POM_GROUPID }} | |
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 }} |