Skip to content

Commit

Permalink
Refactor: Separate docs generation into dedicated workflow
Browse files Browse the repository at this point in the history
Moved docs generation from the build workflow to a dedicated workflow triggered manually.
Updated the release workflow to use a
 specific Gradle task for publishing.
Removed unnecessary environment variables and CI flow variable from the release workflow.
  • Loading branch information
niyajali committed Sep 27, 2024
1 parent 143b3b7 commit 4a4a4c4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,3 @@ jobs:
- name: KotlinPoet check
if: "matrix.os != 'ubuntu-latest'"
run: ./gradlew check

build-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 19
- uses: gradle/actions/setup-gradle@v4

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Prep docs
run: ./gradlew dokkaHtml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Build mkdocs
run: |
pip3 install -r .github/workflows/mkdocs-requirements.txt
mkdocs build
35 changes: 35 additions & 0 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Generate Docs

on:
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 19
- uses: gradle/actions/setup-gradle@v4

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Prep docs
run: ./gradlew dokkaHtml

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Build mkdocs
run: |
pip3 install -r .github/workflows/mkdocs-requirements.txt
mkdocs build
10 changes: 3 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,17 @@ jobs:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
CI_FLOW: ${{ github.workflow }}
run: ./gradlew publish --stacktrace
run: ./gradlew publishKotlinMultiplatformPublicationToMavenCentralRepository --stacktrace

- name: Finish Maven Central Release
env:
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.MAVEN_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_TOKEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
CI_FLOW: ${{ github.workflow }}
run: ./gradlew releaseRepository --no-daemon --stacktrace


Expand Down

0 comments on commit 4a4a4c4

Please sign in to comment.