Merge pull request #719 from staticdev/ci/fix-trigger-for-release #586
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set Tag env | |
| run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Upgrade pip | |
| run: | | |
| pip install --constraint=.github/workflows/constraints.txt pip | |
| pip --version | |
| - name: Install Hatch | |
| run: | | |
| pip install --constraint=.github/workflows/hatch-constraints.txt hatch | |
| hatch --version | |
| - name: Install UV | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Build package | |
| run: | | |
| uv build | |
| - name: Publish package on PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_TOKEN }} | |
| - name: Publish the release notes | |
| uses: release-drafter/release-drafter@v6 | |
| with: | |
| tag: ${{ env.RELEASE_VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |