Skip to content

chore: release 0.4.4 #32

chore: release 0.4.4

chore: release 0.4.4 #32

Workflow file for this run

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
discussions: write
issues: write
pull-requests: write
defaults:
run:
shell: bash
jobs:
release:
runs-on: ubuntu-latest
# Verifies that the PR was merged into main, that the PR only runs in the docling-java repo (not a fork), and that the PR branch is NOT from a fork.
if: (github.event.pull_request.merged == true) && (github.repository == 'docling-project/docling-java') && (github.event.pull_request.head.repo.full_name == 'docling-project/docling-java')
steps:
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
id: app-token
with:
app-id: ${{ vars.DOCLING_JAVA_CI_APP_ID }}
private-key: ${{ secrets.DOCLING_JAVA_CI_PRIVATE_KEY }}
permission-pull-requests: write
permission-contents: write
permission-issues: write
- name: Checkout before
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.pull_request.base.sha }}
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- name: Verify only project.yml was changed
id: verify-files
run: |
FILES_CHANGED=$(curl -s -H "Authorization: token ${{ steps.app-token.outputs.token }}" \
"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" | \
jq -r '.[].filename')
if [ "$(echo "$FILES_CHANGED" | wc -l)" -ne 1 ] || [ "$FILES_CHANGED" != ".github/project.yml" ]; then
echo "Warning: Expected only .github/project.yml to be changed, but found:"
echo "$FILES_CHANGED"
echo "Skipping release process."
echo "should_release=false" >> $GITHUB_OUTPUT
else
echo "✓ Verified that only .github/project.yml was changed"
echo "should_release=true" >> $GITHUB_OUTPUT
fi
- name: Capture previous release version
if: steps.verify-files.outputs.should_release == 'true'
run: echo "PREVIOUS_VERSION=$(yq '.release.previous-version' .github/project.yml)" >> $GITHUB_ENV
- name: Capture current version
if: steps.verify-files.outputs.should_release == 'true'
run: echo "CURRENT_VERSION=$(yq '.release.current-version' .github/project.yml)" >> $GITHUB_ENV
- name: Setup Java
if: steps.verify-files.outputs.should_release == 'true'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: temurin
- name: Setup Gradle
if: steps.verify-files.outputs.should_release == 'true'
uses: gradle/actions/setup-gradle@f29f5a9d7b09a7c6b29859002d29d24e1674c884 # v5.0.1
- name: Build artifacts
if: steps.verify-files.outputs.should_release == 'true'
run: ./gradlew --no-daemon -Pjava.version=${{ env.JAVA_VERSION }} publish
- name: Release
if: steps.verify-files.outputs.should_release == 'true'
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 }}
JRELEASER_TAG_NAME: "v${{ env.CURRENT_VERSION }}"
JRELEASER_PREVIOUS_TAG_NAME: "v${{ env.PREVIOUS_VERSION }}"
run: |
echo "Releasing version ${{ env.PREVIOUS_VERSION }} -> ${{ env.CURRENT_VERSION }}"
./gradlew --no-daemon -Dorg.gradle.configuration-cache=false :jreleaserFullRelease
# Persist logs
- name: JReleaser release output
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: jreleaser-release
path: |
build/jreleaser/trace.log
build/jreleaser/output.properties