@@ -2,27 +2,28 @@ name: Publish Python 🐍 distribution 📦 to PyPI
22
33on : push
44
5+ permissions : {}
6+
57jobs :
68 build :
79 name : Build distribution 📦
810 runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
913
1014 steps :
11- - uses : actions/checkout@v6
12- - name : Set up Python
13- uses : actions/setup-python@v6
15+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
1416 with :
15- python-version : " 3.x"
16- - name : Install pypa/build
17- run : >-
18- python3 -m
19- pip install
20- build
21- --user
17+ persist-credentials : false
18+ - name : Install uv
19+ uses : astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
20+ with :
21+ enable-cache : true
22+ python-version : " 3.13"
2223 - name : Build a binary wheel and a source tarball
23- run : python3 -m build
24+ run : uv build
2425 - name : Store the distribution packages
25- uses : actions/upload-artifact@v7
26+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
2627 with :
2728 name : python-package-distributions
2829 path : dist/
@@ -41,12 +42,14 @@ jobs:
4142
4243 steps :
4344 - name : Download all the dists
44- uses : actions/download-artifact@v8
45+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
4546 with :
4647 name : python-package-distributions
4748 path : dist/
49+ - name : Install uv
50+ uses : astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
4851 - name : Publish distribution 📦 to PyPI
49- uses : pypa/gh-action-pypi- publish@release/v1
52+ run : uv publish
5053
5154 github-release :
5255 name : >-
@@ -62,30 +65,34 @@ jobs:
6265
6366 steps :
6467 - name : Download all the dists
65- uses : actions/download-artifact@v8
68+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
6669 with :
6770 name : python-package-distributions
6871 path : dist/
6972 - name : Sign the dists with Sigstore
70- uses : sigstore/gh-action-sigstore-python@v3.2.0
73+ uses : sigstore/gh-action-sigstore-python@a5caf349bc536fbef3668a10ed7f5cd309a4b53d # v3.2.0
7174 with :
7275 inputs : >-
7376 ./dist/*.tar.gz
7477 ./dist/*.whl
7578 - name : Create GitHub Release
7679 env :
7780 GITHUB_TOKEN : ${{ github.token }}
81+ RELEASE_TAG : ${{ github.ref_name }}
82+ REPOSITORY : ${{ github.repository }}
7883 run : >-
7984 gh release create
80- '${{ github.ref_name }}'
81- --repo '${{ github.repository }}'
85+ "$RELEASE_TAG"
86+ --repo "$REPOSITORY"
8287 --notes ""
8388 - name : Upload artifact signatures to GitHub Release
8489 env :
8590 GITHUB_TOKEN : ${{ github.token }}
91+ RELEASE_TAG : ${{ github.ref_name }}
92+ REPOSITORY : ${{ github.repository }}
8693 # Upload to GitHub Release using the `gh` CLI. `dist/` contains the built
8794 # packages, and the sigstore-produced signatures and certificates.
8895 run : >-
8996 gh release upload
90- '${{ github.ref_name }}' dist/**
91- --repo '${{ github.repository }}'
97+ "$RELEASE_TAG" dist/**
98+ --repo "$REPOSITORY"
0 commit comments