stapi-pydantic release prep 0.0.3 (#105) #2
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*" | |
| jobs: | |
| package_name: | |
| name: Get package name | |
| runs-on: ubuntu-latest | |
| outputs: | |
| package_name: ${{ steps.split.outputs.package_name }} | |
| steps: | |
| - name: Get repo name | |
| # https://stackoverflow.com/questions/73402042/github-action-expressions-split-string | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| id: split | |
| run: echo "package_name=${TAG%%/*}" >> $GITHUB_OUTPUT | |
| release: | |
| name: Release ${{ needs.package_name.outputs.package_name }} | |
| runs-on: ubuntu-latest | |
| needs: package_name | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/${{ needs.package_name.outputs.package_name }} | |
| permissions: | |
| id-token: write | |
| if: ${{ github.repository }} == 'stapi-spec/pystapi' | |
| defaults: | |
| run: | |
| working-directory: ${{ needs.package_name.outputs.package_name }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - name: Create virtual environment | |
| run: uv venv | |
| - name: Install build | |
| run: uv pip install build | |
| - name: Build | |
| run: .venv/bin/python -m build | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: ${{ needs.package_name.outputs.package_name}}/dist |