Skip to content

Commit 520d501

Browse files
author
Douglas Jones
committed
ci: add PyPI publish job on main push
1 parent f6d4b53 commit 520d501

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,29 @@ jobs:
4848
sys.exit(1)
4949
print('Capability manifest is current.')
5050
"
51+
52+
publish:
53+
name: Publish to PyPI
54+
runs-on: ubuntu-latest
55+
needs: test
56+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: "3.11"
65+
66+
- name: Install build tools
67+
run: pip install build twine
68+
69+
- name: Build distribution
70+
run: python3 -m build
71+
72+
- name: Publish to PyPI
73+
env:
74+
TWINE_USERNAME: __token__
75+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
76+
run: twine upload dist/*

0 commit comments

Comments
 (0)