Skip to content

Commit b0282e2

Browse files
committed
Add CI
1 parent 00360d5 commit b0282e2

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*" # Push on version tags like v1.0, v1.0.0, etc.
9+
workflow_dispatch: # Allows manual triggering
10+
11+
jobs:
12+
build-and-publish:
13+
name: Build and publish Python distributions to PyPI
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write # Required for trusted publishing
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.8"
27+
28+
- name: Install Poetry
29+
uses: snok/install-poetry@v1
30+
with:
31+
virtualenvs-create: true
32+
virtualenvs-in-project: true
33+
34+
- name: Install dependencies
35+
run: poetry install --no-interaction --no-root
36+
37+
- name: Build package
38+
run: poetry build
39+
40+
- name: Publish package to PyPI
41+
if: startsWith(github.ref, 'refs/tags/v')
42+
uses: pypa/gh-action-pypi-publish@release/v1
43+
with:
44+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)