Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
paths-ignore:
- "src/_vendor/**"
schedule:
- cron: "23 3 * * 1"
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
30 changes: 28 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
permissions:
contents: write
id-token: write
attestations: write

steps:
- uses: actions/checkout@v6
Expand All @@ -19,6 +20,8 @@ jobs:
with:
python-version: "3.13"

- uses: astral-sh/setup-uv@v5

- name: Verify tag matches version
run: |
python - <<'PY'
Expand All @@ -35,20 +38,43 @@ jobs:
sys.exit(1)
PY

- name: Install deps
run: uv pip install --system -e ".[dev]"

- name: Ruff
run: uv run ruff check src test

- name: Mypy
run: uv run mypy src/sportradar_datacore_api

- name: Pytest
run: uv run pytest

- name: Build artifacts
run: |
python -m pip install --upgrade pip build
python -m build
uv build

- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
path: dist
artifact-name: sportradar-sbom

- name: Upload release artifacts
uses: actions/upload-artifact@v7
with:
name: sportradar-dist
path: dist/*

- name: Attest build provenance
uses: actions/attest-build-provenance@v2
with:
subject-path: dist/*

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ git push origin vX.Y.Z

## 3) What happens automatically
- GitHub Action `release.yml` verifies tag matches `pyproject.toml` version
- Builds `sdist` + `wheel`
- Runs ruff, mypy, and pytest before building
- Builds `sdist` + `wheel` with `uv`
- Publishes to PyPI via trusted publishing
- Artifacts are attached to a GitHub Release for the tag
- GitHub Release notes are auto-generated
- SBOM is generated and build provenance is attested
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ testpaths = ["test"]
[tool.mypy]
python_version = "3.12"
plugins = ["pydantic.mypy"]

mypy_path = ["src", "src/_vendor"]
exclude = 'src/_vendor/'

exclude = ["^src/_vendor/"]

warn_unused_ignores = true
warn_redundant_casts = true
strict_optional = true
check_untyped_defs = true
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = "datacore_client.*"
follow_imports = "skip"
ignore_errors = true
Loading