Skip to content

Commit

Permalink
Merge release and docs actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Sep 15, 2024
1 parent 7956773 commit d882cb7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 63 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/docs.yml

This file was deleted.

68 changes: 61 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -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
8 changes: 3 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial

Expand Down

0 comments on commit d882cb7

Please sign in to comment.