Skip to content

Commit f975628

Browse files
committed
merge
1 parent 4602a68 commit f975628

1 file changed

Lines changed: 34 additions & 18 deletions

File tree

.github/workflows/release-python.yml

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,37 @@ 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:
4244
runs-on: ubuntu-latest
4345
env:
4446
PYTHON_VERSION: "3.10"
45-
environment: pypi
46-
permissions:
47-
id-token: write
47+
container:
48+
image: ghcr.io/linux-nvme/debian.python:latest
4849
steps:
4950
- name: Check out repository (with tags)
5051
uses: actions/checkout@v4
5152
with:
5253
fetch-depth: 0 # Required for `git describe`
5354

5455
- 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
56+
run: |
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
6158
6259
- name: Extract sdist for patching
6360
run: |
@@ -77,14 +74,33 @@ jobs:
7774
run: |
7875
sed -i "s/^version = .*/version = \"${{ steps.version.outputs.dev_version }}\"/" sdist/pyproject.toml
7976
77+
- name: Validate sdist
78+
run: |
79+
pipx run twine check dist/*.tar.gz
80+
8081
- name: Rebuild sdist with dev version
8182
run: |
82-
cd sdist
8383
pipx run build --sdist
84-
mv dist/*.tar.gz ../dist/
8584
86-
- name: Validate rebuilt sdist
87-
run: pipx run twine check dist/*.tar.gz
85+
- uses: actions/upload-artifact@v4
86+
with:
87+
name: test_pypi
88+
path: dist/*.tar.gz
89+
retention-days: 5
90+
91+
upload_test_pypi:
92+
needs: [build_test_sdist]
93+
runs-on: ubuntu-latest
94+
env:
95+
PYTHON_VERSION: "3.10"
96+
environment: pypi
97+
permissions:
98+
id-token: write
99+
steps:
100+
- uses: actions/download-artifact@v4
101+
with:
102+
name: test_pypi
103+
path: dist
88104

89105
- name: Publish package to TestPyPI
90106
uses: pypa/[email protected]

0 commit comments

Comments
 (0)