@@ -2,15 +2,21 @@ 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
15+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
16+ with :
17+ persist-credentials : false
1218 - name : Set up Python
13- uses : actions/setup-python@v6
19+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
1420 with :
1521 python-version : " 3.x"
1622 - name : Install pypa/build
2228 - name : Build a binary wheel and a source tarball
2329 run : python3 -m build
2430 - name : Store the distribution packages
25- uses : actions/upload-artifact@v7
31+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
2632 with :
2733 name : python-package-distributions
2834 path : dist/
@@ -41,12 +47,12 @@ jobs:
4147
4248 steps :
4349 - name : Download all the dists
44- uses : actions/download-artifact@v8
50+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
4551 with :
4652 name : python-package-distributions
4753 path : dist/
4854 - name : Publish distribution 📦 to PyPI
49- uses : pypa/gh-action-pypi-publish@release/v1
55+ uses : pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
5056
5157 github-release :
5258 name : >-
@@ -62,30 +68,32 @@ jobs:
6268
6369 steps :
6470 - name : Download all the dists
65- uses : actions/download-artifact@v8
71+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
6672 with :
6773 name : python-package-distributions
6874 path : dist/
6975 - name : Sign the dists with Sigstore
70- uses : sigstore/gh-action-sigstore-python@v3.2.0
76+ uses : sigstore/gh-action-sigstore-python@a5caf349bc536fbef3668a10ed7f5cd309a4b53d # v3.2.0
7177 with :
7278 inputs : >-
7379 ./dist/*.tar.gz
7480 ./dist/*.whl
7581 - name : Create GitHub Release
7682 env :
7783 GITHUB_TOKEN : ${{ github.token }}
84+ RELEASE_TAG : ${{ github.ref_name }}
85+ REPOSITORY : ${{ github.repository }}
7886 run : >-
7987 gh release create
80- '${{ github.ref_name }}'
81- --repo '${{ github.repository }}'
88+ "$RELEASE_TAG"
89+ --repo "$REPOSITORY"
8290 --notes ""
8391 - name : Upload artifact signatures to GitHub Release
8492 env :
8593 GITHUB_TOKEN : ${{ github.token }}
86- # Upload to GitHub Release using the `gh` CLI. `dist/` contains the built
87- # packages, and the sigstore-produced signatures and certificates.
94+ RELEASE_TAG : ${{ github.ref_name }}
95+ REPOSITORY : ${{ github.repository }}
8896 run : >-
8997 gh release upload
90- '${{ github.ref_name }}' dist/**
91- --repo '${{ github.repository }}'
98+ "$RELEASE_TAG" dist/**
99+ --repo "$REPOSITORY"
0 commit comments