VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.
Python aiaudiobookcudadubbingelevenlabs-alternativehuggingfacelocal-firstmlxomnivoice-studiospeech-to-texttext-to-speechtranscriptiontranslatettsvoice-aivoice-cloningvoice-generationvoicestudioworkflow
feat(release): add a Contributors block to the release notes automatically
velixioe023c232a613
diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.ymlindex ac4de24b8..32185fbb4 100644--- a/.github/workflows/electron-release.yml+++ b/.github/workflows/electron-release.yml@@ -310,7 +310,7 @@ jobs:path: release-assets- name: Validate all platforms before creating a releaserun: |- python3 scripts/prepare_electron_release.py --assets release-assets --tag "$TAG"+ python3 scripts/prepare_electron_release.py --assets release-assets --tag "$TAG" --repo "$GITHUB_REPOSITORY"- name: Preserve the final Tauri updater feeds# Archived Tauri clients read `latest/download`, which never serves a# prerelease, so only Stable releases carry the sunset feeds.@@ -321,7 +321,7 @@ jobs:# so archived Tauri clients never receive Electron installers.gh release download "$SUNSET_TAG" --pattern latest.json --dir release-assetsgh release download "$SUNSET_TAG" --pattern latest-user.json --dir release-assets- python3 scripts/prepare_electron_release.py --assets release-assets --tag "$TAG" --sunset-tag "$SUNSET_TAG"+ python3 scripts/prepare_electron_release.py --assets release-assets --tag "$TAG" --sunset-tag "$SUNSET_TAG" --repo "$GITHUB_REPOSITORY"- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0with:pattern: electron-signing-*diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6509c45a7..728233565 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -105,6 +105,7 @@ metadata and the backend fallback mirror it.### CI+- Release notes list everyone who contributed since the last stable release automatically, instead of only the people thanked by hand (#PRNUM)- Release notes list each platform's installer signing as measured on the build, and a macOS build that would open as "damaged" can no longer be released (#3241)- The owner can let named maintainers publish releases while Windows installers are still unsigned (#3236)- Android release and Play builds share an increasing version code to prevent reused or decreasing build numbers (#2969)diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex bc1ab0d80..9884e59e1 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -104,7 +104,14 @@ version only after validation.4. Rename `## [Unreleased]` in `CHANGELOG.md` to `## [X.Y.Z] — YYYY-MM-DD`.Lead with the largest user-visible change, keep Highlights to 3–5 bullets,include migration steps and real screenshots when relevant, and verify human- contributors and bug reporters from the tag comparison and included PRs.+ contributors and bug reporters from the tag comparison and included PRs. The+ release workflow adds a `### Contributors` block to the GitHub Release notes+ by itself: everyone who committed since the latest stable release, plus the+ authors of PRs merged in that span (ranked by commits; bots, AI agents and+ unlinked placeholders are never listed). It does **not** find bug reporters,+ and it skips the block when the changelog section already has a+ `### Contributors` heading, so write one by hand when you want roles or+ reporters credited.5. Run `uv run pytest tests/test_app_version.py tests/test_changelog_style.py -q`.6. Audit contributor agreements: `git fetch origin cla-signatures`, then`GH_TOKEN=... python scripts/cla_audit.py`. Follow up with each unsigneddiff --git a/scripts/prepare_electron_release.py b/scripts/prepare_electron_release.pyindex d34fef809..baf3b322a 100644--- a/scripts/prepare_electron_release.py+++ b/scripts/prepare_electron_release.py@@ -3,8 +3,12 @@import base64import argparseimport hashlib+import importlib.utilimport jsonimport re+import subprocess+import sys+from collections import Counterfrom pathlib import Pathfrom urllib.parse import urlparsefrom check_electron_release_assets import verify_release@@ -30,7 +34,56 @@ def channel_for(version):return "beta"raise ValueError(f"Not a stable or beta release version: {version}")-def prepare(assets, tag, sunset_tag=None):+def _gh(*args):+ return subprocess.run(["gh", *args], capture_output=True, text=True, check=True).stdout+++# The same agent list the commit-identity gate uses: agents are never credited.+_spec = importlib.util.spec_from_file_location(+ "agent_identities", Path(__file__).resolve().parents[1] / ".github" / "scripts" / "agent_identities.py")+agents = importlib.util.module_from_spec(_spec)+_spec.loader.exec_module(agents)+# GitHub's login for commits whose author email is not linked to any account.+UNLINKED_LOGIN = "invalid-email-address"+++def is_credit_worthy(login):+ """People only: no bots, no AI agents, no unlinked-commit placeholder."""+ name = login.removeprefix("app/").lower()+ return not (login.startswith("app/") or name.endswith("[bot]")+ or name in agents.AGENT_LOGINS or name == UNLINKED_LOGIN)+++def contributors_section(repo, tag, gh=_gh):+ """A `### Contributors` block for everyone who contributed since the last stable release.++ Two sources, because either alone misses people: commit authors in the tag+ comparison (ranked by commit count), then authors of PRs merged since that+ release whose commits are not linked to their GitHub account. The base is the+ latest published stable release, so a beta and a stable release both cover the+ whole span since the previous stable. Bots, AI agents and unlinked placeholders+ are left out. Returns "" when there is nobody to thank.+ """+ latest = gh("api", f"repos/{repo}/releases/latest", "--jq", ".tag_name + \" \" + .published_at").split()+ base, since = latest[0], latest[1][:10]+ commit_authors = gh("api", f"repos/{repo}/compare/{base}...{tag}", "--paginate",+ "--jq", ".commits[].author.login // empty").split()+ pr_authors = gh("pr", "list", "--repo", repo, "--state", "merged", "--search", f"merged:>={since}",+ "--limit", "1000", "--json", "author", "--jq", ".[].author.login").split()+ counts = Counter(login for login in commit_authors if is_credit_worthy(login))+ ordered = sorted(counts, key=lambda login: (-counts[login], login.lower()))+ seen = {login.lower() for login in ordered}+ for login in sorted({p for p in pr_authors if is_credit_worthy(p)}, key=str.lower):+ if login.lower() not in seen:+ ordered.append(login)+ seen.add(login.lower())+ if not ordered:+ return ""+ mentions = ", ".join(f"@{login}" for login in ordered)+ return f"### Contributors\n\nThanks to everyone who contributed to this release: {mentions}\n"+++def prepare(assets, tag, sunset_tag=None, repo=None, gh=_gh):version = json.loads(Path("package.json").read_text())["version"]if tag != f"v{version}":raise ValueError("Tag must match package version")@@ -61,6 +114,16 @@ def prepare(assets, tag, sunset_tag=None):if not section or not section[1].strip():raise ValueError("Write versioned CHANGELOG notes before release")notes = section[1].strip() + "\n"+ # A hand-written Contributors block (with roles, reporters) always wins.+ if repo and not re.search(r"^#{2,4} Contributors", notes, re.M):+ try:+ block = contributors_section(repo, tag, gh)+ except (subprocess.CalledProcessError, OSError) as error:+ # Credits must never block a release; say so loudly instead.+ print(f"::warning::Contributors section skipped: {error}", file=sys.stderr)+ block = ""+ if block:+ notes += "\n" + block(assets / "RELEASE_NOTES.md").write_text(notes)(assets / "SHA256SUMS.txt").write_text("\n".join(f"{hashlib.sha256(p.read_bytes()).hexdigest()} {p.name}" for p in sorted(files)@@ -71,12 +134,13 @@ if __name__ == "__main__":parser.add_argument("--assets", type=Path)parser.add_argument("--tag")parser.add_argument("--sunset-tag")+ parser.add_argument("--repo", help="owner/name; adds a Contributors section from the tag comparison")parser.add_argument("--print-channel", action="store_true",help="Print stable or beta for the package version and exit")args = parser.parse_args()if args.print_channel:print(channel_for(json.loads(Path("package.json").read_text())["version"]))elif args.assets and args.tag:- prepare(args.assets, args.tag, args.sunset_tag)+ prepare(args.assets, args.tag, args.sunset_tag, repo=args.repo)else:parser.error("--assets and --tag are required")diff --git a/tests/test_release_contributors.py b/tests/test_release_contributors.pynew file mode 100644index 000000000..b4e8968e6--- /dev/null+++ b/tests/test_release_contributors.py@@ -0,0 +1,131 @@+"""Release notes get a Contributors block from the tag comparison, automatically.++v0.5.7-beta.1 shipped with notes copied from [Unreleased], which name only the+people whose entries were credited by hand, so the maintainers and most community+authors appeared nowhere. prepare_electron_release.py now adds the list itself.+"""+from __future__ import annotations++import importlib.util+import json+import subprocess+from pathlib import Path++import pytest++ROOT = Path(__file__).resolve().parents[1]+++def release(monkeypatch):+ monkeypatch.syspath_prepend(str(ROOT / "scripts"))+ spec = importlib.util.spec_from_file_location(+ "prepare_release_contributors_test", ROOT / "scripts/prepare_electron_release.py"+ )+ module = importlib.util.module_from_spec(spec)+ spec.loader.exec_module(module)+ return module+++class FakeGh:+ """Answers the two `gh api` calls the helper makes and records them."""++ def __init__(self, base="v0.5.6", authors=(), pr_authors=()):+ self.base, self.authors, self.pr_authors, self.calls = base, list(authors), list(pr_authors), []++ def __call__(self, *args):+ self.calls.append(args)+ if args[0] == "pr":+ return "\n".join(self.pr_authors) + "\n"+ path = args[1]+ if path.endswith("/releases/latest"):+ return self.base + " 2026-09-23T08:53:32Z\n"+ if "/compare/" in path:+ return "\n".join(self.authors) + "\n"+ raise AssertionError(f"unexpected gh call: {args}")+++def test_authors_are_ranked_by_commits_and_include_maintainers(release):+ gh = FakeGh(authors=["debpalash"] * 5 + ["velixio"] * 3 + ["rudycelekli"] * 3 + ["zed"])+ block = release.contributors_section("o/r", "v0.5.7", gh)+ assert block.startswith("### Contributors\n")+ # most commits first; a tie (velixio and rudycelekli, 3 each) is alphabetical+ assert "@debpalash, @rudycelekli, @velixio, @zed" in block+++def test_bots_agents_and_unlinked_placeholders_are_never_credited(release):+ """Real v0.5.7-beta.1 data contained @claude and @invalid-email-address."""+ noise = ["dependabot[bot]", "github-actions[bot]", "claude", "Claude", "copilot",+ "invalid-email-address", "app/dependabot", "coderabbitai"]+ gh = FakeGh(authors=noise + ["velixio"], pr_authors=noise)+ assert release.contributors_section("o/r", "v0.5.7", gh).endswith("@velixio\n")+ assert release.contributors_section("o/r", "v0.5.7", FakeGh(authors=noise, pr_authors=noise)) == ""+++def test_pr_authors_with_unlinked_commits_are_still_credited_after_the_committers(release):+ gh = FakeGh(authors=["debpalash", "velixio", "velixio"], pr_authors=["JoshuaWIls", "velixio", "alice"])+ block = release.contributors_section("o/r", "v0.5.7", gh)+ assert block.endswith("@velixio, @debpalash, @alice, @JoshuaWIls\n")+++def test_the_range_starts_at_the_latest_stable_release_for_betas_and_stables(release):+ for tag in ("v0.5.7-beta.3", "v0.5.7"):+ gh = FakeGh(base="v0.5.6", authors=["velixio"])+ release.contributors_section("o/r", tag, gh)+ assert gh.calls[1][1] == f"repos/o/r/compare/v0.5.6...{tag}"+ assert "--paginate" in gh.calls[1]+ pr_call = gh.calls[2]+ assert pr_call[0] == "pr" and "merged:>=2026-09-23" in pr_call+++def _prepare(release, monkeypatch, tmp_path, changelog, **kwargs):+ monkeypatch.setattr(release, "verify_release", lambda *a, **k: None)+ monkeypatch.chdir(tmp_path)+ Path("package.json").write_text(json.dumps({"version": "1.2.3-beta.1"}))+ Path("CHANGELOG.md").write_text(changelog)+ assets = tmp_path / "assets"+ assets.mkdir(exist_ok=True)+ for suffix in ("mac-arm64.dmg", "mac-x64.dmg", "linux-x64.deb"):+ (assets / f"VoiceStudio-Electron-1.2.3-beta.1-{suffix}").write_bytes(b"x")+ release.prepare(assets, "v1.2.3-beta.1", **kwargs)+ return (assets / "RELEASE_NOTES.md").read_text()+++CHANGELOG = "## [Unreleased]\n\n## [1.2.3-beta.1] — 2026-10-24\n\n- A fix (#1)\n\n## [1.2.2] — 2026-10-01\n\n- Old\n"+++def test_release_notes_get_the_contributors_block_appended(release, monkeypatch, tmp_path):+ notes = _prepare(release, monkeypatch, tmp_path, CHANGELOG, repo="o/r",+ gh=FakeGh(authors=["velixio", "debpalash", "debpalash"]))+ assert notes.startswith("- A fix (#1)\n\n### Contributors\n")+ assert notes.endswith("@debpalash, @velixio\n")+++def test_a_hand_written_contributors_section_is_never_duplicated(release, monkeypatch, tmp_path):+ changelog = CHANGELOG.replace("- A fix (#1)\n", "- A fix (#1)\n\n### Contributors\n\n- @velixio — release tooling\n")+ gh = FakeGh(authors=["someone"])+ notes = _prepare(release, monkeypatch, tmp_path, changelog, repo="o/r", gh=gh)+ assert notes.count("Contributors") == 1 and "@someone" not in notes+ assert gh.calls == []+++def test_without_a_repo_the_notes_are_the_changelog_section_exactly(release, monkeypatch, tmp_path):+ gh = FakeGh(authors=["velixio"])+ assert _prepare(release, monkeypatch, tmp_path, CHANGELOG, gh=gh) == "- A fix (#1)\n"+ assert gh.calls == []+++def test_a_failing_lookup_never_blocks_the_release(release, monkeypatch, tmp_path, capsys):+ def broken(*args):+ raise subprocess.CalledProcessError(1, args)++ notes = _prepare(release, monkeypatch, tmp_path, CHANGELOG, repo="o/r", gh=broken)+ assert notes == "- A fix (#1)\n"+ assert "Contributors section skipped" in capsys.readouterr().err+++def test_the_release_workflow_passes_the_repository_to_both_prepare_calls():+ workflow = (ROOT / ".github/workflows/electron-release.yml").read_text(encoding="utf-8")+ calls = [l for l in workflow.splitlines() if "prepare_electron_release.py --assets" in l]+ assert len(calls) == 2+ assert all('--repo "$GITHUB_REPOSITORY"' in l for l in calls)