distlink-python 0.2.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 to PyPI | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.14" | |
| - name: Verify release tag matches package version | |
| run: >- | |
| python -c "import os, pathlib, tomllib; | |
| version = tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version']; | |
| tag = os.environ['GITHUB_REF_NAME']; | |
| assert tag == f'v{version}', f'release tag {tag!r} does not match v{version}'" | |
| - name: Build distributions | |
| run: | | |
| python -m pip install --upgrade build twine | |
| python -m build | |
| python -m twine check --strict dist/* | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| if-no-files-found: error | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/distlink-python | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |