Publish new release #4
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: Publish new release | |
on: | |
workflow_dispatch: | |
inputs: | |
versionName: | |
description: "Version Name" | |
required: true | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Grant Permission to Execute Gradle | |
run: chmod +x gradlew | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 | |
- name: Publish to MavenCentral | |
run: ./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }} | |
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }} | |
documentation: | |
runs-on: ubuntu-latest | |
needs: publish | |
steps: | |
- name: Checkout branch code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Grant Permission to Execute Gradle | |
run: chmod +x gradlew | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 | |
- name: Build documentation with Dokka | |
run: | | |
./gradlew :modules:dokkaHtmlMultiModule | |
- name: Setup Python 3 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
cache: "pip" | |
- name: Install necessary pip package | |
run: pip install -r requirements.txt | |
- name: Deploy documentation with mkdocs | |
run: mkdocs gh-deploy --force | |
release: | |
runs-on: ubuntu-latest | |
needs: [ publish, documentation ] | |
steps: | |
- name: Checkout branch code | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "17" | |
distribution: "adopt" | |
- name: Grant Permission to Execute Gradle | |
run: chmod +x gradlew | |
- name: Validate Gradle wrapper | |
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3 | |
- name: Build with Gradle | |
run: | | |
./gradlew build | |
- name: Create new tag | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "jimlyas" | |
git tag -a $TAG -m "Release v$TAG" | |
git push origin $TAG | |
env: | |
TAG: ${{ github.event.inputs.versionName }} | |
- name: Create new release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ github.event.inputs.versionName }} | |
tag: ${{ github.event.inputs.versionName }} | |
artifacts: "modules/data/build/outputs/aar/data-debug.aar,modules/presentation/build/outputs/aar/presentation-debug.aar,modules/utilities/build/outputs/aar/utilities-debug.aar" | |
body: "new release" |