Skip to content

Merge release and docs actions #24

Merge release and docs actions

Merge release and docs actions #24

Workflow file for this run

name: master
on:
push:
branches:
- master
release:
types:
- created
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "master"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
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
env:
ORG_GRADLE_PROJECT_publishVersion: ${{ github.event.release.tag_name }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSPHRASE }}
run: ./gradlew clean publishAndReleaseToMavenCentral --no-configuration-cache
- name: Release assets
uses: softprops/action-gh-release@v2
if: github.event_name == 'release'
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
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