Skip to content

Commit e23a010

Browse files
committed
✨ add publish workflow
1 parent 8e2618e commit e23a010

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and Publish
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.10"
21+
22+
- name: Install Poetry
23+
run: |
24+
curl -sSL https://install.python-poetry.org | python3 -
25+
echo "export PATH=\"$HOME/.local/bin:$PATH\"" >> $GITHUB_ENV
26+
27+
- name: Install dependencies
28+
run: poetry install --no-interaction --no-ansi
29+
30+
- name: Build the package
31+
run: poetry build
32+
33+
- name: Configure Poetry for PyPI
34+
run: |
35+
poetry config pypi-token.pypi ${{ secrets.TWINE_API_TOKEN }}
36+
37+
- name: Publish to PyPI
38+
run: |
39+
poetry publish --no-interaction --no-ansi

0 commit comments

Comments
 (0)