fix: drain non-empty buffers on ExtractionWorker shutdown (#78) #35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish to PyPI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| permissions: | |
| id-token: write # required for trusted publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # needed for setuptools-scm to read tags | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Check if version already on PyPI | |
| id: version_check | |
| run: | | |
| WHEEL=$(ls dist/*.whl | head -1) | |
| VERSION=$(echo "$WHEEL" | sed 's/.*vektori-\(.*\)-py3.*/\1/') | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pypi.org/pypi/vektori/${VERSION}/json") | |
| if [ "$STATUS" = "200" ]; then | |
| echo "skip=true" >> "$GITHUB_OUTPUT" | |
| echo "Version ${VERSION} already on PyPI, skipping upload." | |
| else | |
| echo "skip=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish to PyPI | |
| if: steps.version_check.outputs.skip != 'true' | |
| uses: pypa/gh-action-pypi-publish@release/v1 |