@@ -21,25 +21,45 @@ jobs:
21
21
deploy :
22
22
name : Deploy on PyPI
23
23
needs : lint
24
+ if : >
25
+ github.event_name == 'push' &&
26
+ startsWith(github.ref, 'refs/tags') &&
27
+ github.base_ref == 'main' &&
28
+ github.actor == github.repository_owner
24
29
runs-on : ubuntu-latest
25
- environment : release
26
- permissions :
27
- id-token : write
28
30
timeout-minutes : 10
31
+ environment :
32
+ name : pypi
33
+ url : https://pypi.org/p/lymbo
34
+ permissions :
35
+ id-token : write # IMPORTANT: mandatory for trusted publishing
29
36
steps :
30
37
- uses : actions/checkout@v4
31
38
- name : Set up Python ${{ matrix.python-version }}
32
39
uses : actions/setup-python@v5
33
40
with :
34
- python-version : 3.9
41
+ python-version : 3.11
35
42
- name : Install pypa/build
36
43
run : |
37
44
python -m pip install --upgrade pip
38
45
python -m pip install --upgrade setuptools wheel
39
46
python -m pip install build --user
40
47
- name : Build a binary wheel and a source tarball
41
- run : |
42
- python -m build --sdist --wheel --outdir dist/
43
- - name : Publish package distributions to PyPI
44
- if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
45
- uses : pypa/gh-action-pypi-publish@release/v1
48
+ run : python3 -m build
49
+ - name : Store the distribution packages
50
+ if : >
51
+ github.event_name == 'push' &&
52
+ startsWith(github.ref, 'refs/tags') &&
53
+ github.base_ref == 'main' &&
54
+ github.actor == github.repository_owner
55
+ uses : actions/upload-artifact@v4
56
+ with :
57
+ name : python-package-distributions
58
+ path : dist/
59
+ - name : Publish package on Pypi
60
+ if : >
61
+ github.event_name == 'push' &&
62
+ startsWith(github.ref, 'refs/tags') &&
63
+ github.base_ref == 'main' &&
64
+ github.actor == github.repository_owner
65
+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments