Skip to content

Commit 07deacb

Browse files
committed
add github workflow
1 parent 574719d commit 07deacb

File tree

3 files changed

+74
-9
lines changed

3 files changed

+74
-9
lines changed

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
19+
- name: Install build dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build twine
23+
24+
- name: Build package
25+
run: python -m build
26+
27+
- name: Publish to PyPI
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: |
32+
twine upload dist/*
33+
34+
- name: Verify upload
35+
run: |
36+
pip install zip2zip==${{ github.event.release.tag_name }}

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test and Build
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12']
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e .
29+
pip install pytest
30+
31+
- name: Run tests
32+
run: |
33+
pytest tests/ -v
34+
35+
- name: Build package
36+
run: |
37+
pip install build
38+
python -m build

.pre-commit-config.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,3 @@ repos:
3232
types: [ python ]
3333
pass_filenames: false
3434
stages: [ commit ]
35-
36-
37-
# - repo: https://github.com/pre-commit/mirrors-mypy
38-
# rev: '' # Use the sha / tag you want to point at
39-
# hooks:
40-
# - id: mypy
41-
# args: [--strict, --ignore-missing-imports]
42-
# additional_dependencies: ['mypy']
43-
# types: [python]

0 commit comments

Comments
 (0)