From 52b2170f8fa0fa8eeaf78224ef6fe354a0db5c21 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:22:30 +0800 Subject: [PATCH 1/2] Deploy javadoc to github pages on release --- .github/workflows/generic.github_release.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/generic.github_release.yml b/.github/workflows/generic.github_release.yml index 423c868c3..d65943db8 100644 --- a/.github/workflows/generic.github_release.yml +++ b/.github/workflows/generic.github_release.yml @@ -89,3 +89,23 @@ jobs: file: build/libs/${{ inputs.plugin_name }}-${{ steps.release.outputs.publish_version }}.jar asset_name: ${{ inputs.plugin_name }}-${{ steps.release.outputs.tag_name }}.jar 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 }} From c66b1a2b96e6e1b3cbb758589c30df9a438b28f0 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:25:13 +0800 Subject: [PATCH 2/2] Add manual dispatch action for javadoc --- .github/workflows/dispatch.javadoc.yml | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/dispatch.javadoc.yml diff --git a/.github/workflows/dispatch.javadoc.yml b/.github/workflows/dispatch.javadoc.yml new file mode 100644 index 000000000..77789d0f5 --- /dev/null +++ b/.github/workflows/dispatch.javadoc.yml @@ -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 }}