Skip to content

Commit 335b8d5

Browse files
committed
Split sdist from wheel generation
1 parent 3f74756 commit 335b8d5

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

.github/workflows/python.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
- name: run pytests
8484
run: uv pip install pytest && uv run pytest
8585

86-
publication:
86+
publish_wheels:
8787
name: Build wheels and publish on ${{ matrix.os }}
8888
if: ${{ startsWith(github.ref, 'refs/tags') }}
8989
runs-on: ${{ matrix.os }}
@@ -97,19 +97,40 @@ jobs:
9797
with:
9898
version: "0.6.5"
9999

100-
- name: Build sdist
101-
run: uv build --sdist
102-
103100
- name: Build wheels
104101
uses: pypa/[email protected]
105102
env:
106-
CIBW_SKIP: "cp36-* cp37-* pp* *musllinux*"
103+
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *musllinux*"
104+
CIBW_BUILD_FRONTEND: "build[uv]"
105+
106+
- name: Publish distribution 📦 to Test PyPI
107+
if: ${{ github.ref != 'refs/tags/v2.2.7' }}
108+
run: "uv publish --publish-url https://test.pypi.org/legacy/ --token ${{ secrets.TEST_PYPI_TOKEN }} wheelhouse/*.whl"
109+
110+
- name: Publish distribution 📦 to PyPI
111+
if: ${{ github.ref == 'refs/tags/v2.2.7' }}
112+
run: "uv publish --token ${{ secrets.PYPI_TOKEN }} wheelhouse/*.whl"
113+
114+
publish_sdist:
115+
name: Build sdist and publish on ubuntu
116+
if: ${{ startsWith(github.ref, 'refs/tags') }}
117+
runs-on: ubuntu-latest
118+
permissions:
119+
id-token: write
120+
steps:
121+
- uses: actions/checkout@v4
122+
- name: Install uv
123+
uses: astral-sh/setup-uv@v5
124+
with:
125+
version: "0.6.5"
107126

127+
- name: Build sdist
128+
run: uv build --sdist
108129

109130
- name: Publish distribution 📦 to Test PyPI
110131
if: ${{ github.ref != 'refs/tags/v2.2.7' }}
111-
run: "uv publish --publish-url https://test.pypi.org/legacy/ --token ${{ secrets.TEST_PYPI_TOKEN }} sdist/*.tar.gz wheelhouse/*.whl"
132+
run: "uv publish --publish-url https://test.pypi.org/legacy/ dist/*.tar.gz"
112133

113134
- name: Publish distribution 📦 to PyPI
114135
if: ${{ github.ref == 'refs/tags/v2.2.7' }}
115-
run: "uv publish --token ${{ secrets.PYPI_TOKEN }} sdist/*.tar.gz wheelhouse/*.whl"
136+
run: "uv publish dist/*.tar.gz"

0 commit comments

Comments
 (0)