1111 - main
1212 paths :
1313 - .github/project.yml
14- workflow_dispatch :
15- inputs :
16- version :
17- description : The version to release (e.g. 1.0.0)
18- required : true
19- type : string
20- dryrun :
21- description : Perform a dry-run release
22- required : true
23- type : boolean
24- default : false
2514
2615concurrency :
2716 group : ${{ github.workflow }}-${{ github.ref }}
@@ -31,6 +20,8 @@ permissions:
3120 attestations : write
3221 id-token : write
3322 contents : write
23+ pages : write
24+ discussions : write
3425
3526defaults :
3627 run :
@@ -39,40 +30,28 @@ defaults:
3930jobs :
4031 release :
4132 runs-on : ubuntu-latest
42- if : (github.repository == 'docling-project/docling-java') && ((github.event_name == 'workflow_dispatch') || ((github.event_name == 'pull_request_target') && (github.event.pull_request.merged == true)))
33+ if : (github.repository == 'docling-project/docling-java') && ((github.event_name == 'pull_request_target') && (github.event.pull_request.merged == true))
34+ environment :
35+ name : github-pages
36+ url : ${{ steps.deployment.outputs.page_url }}
4337 steps :
4438 - uses : actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0
4539 id : app-token
4640 with :
4741 app-id : ${{ vars.DOCLING_JAVA_CI_APP_ID }}
4842 private-key : ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }}
4943
50- - name : Checkout before PR
51- if : github.event_name == 'pull_request_target'
44+ - name : Checkout before
5245 uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
5346 with :
5447 ref : ${{ github.event.pull_request.base.sha }}
5548 path : before
5649 token : ${{ steps.app-token.outputs.token }}
5750 fetch-depth : 0
5851
59- - name : Checkout current ref
60- if : github.event_name == 'workflow_dispatch'
61- uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
62- with :
63- ref : ${{ github.ref }}
64- path : before
65- token : ${{ steps.app-token.outputs.token }}
66- fetch-depth : 0
67-
6852 - name : Capture version before PR
69- if : github.event_name == 'pull_request_target'
7053 run : echo "PREVIOUS_VERSION=$(yq '.release.current-version' before/.github/project.yml)" >> $GITHUB_ENV
7154
72- - name : Set version to release
73- if : github.event_name == 'workflow_dispatch'
74- run : echo "PREVIOUS_VERSION=${{ inputs.version }}" >> $GITHUB_ENV
75-
7655 - name : Checkout current ref
7756 uses : actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
7857 with :
8362 - name : Capture current version
8463 run : echo "CURRENT_VERSION=$(yq '.release.current-version' after/.github/project.yml)" >> $GITHUB_ENV
8564
65+ - name : Setup Python
66+ uses : actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
67+ with :
68+ python-version : ' 3.x'
69+
8670 - name : Setup Java
8771 uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
8872 with :
@@ -111,12 +95,38 @@ jobs:
11195 echo "Releasing version ${{ env.PREVIOUS_VERSION }} -> ${{ env.CURRENT_VERSION }}"
11296 ./gradlew --no-daemon :jreleaserFullRelease
11397
98+ - name : Build current version docs
99+ working-directory : after
100+ run : ./gradlew --no-daemon :docs:build
101+
102+ - name : Build previous version docs
103+ working-directory : before
104+ run : ./gradlew --no-daemon :docs:build -Pdocs.alias=release -Pdocs.versionsFile=$(realpath ../after/build/mkdocs/versions.json)
105+
106+ - name : Merge docs together
107+ run : |
108+ mkdir -p docs
109+ cp -vRf after/docs/build/mkdocs docs/
110+ cp -vRf before/docs/build/mkdocs docs/
111+
112+ - name : Setup pages
113+ uses : actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
114+
115+ - name : Upload pages artifact
116+ uses : actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
117+ with :
118+ path : docs
119+
120+ - name : Deploy to GH Pages
121+ id : deployment
122+ uses : actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
123+
114124 # Persist logs
115125 - name : JReleaser release output
116126 if : always()
117127 uses : actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
118128 with :
119129 name : jreleaser-release
120130 path : |
121- build/jreleaser/trace.log
122- build/jreleaser/output.properties
131+ before/ build/jreleaser/trace.log
132+ before/ build/jreleaser/output.properties
0 commit comments