Skip to content

Commit 16278cd

Browse files
author
smkc
committed
ci: add PyPI publish workflow
1 parent eb358b6 commit 16278cd

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
publish:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.12"
24+
cache: pip
25+
cache-dependency-path: |
26+
requirements.txt
27+
requirements-dev.txt
28+
pyproject.toml
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install -r requirements-dev.txt
34+
python -m pip install build twine
35+
36+
- name: Lint and typecheck
37+
run: |
38+
python tools/lint.py --strict
39+
40+
- name: Run tests
41+
run: |
42+
python -m pytest --cov=ksef_client --cov-report=term-missing --cov-fail-under=100
43+
44+
- name: Build
45+
run: |
46+
python -m build
47+
python -m twine check dist/*
48+
49+
- name: Publish
50+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)