Skip to content
Open
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
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish to PyPI

on:
push:
tags:
- "v*"
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
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
push:
branches:
- main
- master
tags:
- "v*"
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -53,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]
Expand All @@ -69,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__",
]