Skip to content

3.2.3

3.2.3 #31

# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#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 Compatible Python Package
on:
release:
types: [published]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install uv
run: pip install uv
- name: Create virtual environment
run: uv venv
- name: Install dependencies
run: |
uv pip install -r requirements.txt
- name: Prepare compatible version
run: |
sed -i \
-e 's/^name = "typed-ffmpeg"$/name = "typed-ffmpeg-compatible"/' \
-e 's|^write_to = "src/ffmpeg/_version.py"$|write_to = "src/typed_ffmpeg/_version.py"|' \
-e 's|^include = \["ffmpeg\*"\]|include = ["typed_ffmpeg*"]|' \
pyproject.toml
mv src/ffmpeg src/typed_ffmpeg
- name: Build package
run: |
uv run python -m build
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_name }}
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}