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.

44 lines
1.2 KiB

2 years ago
2 years ago
12 months ago
2 years ago
12 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  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. with:
  12. fetch-depth: "0"
  13. - name: Set up Python 3.12
  14. uses: actions/setup-python@v3
  15. with:
  16. python-version: "3.12"
  17. - name: Install dependencies
  18. run: |
  19. python -m pip install --upgrade pip
  20. python -m pip install poetry
  21. poetry install
  22. - name: Apply the tag version
  23. run: |
  24. version=${{ github.ref_name }}
  25. sed -Ei '/^version = /s|= "[0-9.]+"$|= "'${version:-1}'"|' pyproject.toml
  26. - name: Run build
  27. run: |
  28. poetry run tox -e build
  29. - name: Publish to PyPi
  30. env:
  31. TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
  32. TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
  33. run: |
  34. poetry run twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
  35. - name: Run changelog
  36. run: |
  37. poetry run tox -e changelog
  38. - uses: stefanzweifel/git-auto-commit-action@v4
  39. with:
  40. commit_message: "docs: changelog update"
  41. branch: master
  42. file_pattern: CHANGELOG.md