Skip to content

Commit f316e00

Browse files
committed
bugfix: fix publish-pypi.yml
1 parent d224064 commit f316e00

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
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 }}

0 commit comments

Comments
 (0)