| 1 | name: Create release |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags: |
| 6 | - '*.*.*' |
| 7 | |
| 8 | jobs: |
| 9 | build: |
| 10 | runs-on: ubuntu-latest |
| 11 | |
| 12 | steps: |
| 13 | - name: Checkout |
| 14 | uses: actions/checkout@v4 |
| 15 | |
| 16 | - name: Extract release notes |
| 17 | id: extract-release-notes |
| 18 | uses: ffurrer2/extract-release-notes@v1 |
| 19 | |
| 20 | - name: Create release |
| 21 | uses: ncipollo/release-action@v1 |
| 22 | with: |
| 23 | body: ${{ steps.extract-release-notes.outputs.release_notes }} |
| 24 | token: ${{ secrets.WORKFLOWS_CREATE_RELEASE_TOKEN }} |
| 25 | |
| 26 | - name: Set up Python |
| 27 | uses: actions/setup-python@v4 |
| 28 | with: |
| 29 | python-version: '3.x' |
| 30 | cache: 'pip' |
| 31 | |
| 32 | - name: Build Package |
| 33 | run: | |
| 34 | pip install pip --upgrade |
| 35 | pip install build |
| 36 | python -m build |
| 37 | |
| 38 | - name: Publish on PyPI |
| 39 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 40 | with: |
| 41 | packages_dir: dist/ |
| 42 | password: ${{ secrets.WORKFLOWS_PUBLISH_TO_PYPI_TOKEN }} |