2121jobs :
2222 build-pypi-distribs :
2323 name : Build and publish library to PyPI
24- runs-on : ubuntu-22 .04
24+ runs-on : ubuntu-24 .04
2525
2626 steps :
2727 - uses : actions/checkout@v4
2828 - name : Set up Python
29- uses : actions/setup-python@v4
29+ uses : actions/setup-python@v5
3030 with :
3131 python-version : 3.14
3232
33- - name : Install pypa/build
34- run : python -m pip install build --user
33+ - name : Install pypa/build and twine
34+ run : python -m pip install --user --upgrade build twine pkginfo
3535
3636 - name : Build a binary wheel and a source tarball
37- run : python -m build --sdist --wheel --outdir dist/
37+ run : python -m build --wheel --sdist --outdir dist/
38+
39+ - name : Validate wheel and sdis for Pypi
40+ run : python -m twine check dist/*
3841
3942 - name : Upload built archives
40- uses : actions/upload-artifact@v3
43+ uses : actions/upload-artifact@v4
4144 with :
4245 name : pypi_archives
4346 path : dist/*
@@ -47,17 +50,17 @@ jobs:
4750 name : Create GH release
4851 needs :
4952 - build-pypi-distribs
50- runs-on : ubuntu-22 .04
53+ runs-on : ubuntu-24 .04
5154
5255 steps :
5356 - name : Download built archives
54- uses : actions/download-artifact@v3
57+ uses : actions/download-artifact@v4
5558 with :
5659 name : pypi_archives
5760 path : dist
5861
5962 - name : Create GH release
60- uses : softprops/action-gh-release@v1
63+ uses : softprops/action-gh-release@v2
6164 with :
6265 draft : true
6366 files : dist/*
@@ -67,17 +70,18 @@ jobs:
6770 name : Create PyPI release
6871 needs :
6972 - create-gh-release
70- runs-on : ubuntu-22.04
73+ runs-on : ubuntu-24.04
74+ environment : pypi-publish
75+ permissions :
76+ id-token : write
7177
7278 steps :
7379 - name : Download built archives
74- uses : actions/download-artifact@v3
80+ uses : actions/download-artifact@v4
7581 with :
7682 name : pypi_archives
7783 path : dist
7884
7985 - name : Publish to PyPI
8086 if : startsWith(github.ref, 'refs/tags')
8187 uses : pypa/gh-action-pypi-publish@release/v1
82- with :
83- password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments