From 36d691b4aa5aa9b53c60dbd4d043f3f35404f3dd Mon Sep 17 00:00:00 2001 From: Jeremy Lane Date: Wed, 26 Aug 2026 13:13:44 +0200 Subject: [PATCH 1/3] ci: Automatically test each Pull Request and each commit on `main` across a matrix of Python versions (3.10 to 3.14+) and Django (4.2 LTS, 5.0, 5.1, 5.2). --- .github/workflows/test.yml | 53 ++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7813760 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: Tests + +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Python ${{ matrix.python-version }} / Django ${{ matrix.django-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13"] + django-version: ["4.2", "5.0", "5.1"] + include: + - python-version: "3.14-dev" + django-version: "5.1" + exclude: + - python-version: "3.13" + django-version: "4.2" + - python-version: "3.13" + django-version: "5.0" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install "django~=${{ matrix.django-version }}.0" -e . + + - name: Run test suite + run: | + ./bin/test.sh diff --git a/README.md b/README.md index 2b0a3b4..fbe2324 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # django-alpine [![PyPI Version](https://img.shields.io/pypi/v/django-alpine.svg)](https://pypi.org/project/django-alpine/) +[![Tests](https://img.shields.io/github/actions/workflow/status/ProKelly/django-alpine/test.yml?branch=main&label=tests)](https://github.com/ProKelly/django-alpine/actions/workflows/test.yml) [![Python Versions](https://img.shields.io/pypi/pyversions/django-alpine.svg)](https://pypi.org/project/django-alpine/) [![Django Versions](https://img.shields.io/pypi/djversions/django-alpine.svg)](https://pypi.org/project/django-alpine/) [![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](LICENSE) From 6c6dcc54ebc994e652d11b1e84feede11758c92b Mon Sep 17 00:00:00 2001 From: Jeremy Lane Date: Wed, 26 Aug 2026 19:53:50 +0200 Subject: [PATCH 2/3] build: Creating the publishing workflow --- .github/workflows/publish.yml | 47 +++++++++++++++++++++++++++++++++++ pyproject.toml | 1 - 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e54b6ca --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,47 @@ +name: Publish to PyPI + +on: + release: + types: [published] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + build-and-publish: + name: Build & Publish distribution to PyPI + runs-on: ubuntu-latest + permissions: + # Mandatory permission for PyPI Trusted Publishing (OIDC token exchange) + id-token: write + contents: read + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Build binary wheel and source distribution + run: | + python -m build + + - name: Verify package metadata and archives + run: | + python -m twine check --strict dist/* + + - name: Publish package distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + verbose: true diff --git a/pyproject.toml b/pyproject.toml index 66141ee..78fd204 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ classifiers = [ "Framework :: Django :: 5.1", "Framework :: Django :: 5.2", "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", From 2cd29b3aef473a2300406ffcabe88fc8997b46c1 Mon Sep 17 00:00:00 2001 From: Jeremy Lane Date: Thu, 27 Aug 2026 11:14:06 +0200 Subject: [PATCH 3/3] ci: add GitHub Actions test matrix, PyPI release workflows and Commitizen config --- .github/workflows/publish.yml | 3 +++ .github/workflows/test.yml | 2 ++ pyproject.toml | 14 ++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e54b6ca..90c879b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,6 +1,9 @@ name: Publish to PyPI on: + push: + tags: + - "v*" release: types: [published] workflow_dispatch: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7813760..f25b829 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: branches: - main - master + tags: + - "v*" pull_request: branches: - main diff --git a/pyproject.toml b/pyproject.toml index 78fd204..c968d16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,9 @@ dev = [ "requests>=2.28.0", "pytest>=8.0", "pytest-django>=4.8", + "commitizen>=3.20.0", + "build>=1.0.0", + "twine>=5.0.0", ] [project.urls] @@ -68,3 +71,14 @@ django_alpine = [ "static/django_alpine/*.js", "static/django_alpine/**/*.js", ] + +[tool.commitizen] +name = "cz_conventional_commits" +tag_format = "v$version" +version_scheme = "semver" +version_provider = "pep621" +update_changelog_on_bump = true +major_version_zero = true +version_files = [ + "django_alpine/__init__.py:__version__", +]