File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,11 +59,28 @@ jobs:
5959 id-token : write
6060
6161 steps :
62+ - uses : actions/checkout@v4
6263 - name : Download all the dists
6364 uses : actions/download-artifact@v4
6465 with :
6566 name : python-package-distributions
6667 path : dist/
68+ - name : Install Python
69+ uses : actions/setup-python@v5
70+ with :
71+ python-version : " 3.x"
72+ - name : Update version with git hash
73+ run : |
74+ pip install wheel
75+ HASH=$(git rev-parse --short HEAD)
76+ for wheel in dist/*.whl; do
77+ NEW_WHEEL=$(echo $wheel | sed "s/-\([0-9.]*\)-/-\1.dev${HASH}-/")
78+ mv "$wheel" "$NEW_WHEEL"
79+ done
80+ for sdist in dist/*.tar.gz; do
81+ NEW_SDIST=$(echo $sdist | sed "s/-\([0-9.]*\)\./-\1.dev${HASH}./")
82+ mv "$sdist" "$NEW_SDIST"
83+ done
6784 - name : Publish distribution 📦 to TestPyPI
6885 uses : pypa/gh-action-pypi-publish@release/v1
6986 with :
You can’t perform that action at this time.
0 commit comments