File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change 55
66jobs :
77 pypi_release :
8- name : Builds Using Poetry and Publishes to PyPI
8+ name : Build with uv and publish to PyPI
99 runs-on : ubuntu-latest
1010 steps :
1111 - name : Checkout repository
@@ -16,14 +16,27 @@ jobs:
1616 with :
1717 python-version : " 3.13"
1818
19- - name : Install dependencies
19+ - name : Set up uv
20+ uses : astral-sh/setup-uv@v5
21+
22+ - name : Validate release tag matches package version
23+ shell : bash
2024 run : |
21- python -m pip install --upgrade pip
22- pip install poetry
23- poetry install
25+ set -euo pipefail
26+ TAG_VERSION="${GITHUB_REF_NAME#v}"
27+ PKG_VERSION="$(python -c 'import tomllib, pathlib; print(tomllib.loads(pathlib.Path("pyproject.toml").read_text("utf-8"))["project"]["version"])')"
28+ echo "Release tag: ${GITHUB_REF_NAME} (version=${TAG_VERSION})"
29+ echo "pyproject.toml version: ${PKG_VERSION}"
30+ test "${TAG_VERSION}" = "${PKG_VERSION}"
2431
25- - name : Add PyPI token
26- run : poetry config pypi-token.pypi "${{ secrets.PYPI_API_KEY }}"
32+ - name : Build sdist and wheel
33+ shell : bash
34+ run : |
35+ set -euo pipefail
36+ uv pip install --system --upgrade pip build
37+ python -m build
2738
2839 - name : Publish to PyPI
29- run : poetry publish --build
40+ uses : pypa/gh-action-pypi-publish@release/v1
41+ with :
42+ UV_PUBLISH_TOKEN : ${{ secrets.PYPI_API_KEY }}
You can’t perform that action at this time.
0 commit comments