File tree 1 file changed +39
-0
lines changed 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Publish Python Package
2
+
3
+ # To trigger the workflow, you need to tag the library with a version number like this:
4
+ # git tag v1.0.0
5
+ # git push origin v1.0.0
6
+
7
+ on :
8
+ push :
9
+ tags :
10
+ - ' v*.*.*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
11
+
12
+ jobs :
13
+ build :
14
+ runs-on : ubuntu-latest
15
+
16
+ steps :
17
+ - name : Checkout code
18
+ uses : actions/checkout@v3
19
+
20
+ - name : Set up Python
21
+ uses : actions/setup-python@v4
22
+ with :
23
+ python-version : ' 3.x' # Choose your Python version (e.g., '3.9')
24
+
25
+ - name : Install dependencies
26
+ run : |
27
+ python -m pip install --upgrade pip
28
+ pip install build
29
+
30
+ - name : Build package
31
+ run : python -m build
32
+
33
+ - name : Publish to PyPI
34
+ env :
35
+ TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
36
+ TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
37
+ run : |
38
+ pip install twine
39
+ twine upload dist/*
You can’t perform that action at this time.
0 commit comments