Skip to content

Commit 93b0b25

Browse files
committed
Improve model release workflow
1 parent 4474284 commit 93b0b25

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

‎.github/workflows/release-ocr-models.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@
1616
name: Release OCR Models
1717

1818
on:
19+
push:
20+
tags:
21+
- 'recognition-models-*'
1922
workflow_dispatch:
23+
inputs:
24+
tag_name:
25+
description: 'Release tag to attach assets to (e.g. recognition-models-1.0.0)'
26+
required: true
27+
default: 'recognition-models-1.0.0'
2028

2129
jobs:
2230
build:
@@ -26,6 +34,18 @@ jobs:
2634
steps:
2735
- uses: actions/checkout@v4
2836

37+
- name: Resolve tag name
38+
id: tag
39+
run: |
40+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
41+
tag="${{ github.ref_name }}"
42+
else
43+
tag="${{ inputs.tag_name }}"
44+
fi
45+
version="${tag#recognition-models-}"
46+
echo "name=$tag" >> $GITHUB_OUTPUT
47+
echo "version=$version" >> $GITHUB_OUTPUT
48+
2949
- name: Set up Python
3050
uses: actions/setup-python@v5
3151
with:
@@ -47,10 +67,16 @@ jobs:
4767
mkdir -p dist
4868
find output/rec -maxdepth 1 -name "*.zip" -exec cp {} dist/ \;
4969
50-
- name: Replace release assets
70+
- name: Publish release assets
5171
uses: softprops/action-gh-release@v2
5272
with:
5373
files: dist/*
54-
tag_name: 'recognition-models-1.0.0'
74+
tag_name: ${{ steps.tag.outputs.name }}
75+
name: "Text Recognition Models ${{ steps.tag.outputs.version }}"
76+
body: |
77+
Additional text recognition models used by Klick'r 4.0.0 and above.
78+
Github/FDroid versions of the app will download the attached packages.
79+
make_latest: false
80+
prerelease: false
5581
env:
5682
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)