pypi.yml 707 B

123456789101112131415161718192021222324252627282930
  1. name: Build and publish package to PyPI
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [ created ]
  6. jobs:
  7. build_and_publish:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout repository.
  11. uses: actions/checkout@v4
  12. - name: Setup Python.
  13. uses: actions/setup-python@v4
  14. with:
  15. python-version: 3.8
  16. - name: Publish a Python distribution to PyPI.
  17. if: github.ref == 'refs/heads/main' && github.repository == 'MarshalX/yandex-music-api'
  18. env:
  19. TWINE_USERNAME: __token__
  20. TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
  21. run: |
  22. pip install twine
  23. python setup.py sdist
  24. twine upload dist/*