File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release to PyPI
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ test_pypi :
7+ description : ' Upload to Test PyPI instead of PyPI'
8+ required : false
9+ default : false
10+ type : boolean
11+ release :
12+ types : [published]
13+
14+ jobs :
15+ build-and-publish :
16+ runs-on : ubuntu-latest
17+ environment : release
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v5
22+
23+ - name : Set up Python
24+ uses : actions/setup-python@v5
25+ with :
26+ python-version : ' 3.13'
27+
28+ - name : Install uv
29+ run : |
30+ curl -LsSf https://astral.sh/uv/install.sh | sh
31+ - name : Install build dependencies
32+ run : |
33+ uv pip install --python ${Python_ROOT_DIR} build twine
34+
35+ - name : Build package
36+ run : python -m build
37+
38+ - name : Check package
39+ run : python -m twine check dist/*
40+
41+ - name : Upload to Test PyPI
42+ if : ${{ github.event.inputs.test_pypi == 'true' }}
43+ uses : pypa/gh-action-pypi-publish@release/v1
44+ with :
45+ password : ${{ secrets.TEST_PYPI_API_TOKEN }}
46+ repository-url : https://test.pypi.org/legacy/
47+ verbose : true
48+
49+ - name : Upload to PyPI
50+ if : ${{ github.event.inputs.test_pypi != 'true' }}
51+ uses : pypa/gh-action-pypi-publish@release/v1
52+ with :
53+ password : ${{ secrets.PYPI_API_TOKEN }}
54+ verbose : true
You can’t perform that action at this time.
0 commit comments