From ecca904aef11446737412ddff26c60e01cbdc2f4 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:26:32 +0800 Subject: [PATCH 1/3] Add latest dir for javadoc --- .github/workflows/dispatch.javadoc.yml | 14 +++++++++++--- .github/workflows/generic.github_release.yml | 13 +++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dispatch.javadoc.yml b/.github/workflows/dispatch.javadoc.yml index 77789d0f..7711830e 100644 --- a/.github/workflows/dispatch.javadoc.yml +++ b/.github/workflows/dispatch.javadoc.yml @@ -28,12 +28,20 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_VERSION: ${{ inputs.target_tag }} - + + - name: Copy javadoc to version and latest folder + run: | + mkdir -p build/docs/javadoc-deploy/latest + mkdir -p build/docs/javadoc-deploy/${{ inputs.target_tag }} + cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest + cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ 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 + folder: build/docs/javadoc-deploy branch: javadoc - target-folder: javadoc/${{ inputs.target_tag }} + target-folder: javadoc + clean: false commit-message: Deploy javadoc for ${{ inputs.target_tag }} diff --git a/.github/workflows/generic.github_release.yml b/.github/workflows/generic.github_release.yml index d65943db..e901a8fc 100644 --- a/.github/workflows/generic.github_release.yml +++ b/.github/workflows/generic.github_release.yml @@ -100,12 +100,21 @@ jobs: GITHUB_VERSION: ${{ steps.release.outputs.publish_version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Copy javadoc to version and latest folder + if: steps.javadoc.outcome == 'success' + run: | + mkdir -p build/docs/javadoc-deploy/latest + mkdir -p build/docs/javadoc-deploy/${{ steps.release.outputs.tag_name }} + cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest + cp -r build/docs/javadoc/* build/docs/javadoc-deploy${{ steps.release.outputs.tag_name }} + - 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 + folder: build/docs/javadoc-deploy branch: javadoc - target-folder: javadoc/${{ steps.release.outputs.tag_name }} + target-folder: javadoc + clean: false commit-message: Deploy javadoc for ${{ steps.release.outputs.tag_name }} From 99a716ccaaf53b0e451fb65996b5b2d83e857b50 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:38:42 +0800 Subject: [PATCH 2/3] latest boolean --- .github/workflows/dispatch.javadoc.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dispatch.javadoc.yml b/.github/workflows/dispatch.javadoc.yml index 7711830e..891e8c11 100644 --- a/.github/workflows/dispatch.javadoc.yml +++ b/.github/workflows/dispatch.javadoc.yml @@ -6,6 +6,9 @@ on: target_tag: description: 'Version to generate javadoc' required: true + replace_latest: + description: 'Should this release replace the latest folder' + type: boolean jobs: javadocs: @@ -29,12 +32,16 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_VERSION: ${{ inputs.target_tag }} - - name: Copy javadoc to version and latest folder + - name: Copy javadoc to deploy folder + run: | + mkdir -p build/docs/javadoc-deploy/${{ inputs.target_tag }} + cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ inputs.target_tag }} + + - name: Copy javadoc to latest folder + if: inputs.replace_latest run: | mkdir -p build/docs/javadoc-deploy/latest - mkdir -p build/docs/javadoc-deploy/${{ inputs.target_tag }} cp -r build/docs/javadoc/* build/docs/javadoc-deploy/latest - cp -r build/docs/javadoc/* build/docs/javadoc-deploy/${{ inputs.target_tag }} - name: Deploy javadoc to gh pages uses: JamesIves/github-pages-deploy-action@v4 From 41cab5b290fd3677117d979c06a289f35dc1eabd Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:40:53 +0800 Subject: [PATCH 3/3] Improve replace_latest description --- .github/workflows/dispatch.javadoc.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dispatch.javadoc.yml b/.github/workflows/dispatch.javadoc.yml index 891e8c11..54637485 100644 --- a/.github/workflows/dispatch.javadoc.yml +++ b/.github/workflows/dispatch.javadoc.yml @@ -7,7 +7,7 @@ on: description: 'Version to generate javadoc' required: true replace_latest: - description: 'Should this release replace the latest folder' + description: 'Replace the latest folder' type: boolean jobs: