chore: Release 0.1.5 #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Perform release | |
| env: | |
| JAVA_VERSION: 17 | |
| on: | |
| pull_request_target: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| paths: | |
| - .github/project.yml | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| attestations: write | |
| id-token: write | |
| contents: write | |
| pages: write | |
| discussions: write | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| if: (github.repository == 'docling-project/docling-java') && ((github.event_name == 'pull_request_target') && (github.event.pull_request.merged == true)) | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0 | |
| id: app-token | |
| with: | |
| app-id: ${{ vars.DOCLING_JAVA_CI_APP_ID }} | |
| private-key: ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }} | |
| - name: Checkout before | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| ref: ${{ github.event.pull_request.base.sha }} | |
| path: before | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Capture version before PR | |
| run: echo "PREVIOUS_VERSION=$(yq '.release.current-version' before/.github/project.yml)" >> $GITHUB_ENV | |
| - name: Checkout current ref | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| path: after | |
| fetch-depth: 0 | |
| - name: Capture current version | |
| run: echo "CURRENT_VERSION=$(yq '.release.current-version' after/.github/project.yml)" >> $GITHUB_ENV | |
| - name: Setup Python | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: '3.x' | |
| - name: Setup Java | |
| uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
| with: | |
| java-version: ${{ env.JAVA_VERSION }} | |
| distribution: temurin | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 | |
| - name: Build artifacts | |
| working-directory: before | |
| run: ./gradlew --no-daemon -Pjava.version=${{ env.JAVA_VERSION }} publish | |
| - name: Release | |
| working-directory: before | |
| env: | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} | |
| JRELEASER_GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | |
| JRELEASER_DISCORD_WEBHOOK: ${{ secrets.RELEASES_DISCORD_WEBHOOK }} | |
| JRELEASER_DRY_RUN: ${{ inputs.dryrun }} | |
| run: | | |
| echo "Releasing version ${{ env.PREVIOUS_VERSION }} -> ${{ env.CURRENT_VERSION }}" | |
| ./gradlew --no-daemon :jreleaserFullRelease | |
| - name: Build current version docs | |
| working-directory: after | |
| run: ./gradlew --no-daemon :docs:build | |
| - name: Build previous version docs | |
| working-directory: before | |
| run: ./gradlew --no-daemon :docs:build -Pdocs.alias=release -Pdocs.versionsFile=$(realpath ../after/build/mkdocs/versions.json) | |
| - name: Merge docs together | |
| run: | | |
| mkdir -p docs | |
| cp -vRf after/docs/build/mkdocs docs/ | |
| cp -vRf before/docs/build/mkdocs docs/ | |
| - name: Setup pages | |
| uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
| - name: Upload pages artifact | |
| uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 | |
| with: | |
| path: docs | |
| - name: Deploy to GH Pages | |
| id: deployment | |
| uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | |
| # Persist logs | |
| - name: JReleaser release output | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 | |
| with: | |
| name: jreleaser-release | |
| path: | | |
| before/build/jreleaser/trace.log | |
| before/build/jreleaser/output.properties |