Skip to content

Release Python Package to PyPi #35

Release Python Package to PyPi

Release Python Package to PyPi #35

Workflow file for this run

# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Release Python Package to PyPi
on: [ workflow_dispatch ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install -r requirements/packaging.txt
- name: Build
run: |
python -m build
- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- name: Tag
run: |
git config user.name github-actions
git config user.email [email protected]
VERSION="$(cat drf_spectacular/__init__.py | grep "__version__" | cut -d"'" -f2)"
git tag -a $VERSION -m 'version $VERSION'
git push --tags