Skip to content

fix: Upgrade tesserocr to fix whl install issue & Werkzeug for fastapi compatibility #105

fix: Upgrade tesserocr to fix whl install issue & Werkzeug for fastapi compatibility

fix: Upgrade tesserocr to fix whl install issue & Werkzeug for fastapi compatibility #105

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Run unit tests
run: |
cd src/
python -m unittest
tags:
runs-on: ubuntu-latest
needs: unit_tests
outputs:
new_version: ${{ steps.tag.outputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
if: github.ref != 'refs/heads/main'
with:
release_branches: main
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
- name: Add tag to output step
id: tag
run: |
if [ ${{ github.ref }} == 'refs/heads/main' ]; then
echo "new_version=${{ steps.tag_version.outputs.new_version }}" >> $GITHUB_OUTPUT
else
echo "new_version=${{ steps.tag_version.outputs.new_version }}-${{ github.sha }}-dev" >> $GITHUB_OUTPUT
fi
deploy:
runs-on: ubuntu-latest
needs: tags
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
echo "VERSION = '${{ needs.tags.outputs.new_version }}'" >| version.py
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}