Skip to content

Bump tesseract version #73

Bump tesseract version

Bump tesseract version #73

name: "Bump tesseract version"
on:
schedule:
- cron: "0 0 * * MON"
workflow_dispatch:
jobs:
diff:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
id: tesseract
with:
result-encoding: string
script: |
const latest = (await github.rest.repos.getLatestRelease({
owner: 'tesseract-ocr',
repo: 'tesseract',
})).data.tag_name;
return latest;
- uses: actions/github-script@v6
id: leptonica
with:
result-encoding: string
script: |
const latest = (await github.rest.repos.getLatestRelease({
owner: 'DanBloomberg',
repo: 'leptonica',
})).data.tag_name;
return latest;
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: update-dockerfile
run: |
sed -i 's/\(TESSERACT_VERSION=\)[0-9\.]*$/\1${{ steps.tesseract.outputs.result }}/g' Dockerfile.al1
sed -i 's/\(TESSERACT_VERSION=\)[0-9\.]*$/\1${{ steps.tesseract.outputs.result }}/g' Dockerfile.al2
sed -i 's/\(LEPTONICA_VERSION=\)[0-9\.]*$/\1${{ steps.leptonica.outputs.result }}/g' Dockerfile.al1
sed -i 's/\(LEPTONICA_VERSION=\)[0-9\.]*$/\1${{ steps.leptonica.outputs.result }}/g' Dockerfile.al2
- name: update-README
run: |
sed -i 's/\(https:\/\/img\.shields\.io\/badge\/Tesseract-\)\(v\?\([0-9]\+\.\?\)\{3\}\)\(-green\)/\1${{ steps.tesseract.outputs.result }}\4/g' README.md
sed -i 's/\(https:\/\/img\.shields\.io\/badge\/Leptonica-\)\(v\?\([0-9]\+\.\?\)\{3\}\)\(-green\)/\1${{ steps.leptonica.outputs.result }}\4/g' README.md
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "chore: bump tesseract to ${{ steps.tesseract.outputs.result }} & leptonica to ${{ steps.leptonica.outputs.result }}"
title: "chore: bump tesseract to ${{ steps.tesseract.outputs.result }} & leptonica to ${{ steps.leptonica.outputs.result }}"