Skip to content

Commit c34105a

Browse files
committed
ci: Publish on PyPI only tags
1 parent ff57b28 commit c34105a

File tree

2 files changed

+30
-45
lines changed

2 files changed

+30
-45
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
push:
77
branches:
88
- master
9+
tags:
10+
- 'v*'
911

1012
jobs:
1113

@@ -130,3 +132,31 @@ jobs:
130132
pybind11-stubgen "${{ matrix.test-package }}" -o flavour-2 --numpy-array-remove-parameters
131133
pybind11-stubgen "${{ matrix.test-package }}" -o flavour-3 --print-invalid-expressions-as-is
132134
pybind11-stubgen "${{ matrix.test-package }}" --dry-run
135+
136+
publish:
137+
name: Publish distribution
138+
needs : [format, tests, test-cli-options]
139+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
140+
runs-on: ubuntu-latest
141+
142+
steps:
143+
- uses: actions/checkout@v3
144+
145+
- name: Setup Python ${{ matrix.python }}
146+
uses: actions/setup-python@v2
147+
with:
148+
python-version: "3.10"
149+
150+
- name: Build dist
151+
run: pipx run build --sdist --wheel
152+
153+
- uses: actions/upload-artifact@v2
154+
with:
155+
path: |
156+
dist/*.tar.gz
157+
dist/*.whl
158+
159+
- uses: pypa/[email protected]
160+
with:
161+
user: __token__
162+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)