Skip to content

VoiceStudio is the open-source, fully-local ElevenLabs alternative — voice cloning, voice design, video dubbing, dictation, transcription & audiobook creation in 646 languages.

fix(release): load the signing-notes helper from the workflow commit so older tags rebuild

velixio72abdb4c03de
diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.yml
index 32185fbb4..f0e38bb69 100644
--- a/.github/workflows/electron-release.yml
+++ b/.github/workflows/electron-release.yml
@@ -328,7 +328,13 @@ jobs:
merge-multiple: true
path: release-signing
- name: Describe installer signing per platform
- run: python3 scripts/release_signing_notes.py release-signing >> release-assets/RELEASE_NOTES.md
+ # The checkout is the release tag, which predates this helper when an older
+ # tag is rebuilt from main; use the helper from the workflow's own commit.
+ run: |
+ gh api -H "Accept: application/vnd.github.raw" \
+ "repos/$GITHUB_REPOSITORY/contents/scripts/release_signing_notes.py?ref=$GITHUB_SHA" \
+ > "$RUNNER_TEMP/release_signing_notes.py"
+ python3 "$RUNNER_TEMP/release_signing_notes.py" release-signing >> release-assets/RELEASE_NOTES.md
- name: Create or update draft
run: |
# A beta is always a prerelease so GitHub never makes it `latest`.
diff --git a/tests/test_release_signing_notes.py b/tests/test_release_signing_notes.py
index 663035893..1c4291c56 100644
--- a/tests/test_release_signing_notes.py
+++ b/tests/test_release_signing_notes.py
@@ -69,5 +69,28 @@ def test_release_notes_are_built_from_the_reports():
steps = load_workflow()["jobs"]["release"]["steps"]
describe = next(step for step in steps if step.get("name") == "Describe installer signing per platform")
assert "if" not in describe
- assert describe["run"] == "python3 scripts/release_signing_notes.py release-signing >> release-assets/RELEASE_NOTES.md"
assert not any("Electron installer trust" in step.get("run", "") for step in steps)
+
+
+def test_release_notes_helper_comes_from_the_workflow_commit(tmp_path):
+ # Rebuilding an older tag from main checks out a tag without the helper (#3241 review).
+ import os
+ import subprocess
+ steps = load_workflow()["jobs"]["release"]["steps"]
+ describe = next(step for step in steps if step.get("name") == "Describe installer signing per platform")
+ assert "python3 scripts/" not in describe["run"]
+ fake = tmp_path / "bin"
+ fake.mkdir()
+ (fake / "gh").write_text(
+ '#!/bin/sh\ncase "$*" in *"contents/scripts/release_signing_notes.py?ref=workflow-sha"*) '
+ f'cat "{ROOT / "scripts/release_signing_notes.py"}";; *) exit 1;; esac\n'
+ )
+ (fake / "gh").chmod(0o755)
+ work = tmp_path / "tag-checkout"
+ (work / "release-signing").mkdir(parents=True)
+ (work / "release-assets").mkdir()
+ write(work / "release-signing", "linux", "x64", "not-applicable")
+ env = dict(os.environ, PATH=f"{fake}{os.pathsep}{os.environ['PATH']}", GITHUB_SHA="workflow-sha",
+ GITHUB_REPOSITORY="debpalash/VoiceStudio", RUNNER_TEMP=str(tmp_path))
+ subprocess.run(["bash", "-e", "-c", describe["run"]], cwd=work, env=env, check=True)
+ assert "| Linux x64 |" in (work / "release-assets/RELEASE_NOTES.md").read_text()