v1.6.0 #25
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: Build and publish to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| jobs: | |
| build-and-publish: | |
| name: Build and publish Python distributions to PyPI | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.release.tag_name }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build twine | |
| - name: Build wheel and source distribution | |
| run: python -m build | |
| - name: Check distribution | |
| run: | | |
| ls -la dist/ | |
| python -m twine check dist/* | |
| - name: Test installation | |
| run: | | |
| python -m pip install dist/*.whl | |
| python -c "import site_analysis; print(f'✅ site-analysis {site_analysis.__version__} imported successfully')" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |