@@ -44,24 +44,35 @@ jobs:
4444 name : Deploy on PyPI
4545 needs : testospython
4646 runs-on : ubuntu-latest
47+ environment : release
48+ permissions :
49+ id-token : write # IMPORTANT: mandatory for trusted publishing
4750 timeout-minutes : 10
4851 steps :
4952 - uses : actions/checkout@v4
5053 - name : Set up Python ${{ matrix.python-version }}
5154 uses : actions/setup-python@v5
5255 with :
53- python-version : 3.9
56+ python-version : 3.11
5457 - name : Install pypa/build
5558 run : |
5659 python -m pip install --upgrade pip
5760 python -m pip install --upgrade setuptools wheel
5861 python -m pip install build --user
5962 - name : Build a binary wheel and a source tarball
60- run : |
61- python -m build --sdist --wheel --outdir dist/
63+ run : python3 -m build
64+ - name : Store the distribution packages
65+ if : >
66+ github.event_name == 'push' &&
67+ startsWith(github.ref, 'refs/tags') &&
68+ github.actor == github.repository_owner
69+ uses : actions/upload-artifact@v4
70+ with :
71+ name : python-package-distributions
72+ path : dist/
6273 - name : Publish package on Pypi
63- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
74+ if : >
75+ github.event_name == 'push' &&
76+ startsWith(github.ref, 'refs/tags') &&
77+ github.actor == github.repository_owner
6478 uses : pypa/gh-action-pypi-publish@release/v1
65- with :
66- user : __token__
67- password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments