Added slug filter to factory so it can be used in CLI. #15
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" | |
| on: | |
| push: | |
| tags: | |
| # Publish on any tag starting with a `v`, e.g., v0.1.0 | |
| - v* | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Install just | |
| uses: extractions/setup-just@v3 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: just sync | |
| - name: Build release artifacts | |
| run: just build-release | |
| - name: Smoke built artifacts | |
| run: just smoke-release | |
| - name: Select publishable files | |
| id: select | |
| shell: bash | |
| run: | | |
| just select-release-files > publish-files.txt | |
| if [[ -s publish-files.txt ]]; then | |
| echo "has_files=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "has_files=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Publish | |
| if: steps.select.outputs.has_files == 'true' | |
| shell: bash | |
| run: | | |
| mapfile -t files < publish-files.txt | |
| uv publish --trusted-publishing always "${files[@]}" | |
| - name: No new package versions to publish | |
| if: steps.select.outputs.has_files != 'true' | |
| run: echo "All built package versions are already present on PyPI." |