diff --git a/CMakeLists.txt b/CMakeLists.txt index 864a08b..2779e06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) # macOS: the oldest release the library loads on. Without it the build machine's SDK version is used. set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum macOS version") -project(ModAVDExtras VERSION 0.3.1 LANGUAGES C) +project(ModAVDExtras VERSION 0.44.1 LANGUAGES C) set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD_REQUIRED ON) diff --git a/release/0.44.1.SHA256SUMS.txt b/release/0.44.1.SHA256SUMS.txt new file mode 100644 index 0000000..68e455f --- /dev/null +++ b/release/0.44.1.SHA256SUMS.txt @@ -0,0 +1,4 @@ +d825dcc466d38cfe62e542776f7a582e90ec330c3e55c2125a842d4669ee237c external_renderer_ipc.dll +25612887f54bf8b5a455f80d9e57d92373bcc9951f45fe60eb18ddc698122140 libmodavd_extras.dylib +d3b325633ec402fb69659d58f961da376c88b4627f1d0ee3526bbcc7b3f1f8df libmodavd_extras.so +cd7dc02b4f046d8912d2ae24a252e4bcbdb9a60d5d343c49afdc1fe91a31f5ca modavd_extras.dll diff --git a/release/0.44.1.md b/release/0.44.1.md new file mode 100644 index 0000000..536b3ae --- /dev/null +++ b/release/0.44.1.md @@ -0,0 +1,14 @@ +# ModAVDExtras v0.44.1 + +ModAVDExtras(截图库)0.44.1,随 [ModAVD 0.44.1](https://github.com/ModAVD/ModAVD/releases/tag/v0.44.1) 发布。这一版改了什么,见 ModAVD 的发布说明。 + +ModAVDExtras (capture library) 0.44.1 ships with [ModAVD 0.44.1](https://github.com/ModAVD/ModAVD/releases/tag/v0.44.1); the ModAVD release notes say what changed. + +## 核对 / Checksums + +| 文件 / File | SHA-256 | +| --- | --- | +| `external_renderer_ipc.dll` | `d825dcc466d38cfe62e542776f7a582e90ec330c3e55c2125a842d4669ee237c` | +| `libmodavd_extras.dylib` | `25612887f54bf8b5a455f80d9e57d92373bcc9951f45fe60eb18ddc698122140` | +| `libmodavd_extras.so` | `d3b325633ec402fb69659d58f961da376c88b4627f1d0ee3526bbcc7b3f1f8df` | +| `modavd_extras.dll` | `cd7dc02b4f046d8912d2ae24a252e4bcbdb9a60d5d343c49afdc1fe91a31f5ca` | diff --git a/scripts/repo_checks.py b/scripts/repo_checks.py index 6343dca..f342761 100644 --- a/scripts/repo_checks.py +++ b/scripts/repo_checks.py @@ -22,9 +22,19 @@ def allowed(name: str, email: str) -> bool: return bool(ALLOWED_AUTHOR.fullmatch(identity) or any(rx.fullmatch(email) for rx in ALLOWED_NOREPLY)) -def commits(base: str, head: str, cwd: str = ".") -> list[str]: - spec = f"{base}..{head}" - out = subprocess.check_output(["git", "rev-list", "--no-merges", spec], cwd=cwd, text=True, encoding="utf-8") +# Commits already on main are public and cannot change any more. A PR from main into a release branch carries +# them again, including the squash commits GitHub wrote with the contributor's account email, so they are skipped. +MAIN_REF = "refs/remotes/origin/main" + + +def published(cwd: str = ".") -> list[str]: + found = subprocess.run(["git", "rev-parse", "--verify", "-q", MAIN_REF], cwd=cwd, capture_output=True) + return [MAIN_REF] if found.returncode == 0 else [] + + +def commits(base: str, head: str, cwd: str = ".", exclude: list[str] | None = None) -> list[str]: + spec = [f"{base}..{head}"] + [f"^{ref}" for ref in exclude or []] + out = subprocess.check_output(["git", "rev-list", "--no-merges", *spec], cwd=cwd, text=True, encoding="utf-8") return [x for x in out.splitlines() if x] @@ -51,7 +61,7 @@ def main() -> int: if not base or not head: base, head = "origin/main", "HEAD" try: - ids = commits(base, head) + ids = commits(base, head, exclude=published()) except subprocess.CalledProcessError as exc: print(f"cannot inspect {base}..{head}: git exited {exc.returncode}") return 1 diff --git a/scripts/test_repo_checks.py b/scripts/test_repo_checks.py index 861ed9a..e5a87cd 100644 --- a/scripts/test_repo_checks.py +++ b/scripts/test_repo_checks.py @@ -49,6 +49,34 @@ def test_rejects_ai_trailer(self): commit = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=root, text=True).strip() self.assertTrue(repo_checks.check_commit(commit, str(root))) + def test_skips_commits_already_on_main(self): + # A PR from main into a release branch carries main's squash commits, whose author email is the + # contributor's account setting; only the release branch's own new commits are checked. + with tempfile.TemporaryDirectory() as td: + root = Path(td) + + def git(*args, **env): + return subprocess.check_output(["git", *args], cwd=root, text=True, + env=dict(os.environ, **env)).strip() + + git("init", "-q", "-b", "release") + git("config", "user.name", "qiyinxi") + git("config", "user.email", "qiyinxi@foxmail.com") + git("commit", "-q", "--allow-empty", "-m", "base") + base = git("rev-parse", "HEAD") + git("commit", "-q", "--allow-empty", "-m", "squash", GIT_AUTHOR_NAME="Someone", + GIT_AUTHOR_EMAIL="someone@example.com") + git("update-ref", repo_checks.MAIN_REF, "HEAD") + git("commit", "-q", "--allow-empty", "-m", "bump", GIT_AUTHOR_NAME="Other", + GIT_AUTHOR_EMAIL="other@example.com") + head = git("rev-parse", "HEAD") + self.assertEqual(len(repo_checks.commits(base, head, str(root))), 2) + ids = repo_checks.commits(base, head, str(root), repo_checks.published(str(root))) + self.assertEqual(ids, [head]) + self.assertTrue(repo_checks.check_commit(ids[0], str(root))) + git("update-ref", "-d", repo_checks.MAIN_REF) + self.assertEqual(repo_checks.published(str(root)), []) + if __name__ == "__main__": unittest.main()