@@ -2,9 +2,8 @@ name: Publish PyPI
22
33on :
44 push :
5- # Sequence of patterns matched against refs/tags
65 tags :
7- - ' v*' # Push events to matching v*, i.e. v1.0, v20.15.10
6+ - ' v*.*.* '
87
98permissions : write-all
109
@@ -14,26 +13,33 @@ jobs:
1413 runs-on : ubuntu-latest
1514
1615 steps :
17- - uses : actions/checkout@v4
16+ - uses : actions/checkout@v6
17+
1818 - name : Set up Python
19- uses : actions/setup-python@v5
19+ uses : actions/setup-python@v6
2020 with :
2121 python-version : " 3.x"
22+
2223 - name : Install pypa/build
2324 run : python3 -m pip install build --user
25+
2426 - name : get release version
2527 id : release-version
2628 run : |
2729 echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION=|; s|-|_|g' >> $GITHUB_OUTPUT
30+
2831 - name : edit version in pyproject.toml
2932 run : sed -i 's|^version = .*|version = "${{ steps.release-version.outputs.RELEASE_VERSION }}"|' pyproject.toml
33+
3034 - name : Build a binary wheel and a source tarball
3135 run : python3 -m build
36+
3237 - name : Store the distribution packages
33- uses : actions/upload-artifact@v3
38+ uses : actions/upload-artifact@v7
3439 with :
3540 name : python-package-distributions
3641 path : dist/
42+
3743 - name : Release
3844 uses : softprops/action-gh-release@v2
3945 with :
4248 files : ' dist/*'
4349 token : ${{ secrets.GITHUB_TOKEN }}
4450
51+
4552 publish-to-pypi :
4653 name : Publish Python distribution to PyPI
4754 needs :
@@ -57,10 +64,11 @@ jobs:
5764
5865 steps :
5966 - name : Download all the dists
60- uses : actions/download-artifact@v3
67+ uses : actions/download-artifact@v8
6168 with :
6269 name : python-package-distributions
6370 path : dist/
71+
6472 - name : Publish distribution to PyPI
6573 uses : pypa/gh-action-pypi-publish@release/v1
6674 with :
0 commit comments