@@ -6,19 +6,15 @@ name: Upload Python Package
6
6
7
7
on :
8
8
release :
9
- types : [created ]
9
+ types : [published ]
10
10
11
11
jobs :
12
- pypi-publish :
12
+ release-build :
13
13
runs-on : ubuntu-latest
14
-
15
- environment :
16
- name : pypi
17
- url : https://pypi.org/project/tldr/
18
-
19
14
permissions :
20
15
contents : read
21
- id-token : write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher
16
+ attestations : write # to upload assets attestation of 'dists' for build provenance
17
+ id-token : write # grant additional permission to attestation action to mint the OIDC token permission
22
18
23
19
steps :
24
20
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -29,40 +25,57 @@ jobs:
29
25
python-version : ' 3.9'
30
26
31
27
- name : Install sphinx toolset
32
- run : >-
33
- python -m
34
- pip install
35
- sphinx
36
- sphinx-argparse
37
- --user
28
+ run :
29
+ python -m pip install sphinx sphinx-argparse --user
38
30
39
31
- name : Install tldr dependencies
40
- run : >-
41
- python -m
42
- pip install
43
- -r
44
- requirements.txt
45
- --user
32
+ run :
33
+ python -m pip install -r requirements.txt --user
46
34
47
35
- name : Generate the manpage
48
36
working-directory : docs
49
37
run : make man
50
38
51
39
- name : Install pep517
52
- run : >-
53
- python -m
54
- pip install
55
- pep517
56
- --user
40
+ run :
41
+ python -m pip install pep517 --user
57
42
58
43
- name : Build a binary wheel and a source tarball
59
44
run : >-
60
- python -m
61
- pep517.build
45
+ python -m pep517.build
62
46
--source
63
47
--binary
64
48
--out-dir dist/
65
49
.
66
50
51
+ - name : Attest generated files
52
+ uses : actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
53
+ with :
54
+ subject-path : dist/
55
+
56
+ - name : Upload release distributions
57
+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
58
+ with :
59
+ name : release-dists
60
+ path : dist/
61
+
62
+ pypi-publish :
63
+ runs-on : ubuntu-latest
64
+ needs : ['release-build']
65
+
66
+ environment :
67
+ name : pypi
68
+ url : https://pypi.org/project/tldr/
69
+
70
+ permissions :
71
+ id-token : write # Required for accessing OpenID Connect (OIDC) token for PyPI trusted publisher
72
+
73
+ steps :
74
+ - name : Retrieve release distributions
75
+ uses : actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
76
+ with :
77
+ name : release-dists
78
+ path : dist/
79
+
67
80
- name : Publish package
68
81
uses : pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
0 commit comments