Skip to content

Commit b00479a

Browse files
ci: add test CI and PyPI publish workflows
1 parent bbff7b1 commit b00479a

1,942 files changed

Lines changed: 274162 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
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+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
pip install -e ".[dev]"
27+
28+
- name: Run tests
29+
run: |
30+
python -m pytest tests/ -v --cov=src --cov-report=term-missing

.github/workflows/publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
pypi_target:
9+
description: 'PyPI target (pypi or testpypi)'
10+
default: 'testpypi'
11+
type: choice
12+
options:
13+
- pypi
14+
- testpypi
15+
16+
jobs:
17+
build-and-publish:
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
id-token: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Set up Python 3.11
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: Install build deps
32+
run: |
33+
pip install build twine
34+
35+
- name: Build package
36+
run: |
37+
python -m build
38+
39+
- name: Publish to PyPI
40+
if: ${{ inputs.pypi_target != 'testpypi' || github.event_name == 'release' }}
41+
env:
42+
TWINE_USERNAME: __token__
43+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
44+
run: |
45+
twine upload dist/* --verbose
46+
47+
- name: Publish to TestPyPI
48+
if: ${{ inputs.pypi_target == 'testpypi' }}
49+
env:
50+
TWINE_USERNAME: __token__
51+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
52+
run: |
53+
twine upload --repository testpypi dist/* --verbose
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:\Users\home\OneDrive\Documents\GitHub\deploydiff\src
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:\Users\home\OneDrive\Documents\GitHub\json2sql\src
512 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from __future__ import annotations
2+
3+
4+
__all__ = ["__version__", "version_tuple"]
5+
6+
try:
7+
from ._version import version as __version__
8+
from ._version import version_tuple
9+
except ImportError: # pragma: no cover
10+
# broken installation, we don't even try
11+
# unknown only works because we do poor mans version compare
12+
__version__ = "unknown"
13+
version_tuple = (0, 0, "unknown")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)