Skip to content

Commit 4c6c5f3

Browse files
authored
Fix publishing round 2 (#467)
1 parent a61d68e commit 4c6c5f3

File tree

3 files changed

+30
-20
lines changed

3 files changed

+30
-20
lines changed

.github/workflows/pypi.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ on:
77
jobs:
88
deploy:
99
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
1013
steps:
11-
- uses: actions/checkout@v4
1214
- name: Set up Python and uv
1315
uses: astral-sh/setup-uv@v4
1416
with:
1517
python-version: "3.13"
1618
- name: Build and publish
17-
env:
18-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
19-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2019
run: |
2120
uv venv
2221
uv build
22+
- name: Publish package distributions to PyPI
23+
run: |
2324
uv publish

.github/workflows/testpypi-release.yaml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,10 @@ jobs:
2626
with:
2727
python-version: "3.13"
2828

29-
# - name: Disable local versions
30-
# run: |
31-
# python .github/workflows/configure-testpypi-version.py pyproject.toml
32-
# git update-index --assume-unchanged pyproject.toml
33-
# cat pyproject.toml
34-
3529
- name: Build tarball and wheels
3630
run: |
3731
git clean -xdf
38-
uv build
32+
SETUPTOOLS_SCM_OVERRIDES_FOR_FLOX='local_scheme = "no-local-version"' uv build
3933
4034
- name: Check built artifacts
4135
run: |
@@ -57,14 +51,26 @@ jobs:
5751
test-built-dist:
5852
needs: build-artifacts
5953
runs-on: ubuntu-latest
54+
permissions:
55+
# IMPORTANT: this permission is mandatory for Trusted Publishing
56+
id-token: write
6057
steps:
61-
- uses: actions/setup-python@v5
62-
name: Install Python
58+
# need pyproject.toml for uv publish --index testpypi
59+
- uses: actions/checkout@v5
60+
with:
61+
fetch-depth: 0 # Fetch all history for all branches and tags.
62+
63+
- name: Set up Python and uv
64+
uses: astral-sh/setup-uv@v4
65+
with:
66+
python-version: "3.13"
6367

64-
- uses: actions/download-artifact@v4
68+
- name: Get built artifact
69+
uses: actions/download-artifact@v4
6570
with:
6671
name: releases
6772
path: dist
73+
6874
- name: List contents of built dist
6975
run: |
7076
ls -ltrh
@@ -74,9 +80,6 @@ jobs:
7480
run: |
7581
pip install dist/flox*.whl
7682
77-
# - name: Publish package to TestPyPI
78-
# uses: pypa/[email protected]
79-
# with:
80-
# password: ${{ secrets.TESTPYPI_TOKEN }}
81-
# repository_url: https://test.pypi.org/legacy/
82-
# verbose: true
83+
- name: Publish package to TestPyPI
84+
run: |
85+
uv publish --index testpypi

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,9 @@ types = [
313313
"types-requests",
314314
"types-setuptools",
315315
]
316+
317+
[[tool.uv.index]]
318+
name = "testpypi"
319+
url = "https://test.pypi.org/simple/"
320+
publish-url = "https://test.pypi.org/legacy/"
321+
explicit = true

0 commit comments

Comments
 (0)