Release v1.0.0 - Complete rewrite with CLI and TUI tools #4
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: Publish Python Package | |
| # This workflow is triggered by the release.yml workflow | |
| # No need for manual triggers, as release.yml handles everything | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Run when tag matches v*, e.g., v1.0.0, v2.3.4 | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/namecheap-python | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Set version from tag (if triggered by tag) | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| # Extract version from the tag | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| echo "Using version from tag: ${VERSION}" | |
| # Update version in pyproject.toml | |
| sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml | |
| - name: Build package | |
| run: uv build | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 |