Skip to content

Commit 7b5acc7

Browse files
committed
Add a release workflow
1 parent 792df33 commit 7b5acc7

File tree

4 files changed

+344
-237
lines changed

4 files changed

+344
-237
lines changed

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v3
20+
with:
21+
version: "latest"
22+
enable-cache: true
23+
24+
- name: Install dependencies
25+
run: uv sync --dev
26+
27+
- name: Run type checking
28+
run: uv run mypy .
29+
30+
- name: Run linting
31+
run: uv run ruff check .
32+
33+
test:
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
38+
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@v3
44+
with:
45+
version: "latest"
46+
enable-cache: true
47+
48+
- name: Install dependencies
49+
run: uv sync --dev --python ${{ matrix.python-version }}
50+
51+
- name: Run tests
52+
run: uv run pytest
53+
54+
build-and-publish:
55+
needs: [lint, test]
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Install uv
62+
uses: astral-sh/setup-uv@v3
63+
with:
64+
version: "latest"
65+
enable-cache: true
66+
67+
- name: Build package
68+
run: uv build
69+
70+
- name: Publish to PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1
72+
73+
- name: Create changelog text
74+
id: changelog
75+
uses: loopwerk/tag-changelog@v1
76+
with:
77+
token: ${{ secrets.GITHUB_TOKEN }}
78+
exclude_types: other,doc,chore,build
79+
80+
- name: Create release
81+
uses: softprops/action-gh-release@v2
82+
with:
83+
body: ${{ steps.changelog.outputs.changes }}
84+
token: ${{ secrets.GITHUB_TOKEN }}

example/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
2727

28-
ALLOWED_HOSTS = []
28+
ALLOWED_HOSTS = ["*"]
2929

3030

3131
# Application definition

pyproject.toml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,39 @@ authors = [
88
license = "MIT"
99
license-files = [ "LICENSE" ]
1010
readme = "README.md"
11-
keywords = ["rss", "atom", "feed", "filter", "mute", "django"]
1211
requires-python = ">=3.9"
1312
dependencies = [
1413
"django>=3.2.0",
1514
"feedgen>=1.0.0",
1615
"feedparser>=6.0.11",
1716
"httpx>=0.28.1",
1817
]
18+
keywords = ["rss", "atom", "feed", "filter", "mute", "django"]
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Environment :: Web Environment",
22+
"Framework :: Django",
23+
"Framework :: Django :: 3.2",
24+
"Framework :: Django :: 4.0",
25+
"Framework :: Django :: 4.1",
26+
"Framework :: Django :: 4.2",
27+
"Framework :: Django :: 5.0",
28+
"Framework :: Django :: 5.1",
29+
"Framework :: Django :: 5.2",
30+
"Intended Audience :: Developers",
31+
"License :: OSI Approved :: MIT License",
32+
"Operating System :: OS Independent",
33+
"Programming Language :: Python",
34+
"Programming Language :: Python :: 3",
35+
"Programming Language :: Python :: 3.9",
36+
"Programming Language :: Python :: 3.10",
37+
"Programming Language :: Python :: 3.11",
38+
"Programming Language :: Python :: 3.12",
39+
"Programming Language :: Python :: 3.13",
40+
"Topic :: Internet :: WWW/HTTP",
41+
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
42+
"Topic :: Software Development :: Libraries :: Python Modules",
43+
]
1944

2045
[dependency-groups]
2146
dev = [
@@ -41,15 +66,13 @@ module-root = ""
4166
[tool.uv]
4267
package = true
4368

44-
[tool.hatch.build.targets.wheel]
45-
packages = ["rssfilter"]
46-
4769
[tool.ruff]
4870
line-length = 120
4971
lint.extend-select = ["I", "N"]
5072

5173
[tool.mypy]
5274
disable_error_code = ["import-untyped"]
75+
exclude = ["migrations/"]
5376
warn_redundant_casts = true
5477
check_untyped_defs = true
5578

0 commit comments

Comments
 (0)