Skip to content

Commit 4f85a95

Browse files
authored
Deploy releases automatically (#55)
1 parent b1a07db commit 4f85a95

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/release.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger this workflow for tags starting with "v"
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.9 # Specify the Python version
20+
21+
- name: Install Poetry
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install poetry
25+
26+
- name: Extract version from tag
27+
id: get_version
28+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
29+
30+
- name: Update version in pyproject.toml
31+
run: poetry version ${{ env.version }}
32+
33+
- name: Install dependencies
34+
run: poetry install --no-root
35+
36+
- name: Build and Publish to PyPI
37+
env:
38+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
39+
run: |
40+
poetry build
41+
poetry publish

0 commit comments

Comments
 (0)