Skip to content

Commit 4e37ed0

Browse files
authored
Create publish.yml
1 parent 77f5b92 commit 4e37ed0

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Only triggers on version tags like v1.0.0
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and publish Python 🐍 package
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.10' # Adjust if needed
20+
21+
- name: Install build tools
22+
run: |
23+
pip install --upgrade build
24+
25+
- name: Build the package
26+
run: |
27+
python -m build
28+
29+
- name: Publish to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)