File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Publish to PyPI
21
3- on :
4- push :
5- branches :
6- - pip
7-
8- jobs :
9- build :
10- runs-on : ubuntu-latest
11- steps :
12- - uses : actions/checkout@v4
13-
14- - name : Set up Python
15- uses : actions/setup-python@v5
16- with :
17- python-version : ' 3.11'
18-
19- - name : Install build tools
20- run : |
21- python -m pip install --upgrade pip
22- pip install build
23-
24-
25- # Clean old builds before build
26- - name : Clean old builds
27- run : rm -rf dist
28-
29- - name : Build package
30- run : python -m build
31-
32- - name : Upload dist artifact
33- uses : actions/upload-artifact@v4
34- with :
35- name : dist-files
36- path : dist/
37-
38- publish :
39- needs : build
40- runs-on : ubuntu-latest
41- steps :
42- - name : Download dist artifact
43- uses : actions/download-artifact@v4
44- with :
45- name : dist-files
46- path : dist/
47-
48- - name : Set up Python
49- uses : actions/setup-python@v5
50- with :
51- python-version : ' 3.11'
52-
53- - name : Install Twine
54- run : pip install twine
55-
56- - name : Publish to PyPI or TestPyPI
57- env :
58- TWINE_USERNAME : __token__
59- PYPI_TOKEN : ${{ secrets.PYPI_API_TOKEN }}
60- run : |
61- echo "🚀 Publishing to PyPI"
62- twine upload --verbose -u __token__ -p "$PYPI_TOKEN" dist/*
63-
You can’t perform that action at this time.
0 commit comments