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
fix(release): say which platforms are unsigned before asking
velixio12ccf6e38be3
diff --git a/docs/RELEASING.md b/docs/RELEASING.mdindex f644038cb..423329cce 100644--- a/docs/RELEASING.md+++ b/docs/RELEASING.md@@ -187,8 +187,13 @@ type the tag name.beta copies it), runs the version guards, commits, pushes `main` and the tag.The tag push builds a draft release; nothing is public.- **Publish:** the same, then dispatches `electron-release.yml` with- `publish=true`. If the Mac/Windows signing secrets are missing or unreadable it- stops unless you explicitly accept unsigned installers.+ `publish=true`. It lists which platforms have signing secrets (macOS needs the+ Developer ID and notarization set, Windows needs `ELECTRON_WINDOWS_CSC_LINK` and+ its password) and, for any platform without them, stops unless you explicitly+ accept shipping that platform unsigned. The dispatch's `allow_unsigned` flag is+ all-or-nothing: with it, the workflow also skips its macOS signature check even+ where macOS signing is configured, and the release notes carry the generic+ unsigned disclosure.- `--publish vX.Y.Z[-beta.N]` (`make release-publish TAG=…`) publishes an existingdraft build later.- `--dry-run` (`make release-dry`) prints the plan and changes nothing.diff --git a/scripts/release.py b/scripts/release.pyindex a88ad877a..acdbcd56f 100644--- a/scripts/release.py+++ b/scripts/release.py@@ -35,7 +35,14 @@ GUARD_TESTS = [RELEASE_FILES = ["package.json", "pyproject.toml", "backend/core/version.py", "uv.lock", "CHANGELOG.md",]-SIGNING_SECRETS = ("ELECTRON_MACOS_CSC_LINK", "ELECTRON_WINDOWS_CSC_LINK", "APPLE_ID")+# Repo secrets electron-release.yml needs to sign each platform's installers.+SIGNING_SECRETS = {+ "macOS": (+ "ELECTRON_MACOS_CSC_LINK", "ELECTRON_MACOS_CSC_KEY_PASSWORD",+ "APPLE_ID", "APPLE_APP_SPECIFIC_PASSWORD", "APPLE_TEAM_ID",+ ),+ "Windows": ("ELECTRON_WINDOWS_CSC_LINK", "ELECTRON_WINDOWS_CSC_KEY_PASSWORD"),+}_VERSION = re.compile(r"(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?")@@ -218,22 +225,59 @@ def ensure_main() -> None:sh("git", "merge", "--ff-only", "origin/main")-def missing_signing_secrets() -> list[str]:+def unsigned_platforms() -> tuple[list[str], bool]:+ """Platforms whose signing secrets are missing, and whether the list is a guess.++ A guess (gh could not list secrets) treats every platform as unsigned so the+ owner is asked rather than assuming installers will be signed.+ """result = subprocess.run(["gh", "secret", "list", "--json", "name", "--jq", ".[].name"],cwd=ROOT, capture_output=True, text=True,)if result.returncode:- return list(SIGNING_SECRETS) # cannot tell; ask rather than assume signed+ return list(SIGNING_SECRETS), Truepresent = set(result.stdout.split())- return [name for name in SIGNING_SECRETS if name not in present]+ missing = [+ platform for platform, names in SIGNING_SECRETS.items()+ if not all(name in present for name in names)+ ]+ return missing, False+++def ask_allow_unsigned() -> list[str]:+ """Report signing per platform; return the platforms that would ship unsigned.++ Raises SystemExit when the owner declines. An empty list means everything is+ signed and no question is asked.+ """+ gaps, guessed = unsigned_platforms()+ if not gaps:+ print("Signing: macOS and Windows secrets are configured.")+ return []+ for platform in SIGNING_SECRETS:+ state = (+ "? could not read repo secrets" if guessed+ else "NO signing secrets (installers ship unsigned)" if platform in gaps+ else "signed"+ )+ print(f" {platform:8} {state}")+ print(" (v0.5.6 also shipped unsigned installers; users see SmartScreen/Gatekeeper warnings.)")+ answer = select_option(+ f"Publish with unsigned {' and '.join(gaps)} installers?",+ [("no", "cancel; add the secrets (docs/RELEASING.md → Credentials) or pick draft"),+ ("yes", "publish anyway; the release notes disclose it")],+ )+ if answer != "yes":+ raise SystemExit("Cancelled: configure signing, or choose draft.")+ return gaps-def dispatch_publish(tag: str, allow_unsigned: bool) -> None:+def dispatch_publish(tag: str, allow_unsigned: bool | list) -> None:sh("gh", "workflow", "run", "electron-release.yml", "--ref", "main","-f", f"release_tag={tag}", "-f", "publish=true",- "-f", f"allow_unsigned={str(allow_unsigned).lower()}",+ "-f", f"allow_unsigned={str(bool(allow_unsigned)).lower()}",)@@ -241,13 +285,9 @@ def publish_existing(tag: str) -> None:channel = channel_for(tag.removeprefix("v"))if subprocess.run(["gh", "auth", "status"], cwd=ROOT, capture_output=True).returncode:raise SystemExit("gh is not authenticated (run: gh auth login)")- unsigned = False- if missing_signing_secrets():- unsigned = select_option(- "Signing secrets missing or unreadable. Ship UNSIGNED installers?",- [("no", "cancel"), ("yes", "trust warnings, macOS updates unverified")],- ) == "yes"- print(f"\nPublish {tag} ({channel}) from its existing build{' (unsigned)' if unsigned else ''}.")+ unsigned = ask_allow_unsigned()+ print(f"\nPublish {tag} ({channel}) from its existing build"+ f"{' (UNSIGNED: ' + ', '.join(unsigned) + ')' if unsigned else ''}.")if input(f"Type {tag} to confirm: ").strip() != tag:raise SystemExit("Cancelled.")dispatch_publish(tag, unsigned)@@ -282,15 +322,7 @@ def release(args: argparse.Namespace) -> None:[("draft", "build only, nothing public; publish later"),("publish", "build and publish now")],)- unsigned = False- if mode == "publish" and missing_signing_secrets():- print("Signing secrets are missing or unreadable (Mac/Windows signing).")- unsigned = select_option(- "Ship UNSIGNED installers?",- [("no", "cancel; configure signing or choose draft"), ("yes", "trust warnings, macOS updates unverified")],- ) == "yes"- if not unsigned:- raise SystemExit("Cancelled: configure signing, or choose draft.")+ unsigned = ask_allow_unsigned() if mode == "publish" else []switch = (f"switch from {branch} to main, " if branch != "main" else ""@@ -299,7 +331,7 @@ def release(args: argparse.Namespace) -> None:Release planchannel {channel} ({'GitHub prerelease, never latest; :beta Docker' if channel == 'beta' else 'GitHub latest; :stable Docker'})new tag {tag} (last release {last})- mode {mode}{' (UNSIGNED installers)' if unsigned else ''}+ mode {mode}{' (UNSIGNED: ' + ', '.join(unsigned) + ')' if unsigned else ''}steps {switch}set package.json + pyproject.toml + backend/core/version.py to {version},uv lock, CHANGELOG section, run version guards,commit "chore(release): {tag}", push main, tag {tag}, push tag{', publish' if mode == 'publish' else ' (draft; publish later with --publish)'}""")diff --git a/tests/test_release_script.py b/tests/test_release_script.pyindex 1901a140a..3a74389ce 100644--- a/tests/test_release_script.py+++ b/tests/test_release_script.py@@ -114,7 +114,7 @@ def test_generated_changelog_passes_the_release_notes_extraction(release, versioassert section and section[1].strip()-def _drive(release, monkeypatch, answers, *, dry_run, secrets_missing=(), branch="main", fail_on=None, calls=None):+def _drive(release, monkeypatch, answers, *, dry_run, secrets_missing=(), branch="main", fail_on=None, calls=None, guessed=False):"""Run release() with scripted prompts and every side effect recorded, not run."""import argparse@@ -140,7 +140,7 @@ def _drive(release, monkeypatch, answers, *, dry_run, secrets_missing=(), branchmonkeypatch.setattr("builtins.input", lambda prompt="": next(feed))monkeypatch.setattr(release, "check_ready", lambda tag=None: None)monkeypatch.setattr(release, "ensure_main", lambda: calls.append(("ensure_main",)))- monkeypatch.setattr(release, "missing_signing_secrets", lambda: list(secrets_missing))+ monkeypatch.setattr(release, "unsigned_platforms", lambda: (list(secrets_missing), guessed))monkeypatch.setattr(release, "sh", fake_sh)monkeypatch.setattr(release, "bump_files", lambda *a: calls.append(("bump", *a[1:])))monkeypatch.setattr(release, "dispatch_publish", lambda *a: calls.append(("dispatch", *a)))@@ -186,10 +186,10 @@ def test_publish_without_signing_is_refused_unless_unsigned_is_accepted(release,tag = "v0.5.7"with pytest.raises(SystemExit, match="configure signing"):_drive(release, monkeypatch, ["stable", "", "publish", "no"], dry_run=False,- secrets_missing=["APPLE_ID"])+ secrets_missing=["Windows"])calls = _drive(release, monkeypatch, ["stable", "", "publish", "yes", tag], dry_run=False,- secrets_missing=["APPLE_ID"])- assert ("dispatch", tag, True) in calls+ secrets_missing=["Windows"])+ assert ("dispatch", tag, ["Windows"]) in callsdef _menu(release, monkeypatch, keys, default=0):@@ -280,3 +280,40 @@ def test_menu_reads_real_arrow_key_bytes_from_a_terminal():os.waitpid(pid, 0)text = re.sub(r"\x1b\[[0-9;?]*[A-Za-z]", "", output.decode(errors="replace"))assert re.findall(r"RESULT=(\w+)", text) == ["beta", "publish"], text+++def test_all_platforms_signed_asks_nothing_and_does_not_allow_unsigned(release, monkeypatch, capsys):+ tag = "v0.5.7"+ calls = _drive(release, monkeypatch, ["stable", "", "publish", tag], dry_run=False)+ assert ("dispatch", tag, []) in calls+ assert "macOS and Windows secrets are configured" in capsys.readouterr().out+++def test_missing_windows_signing_is_named_and_needs_an_explicit_yes(release, monkeypatch, capsys):+ tag = "v0.5.7-beta.1"+ calls = _drive(release, monkeypatch, ["beta", "", "publish", "yes", tag], dry_run=False,+ secrets_missing=["Windows"])+ out = capsys.readouterr().out+ assert "macOS signed" in out and "Windows NO signing secrets" in out+ assert "UNSIGNED: Windows" in out+ assert ("dispatch", tag, ["Windows"]) in calls+++def test_unreadable_secrets_are_reported_as_unknown_not_as_signed(release, monkeypatch, capsys):+ with pytest.raises(SystemExit, match="Cancelled"):+ _drive(release, monkeypatch, ["stable", "", "publish", "no"], dry_run=False,+ secrets_missing=["macOS", "Windows"], guessed=True)+ assert "could not read repo secrets" in capsys.readouterr().out+++def test_draft_never_asks_about_signing(release, monkeypatch):+ calls = _drive(release, monkeypatch, ["beta", "", "draft", "v0.5.7-beta.1"], dry_run=False,+ secrets_missing=["macOS", "Windows"])+ assert not any(c[0] == "dispatch" for c in calls)+++def test_secret_names_match_what_the_release_workflow_reads(release):+ workflow = (ROOT / ".github/workflows/electron-release.yml").read_text(encoding="utf-8")+ for names in release.SIGNING_SECRETS.values():+ for name in names:+ assert f"secrets.{name}" in workflow, f"{name} is not used by electron-release.yml"