Merge pull request #3123 from Multiverse/ben/javadoc

Javadoc with github action
This commit is contained in:
Ben Woo 2024-11-14 12:32:51 +08:00 committed by GitHub
commit a2a740f371
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 59 additions and 0 deletions

39
.github/workflows/dispatch.javadoc.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: 'Dispatch: Deploy Javadoc'
on:
workflow_dispatch:
inputs:
target_tag:
description: 'Version to generate javadoc'
required: true
jobs:
javadocs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ inputs.target_tag }}
- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: build javadoc
uses: gradle/gradle-build-action@v2
with:
arguments: javadoc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_VERSION: ${{ inputs.target_tag }}
- name: Deploy javadoc to gh pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/docs/javadoc
branch: javadoc
target-folder: javadoc/${{ inputs.target_tag }}
commit-message: Deploy javadoc for ${{ inputs.target_tag }}

View File

@ -89,3 +89,23 @@ jobs:
file: build/libs/${{ inputs.plugin_name }}-${{ steps.release.outputs.publish_version }}.jar file: build/libs/${{ inputs.plugin_name }}-${{ steps.release.outputs.publish_version }}.jar
asset_name: ${{ inputs.plugin_name }}-${{ steps.release.outputs.tag_name }}.jar asset_name: ${{ inputs.plugin_name }}-${{ steps.release.outputs.tag_name }}.jar
tag: ${{ steps.release.outputs.tag_name }} tag: ${{ steps.release.outputs.tag_name }}
- name: Generate javadoc
id: javadoc
if: steps.release.outputs.release_created == 'true' && steps.release.outputs.release_type == 'release'
uses: gradle/gradle-build-action@v2
with:
arguments: javadoc
env:
GITHUB_VERSION: ${{ steps.release.outputs.publish_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy javadoc to gh pages
if: steps.javadoc.outcome == 'success'
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
folder: build/docs/javadoc
branch: javadoc
target-folder: javadoc/${{ steps.release.outputs.tag_name }}
commit-message: Deploy javadoc for ${{ steps.release.outputs.tag_name }}