-
Notifications
You must be signed in to change notification settings - Fork 35
49 lines (47 loc) · 2.05 KB
/
update-tesseract.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}"