You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
845 B

  1. name: Publish
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. jobs:
  7. publish:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - uses: actions/checkout@v3
  11. - name: Set up Python 3.10
  12. uses: actions/setup-python@v3
  13. with:
  14. python-version: "3.10"
  15. - name: Install dependencies
  16. run: |
  17. python -m pip install --upgrade pip
  18. python -m pip install tox wheel twine
  19. - name: Apply the tag version
  20. run: |
  21. version=${{ github.ref_name }}
  22. sed -i 's/__version__ = .*/__version__ = "'${version:1}'"/' src/keycloak/_version.py
  23. - name: Run build
  24. run: |
  25. tox -e build
  26. - name: Publish to PyPi
  27. env:
  28. TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
  29. TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
  30. run: |
  31. twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*