@@ -12,12 +12,10 @@ permissions:
12
12
contents : read
13
13
14
14
jobs :
15
- release-pypi :
16
- name : Upload release to PyPI
15
+ build :
16
+ name : Build release assets
17
17
runs-on : ubuntu-latest
18
- environment :
19
- name : PyPI
20
- url : https://pypi.org/project/pylint/
18
+ if : github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
21
19
steps :
22
20
- name : Check out code from Github
23
21
@@ -31,15 +29,52 @@ jobs:
31
29
run : |
32
30
# Remove dist, build, and pylint.egg-info
33
31
# when building locally for testing!
34
- python -m pip install twine build
32
+ python -m pip install build
35
33
- name : Build distributions
36
34
run : |
37
35
python -m build
36
+ - name : Upload release assets
37
+
38
+ with :
39
+ name : release-assets
40
+ path : dist/
41
+
42
+ release-pypi :
43
+ name : Upload release to PyPI
44
+ runs-on : ubuntu-latest
45
+ needs : ["build"]
46
+ environment :
47
+ name : PyPI
48
+ url : https://pypi.org/project/pylint/
49
+ permissions :
50
+ id-token : write
51
+ steps :
52
+ - name : Download release assets
53
+
54
+ with :
55
+ name : release-assets
56
+ path : dist/
38
57
- name : Upload to PyPI
39
58
if : github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
40
- env :
41
- TWINE_REPOSITORY : pypi
42
- TWINE_USERNAME : __token__
43
- TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
44
- run : |
45
- twine upload --verbose dist/*
59
+ uses : pypa/gh-action-pypi-publish@release/v1
60
+
61
+ release-github :
62
+ name : Upload assets to Github release
63
+ runs-on : ubuntu-latest
64
+ needs : ["build"]
65
+ permissions :
66
+ contents : write
67
+ id-token : write
68
+ steps :
69
+ - name : Download release assets
70
+
71
+ with :
72
+ name : release-assets
73
+ path : dist/
74
+ - name : Sign the dists with Sigstore and upload assets to Github release
75
+ if : github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
76
+
77
+ with :
78
+ inputs : |
79
+ ./dist/*.tar.gz
80
+ ./dist/*.whl
0 commit comments