Repository navigation
v0.1.0 #1
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 PyPI release | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout release tag and history | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@v7.0.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v10.2.0 | |
| with: | |
| enable-cache: false | |
| - name: Build package | |
| run: uv build | |
| - name: Validate wheel import | |
| shell: bash | |
| run: | | |
| uv run --isolated --no-project --with ./dist/buscar-*.whl -- \ | |
| python -c "import buscar; print(buscar.__name__, buscar.__version__)" | |
| # Jobs run on separate runners, so pass the validated distributions to | |
| # the publish job as an artifact instead of rebuilding them there. | |
| - name: Upload package distributions | |
| uses: actions/upload-artifact@v7.0.1 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| pypi-publish: | |
| name: Upload release to PyPI | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: release | |
| url: https://pypi.org/project/buscar/ | |
| # PyPI verifies this workflow run through OpenID Connect. | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| # Retrieve the exact distributions built and validated by the build job. | |
| - name: Download package distributions | |
| uses: actions/download-artifact@v8.0.1 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.14.2 |