Skip to content

Commit ee7c887

Browse files
committed
ci: add tag-triggered release workflow (ported from audiothek-downloader)
Pushing a v* tag verifies the tag matches pyproject version, builds the wheel and sdist with uv, and attaches them to a GitHub release with auto-generated notes. Requires the new setuptools build-system so uv build succeeds (project was previously un-packaged).
1 parent bac354f commit ee7c887

3 files changed

Lines changed: 51 additions & 1 deletion

File tree

‎.github/workflows/release.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build & Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v7
19+
20+
- name: Set up uv
21+
uses: astral-sh/setup-uv@v6
22+
23+
- name: Check tag matches package version
24+
run: |
25+
tag="${GITHUB_REF_NAME#v}"
26+
pkg_version="$(grep -m1 '^version' pyproject.toml | cut -d'"' -f2)"
27+
if [ "$tag" != "$pkg_version" ]; then
28+
echo "Tag ${GITHUB_REF_NAME} does not match pyproject version ${pkg_version}"
29+
exit 1
30+
fi
31+
32+
- name: Build distribution
33+
run: uv build
34+
35+
- name: Create GitHub Release
36+
env:
37+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
run: gh release create "${{ github.ref_name }}" dist/* --title "${{ github.ref_name }}" --generate-notes

‎pyproject.toml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools]
6+
packages = ["dccbot"]
7+
18
[project]
29
name = "dccbot"
310
version = "0.4.0"
@@ -77,6 +84,11 @@ source_paths = ["dccbot/"]
7784
also_copy = ["static"]
7885
pytest_add_cli_args_test_selection = ["tests/unit"]
7986
pytest_add_cli_args = ["-x", "-q", "--timeout=60"]
87+
# Log-call argument mutations can never change observable behaviour; the
88+
# pattern skips the whole Call expression, including multi-line calls.
89+
do_not_mutate_patterns = [
90+
'^\s*(logger|log)\.',
91+
]
8092

8193
[tool.pyright]
8294
exclude = ["**/__pycache__", "**/node_modules", "**/dist", "**/build", "**/venv", "**/.venv", "**/mutants"]

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)