Skip to content

Commit e5a5a32

Browse files
committed
ci: add GitHub Actions for tests and tagged releases
1 parent bd4d3e9 commit e5a5a32

10 files changed

Lines changed: 96 additions & 164 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install cryptography
23+
- name: Run tests
24+
run: python -m pytest test_authforge.py -v

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.12"
18+
- name: Install build tooling
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install build twine
22+
- name: Verify tag matches pyproject version
23+
run: |
24+
TAG="${GITHUB_REF#refs/tags/v}"
25+
PYPROJECT=$(grep '^version' pyproject.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
26+
if [ "$TAG" != "$PYPROJECT" ]; then
27+
echo "Tag v$TAG does not match pyproject.toml version $PYPROJECT"
28+
exit 1
29+
fi
30+
- name: Build
31+
run: python -m build
32+
- name: Check with twine
33+
run: twine check dist/*
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
11
__pycache__/
2-
*.pyc
2+
*.py[cod]
3+
*$py.class
4+
*.so
5+
6+
# Virtual environments (local / CI helpers)
7+
.venv/
8+
venv/
9+
.venv-*/
10+
ENV/
11+
12+
# Local secrets
13+
.env
14+
.env.*
15+
16+
# Packaging / setuptools
17+
build/
18+
dist/
19+
*.egg
20+
*.egg-info/
21+
.eggs/
22+
pip-wheel-metadata/
23+
24+
# Test / type / lint caches
25+
.pytest_cache/
26+
.mypy_cache/
27+
.ruff_cache/
28+
htmlcov/
29+
.coverage
30+
.coverage.*
31+
.cache/
32+
coverage.xml
33+
*.cover
34+
.hypothesis/
35+
36+
# OS / editor
37+
.DS_Store
38+
Thumbs.db

authforge.egg-info/PKG-INFO

Lines changed: 0 additions & 151 deletions
This file was deleted.

authforge.egg-info/SOURCES.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

authforge.egg-info/dependency_links.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

authforge.egg-info/requires.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

authforge.egg-info/top_level.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
-8.42 KB
Binary file not shown.

dist/authforge-1.0.0.tar.gz

-8.68 KB
Binary file not shown.

0 commit comments

Comments
 (0)