@@ -44,24 +44,35 @@ jobs:
44
44
name : Deploy on PyPI
45
45
needs : testospython
46
46
runs-on : ubuntu-latest
47
+ environment : release
48
+ permissions :
49
+ id-token : write # IMPORTANT: mandatory for trusted publishing
47
50
timeout-minutes : 10
48
51
steps :
49
52
- uses : actions/checkout@v4
50
53
- name : Set up Python ${{ matrix.python-version }}
51
54
uses : actions/setup-python@v5
52
55
with :
53
- python-version : 3.9
56
+ python-version : 3.11
54
57
- name : Install pypa/build
55
58
run : |
56
59
python -m pip install --upgrade pip
57
60
python -m pip install --upgrade setuptools wheel
58
61
python -m pip install build --user
59
62
- 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/
62
73
- 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
64
78
uses : pypa/gh-action-pypi-publish@release/v1
65
- with :
66
- user : __token__
67
- password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments