-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (30 loc) · 849 Bytes
/
publish.yml
File metadata and controls
30 lines (30 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Test and Publish to PyPI
on:
push:
tags: ['v*.*.*']
jobs:
test:
uses: ./.github/workflows/test.yml
with:
python-versions: '["3.11", "3.12"]' # Only test recent versions for releases
run-linting: true
test-build: false
publish:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*