File tree Expand file tree Collapse file tree 2 files changed +25
-17
lines changed Expand file tree Collapse file tree 2 files changed +25
-17
lines changed Original file line number Diff line number Diff line change 1
- # This workflows will upload a Python Package using Twine when a release is created
2
- # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
-
1
+ # use PyPI trusted publishing, as described here:
2
+ # https://blog.trailofbits.com/2023/05/23/trusted-publishing-a-new-benchmark-for-packaging-security/
4
3
name : publish to pypi
5
4
6
5
on :
7
6
release :
8
7
types : [published]
9
- branches : [master]
8
+
9
+ permissions :
10
+ contents : write
10
11
11
12
jobs :
12
- deploy :
13
- runs-on : ubuntu-20.04
14
- # Pin action version by commit hash to maximize trust, ref: https://securitylab.github.com/research/github-actions-building-blocks/
13
+ pypi-publish :
14
+ runs-on : ubuntu-latest
15
+ environment :
16
+ name : release
17
+ permissions :
18
+ id-token : write
15
19
steps :
16
20
- uses : actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
17
21
- name : Set up Python
@@ -21,11 +25,17 @@ jobs:
21
25
- name : Install dependencies
22
26
run : |
23
27
python -m pip install --upgrade pip
24
- pip install setuptools wheel twine
25
- - name : Build and publish
26
- env :
27
- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
28
- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
28
+ pip install -e .[build]
29
+ - name : build package
29
30
run : |
30
- python setup.py sdist bdist_wheel
31
- twine upload --skip-existing dist/*
31
+ python -m build
32
+ - name : upload package artifacts
33
+ uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
34
+ with :
35
+ path : dist/*
36
+ - name : publish package
37
+ uses : pypa/gh-action-pypi-publish@f5622bde02b04381239da3573277701ceca8f6a0 # release/v1
38
+ with :
39
+ skip-existing : true
40
+ verbose : true
41
+ print-hash : true
Original file line number Diff line number Diff line change 71
71
"types-PyYAML==6.0.10" ,
72
72
"types-tabulate==0.9.0.3" ,
73
73
],
74
- "build" : [
75
- "pyinstaller==6.3.0" ,
76
- ],
74
+ "build" : ["pyinstaller==6.3.0" , "setuptools==69.0.2" , "build==1.0.3" ],
77
75
},
78
76
zip_safe = False ,
79
77
keywords = "floss malware analysis obfuscation strings FLARE" ,
You can’t perform that action at this time.
0 commit comments