Skip to content

Commit ef4df90

Browse files
committed
build: cleanup python test pypi upload
The previous commit was faulty and contained a development version for the 'upload unique test pypi verison'. Fixes: 74d7217 ("build: upload unique pypi test versions") Signed-off-by: Daniel Wagner <[email protected]>
1 parent 0abb932 commit ef4df90

1 file changed

Lines changed: 37 additions & 23 deletions

File tree

.github/workflows/release-python.yml

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,38 @@ jobs:
2424
- uses: actions/checkout@v4
2525

2626
- name: Allow workspace
27-
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
27+
run: |
28+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
2829
2930
- name: Build sdist
30-
run: pipx run build --sdist
31+
run: |
32+
pipx run build --sdist
3133
3234
- name: Validate sdist
33-
run: pipx run twine check dist/*.tar.gz
35+
run: |
36+
pipx run twine check dist/*.tar.gz
3437
3538
- uses: actions/upload-artifact@v4
3639
with:
3740
path: dist/*.tar.gz
3841
retention-days: 5
3942

40-
upload_test_pypi:
41-
needs: [build_sdist]
43+
build_test_sdist:
44+
name: Build test source distribution
4245
runs-on: ubuntu-latest
4346
env:
4447
PYTHON_VERSION: "3.10"
45-
environment: pypi
46-
permissions:
47-
id-token: write
48+
container:
49+
image: ghcr.io/linux-nvme/debian.python:latest
4850
steps:
4951
- name: Check out repository (with tags)
5052
uses: actions/checkout@v4
5153
with:
5254
fetch-depth: 0 # Required for `git describe`
5355

5456
- name: Allow workspace
55-
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
56-
57-
- uses: actions/download-artifact@v4
58-
with:
59-
name: artifact
60-
path: dist
61-
62-
- name: Extract sdist for patching
6357
run: |
64-
mkdir sdist && tar -xzf dist/*.tar.gz -C sdist --strip-components=1
58+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
6559
6660
- name: Compute dev version from git
6761
id: version
@@ -75,16 +69,36 @@ jobs:
7569
7670
- name: Patch version in pyproject.toml
7771
run: |
78-
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.dev_version }}\"/" sdist/pyproject.toml
72+
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.dev_version }}\"/" pyproject.toml
7973
80-
- name: Rebuild sdist with dev version
74+
- name: Build sdist
8175
run: |
82-
cd sdist
8376
pipx run build --sdist
84-
mv dist/*.tar.gz ../dist/
8577
86-
- name: Validate rebuilt sdist
87-
run: pipx run twine check dist/*.tar.gz
78+
- name: Validate sdist
79+
run: |
80+
pipx run twine check dist/*.tar.gz
81+
82+
- uses: actions/upload-artifact@v4
83+
with:
84+
name: test_pypi
85+
path: dist/*.tar.gz
86+
retention-days: 5
87+
88+
upload_test_pypi:
89+
needs: [build_test_sdist]
90+
runs-on: ubuntu-latest
91+
env:
92+
PYTHON_VERSION: "3.10"
93+
environment: pypi
94+
permissions:
95+
id-token: write
96+
if: github.repository == 'linux-nvme/libnvme'
97+
steps:
98+
- uses: actions/download-artifact@v4
99+
with:
100+
name: test_pypi
101+
path: dist
88102

89103
- name: Publish package to TestPyPI
90104
uses: pypa/[email protected]

0 commit comments

Comments
 (0)