python-publish.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # This workflow will upload a Python Package using Twine when a release is created
  2. # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
  3. # This workflow uses actions that are not certified by GitHub.
  4. # They are provided by a third-party and are governed by
  5. # separate terms of service, privacy policy, and support
  6. # documentation.
  7. name: Upload Python Package
  8. on:
  9. push:
  10. # Publish semver tags as releases.
  11. tags: [ 'v*.*.*' ]
  12. permissions:
  13. contents: read
  14. jobs:
  15. deploy:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Set up Python
  20. uses: actions/setup-python@v3
  21. with:
  22. python-version: '3.x'
  23. - name: Install dependencies
  24. run: |
  25. python -m pip install --upgrade pip
  26. pip install build
  27. - name: Build package
  28. run: python -m build
  29. - name: Publish package
  30. uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29