diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 5d31f72..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: docs - -on: - release: - types: - - created - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Export docs - env: - ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }} - run: ./gradlew dokkaHtmlMultiModule - - - name: Setup Pages - uses: actions/configure-pages@v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: 'docs' - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f6a9b7e..a83157c 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -8,6 +8,15 @@ on: types: - created +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "master" + cancel-in-progress: false + jobs: build: runs-on: ubuntu-latest @@ -16,17 +25,28 @@ jobs: - uses: actions/setup-java@v4 with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + distribution: ${{ vars.JAVA_DISTRIBUTION }} + java-version: ${{ vars.JAVA_VERSION }} + cache: gradle - name: Test run: ./gradlew build + release: + runs-on: ubuntu-latest + if: github.event_name == 'release' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: ${{ vars.JAVA_DISTRIBUTION }} + java-version: ${{ vars.JAVA_VERSION }} + cache: gradle + - name: Publish to Sonatype - if: github.event_name == 'release' env: ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }} ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }} @@ -41,4 +61,38 @@ jobs: with: tag_name: ${{ github.event.release.tag_name }} files: | - kapsule-core/build/libs/*.jar + kapsule-core/build/libs/kapsule-core-*.jar + + docs: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + if: github.event_name == 'release' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: ${{ vars.JAVA_DISTRIBUTION }} + java-version: ${{ vars.JAVA_VERSION }} + cache: gradle + + - name: Export docs + env: + ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }} + run: ./gradlew dokkaHtmlMultiModule + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3685cc7..9fb7a08 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -13,11 +13,9 @@ jobs: - uses: actions/setup-java@v4 with: - distribution: 'temurin' - java-version: '17' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + distribution: ${{ vars.JAVA_DISTRIBUTION }} + java-version: ${{ vars.JAVA_VERSION }} + cache: gradle - name: Test run: ./gradlew test diff --git a/build.gradle.kts b/build.gradle.kts index f09c2cf..e51d461 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.gradle.DokkaMultiModuleTask import org.jetbrains.dokka.gradle.DokkaTaskPartial