@@ -24,44 +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
61-
62- - name : Extract sdist for patching
6356 run : |
64- mkdir sdist && tar -xzf dist/*.tar.gz -C sdist --strip-components=1
57+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
6558
6659 - name : Compute dev version from git
6760 id : version
@@ -77,14 +70,33 @@ jobs:
7770 run : |
7871 sed -i "s/^version = .*/version = \"${{ steps.version.outputs.dev_version }}\"/" sdist/pyproject.toml
7972
73+ - name : Validate sdist
74+ run : |
75+ pipx run twine check dist/*.tar.gz
76+
8077 - name : Rebuild sdist with dev version
8178 run : |
82- cd sdist
8379 pipx run build --sdist
84- mv dist/*.tar.gz ../dist/
8580
86- - name : Validate rebuilt sdist
87- run : pipx run twine check dist/*.tar.gz
81+ - uses : actions/upload-artifact@v4
82+ with :
83+ name : test_pypi
84+ path : dist/*.tar.gz
85+ retention-days : 5
86+
87+ upload_test_pypi :
88+ needs : [build_test_sdist]
89+ runs-on : ubuntu-latest
90+ env :
91+ PYTHON_VERSION : " 3.10"
92+ environment : pypi
93+ permissions :
94+ id-token : write
95+ steps :
96+ - uses : actions/download-artifact@v4
97+ with :
98+ name : test_pypi
99+ path : dist
88100
89101 - name : Publish package to TestPyPI
90102
0 commit comments