File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : PyPI Release
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ description : " Version to release (e.g., 1.2.3)"
8
+ required : true
9
+ confirm_tests :
10
+ description : " Confirm all tests have passed"
11
+ type : boolean
12
+ required : true
13
+
14
+ jobs :
15
+ release :
16
+ runs-on : ubuntu-latest
17
+ if : github.event.inputs.confirm_tests == 'true'
18
+ steps :
19
+ - uses : actions/checkout@v3
20
+ - name : Set up Python
21
+ uses : actions/setup-python@v4
22
+ with :
23
+ python-version : " 3.10"
24
+ - name : Install dependencies
25
+ run : |
26
+ python -m pip install --upgrade pip
27
+ pip install build twine
28
+ - name : Build package
29
+ run : python -m build
30
+ - name : Create GitHub Release
31
+ env :
32
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
33
+ run : |
34
+ git config user.name github-actions
35
+ git config user.email github-actions@github.com
36
+ git tag v${{ github.event.inputs.version }}
37
+ git push origin v${{ github.event.inputs.version }}
38
+ gh release create v${{ github.event.inputs.version }} --generate-notes
39
+ - name : Publish to PyPI
40
+ env :
41
+ TWINE_USERNAME : __token__
42
+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
43
+ run : twine upload dist/*
You can’t perform that action at this time.
0 commit comments