diff --git a/ime/AndroidManifest.xml b/ime/AndroidManifest.xml index 2c79b46..0206e31 100644 --- a/ime/AndroidManifest.xml +++ b/ime/AndroidManifest.xml @@ -5,8 +5,8 @@ --> + android:versionCode="4401" + android:versionName="0.44.1"> diff --git a/release/0.44.1.SHA256SUMS.txt b/release/0.44.1.SHA256SUMS.txt new file mode 100644 index 0000000..f0c50a4 --- /dev/null +++ b/release/0.44.1.SHA256SUMS.txt @@ -0,0 +1 @@ +010bb4fba90cd7845d200df72261d98180041ce3931e633076a30ffaad4bc056 modavd-ime.apk diff --git a/release/0.44.1.md b/release/0.44.1.md new file mode 100644 index 0000000..79a6f8f --- /dev/null +++ b/release/0.44.1.md @@ -0,0 +1,11 @@ +# ModAVDHostIME v0.44.1 + +ModAVDHostIME(宿主输入法)0.44.1,随 [ModAVD 0.44.1](https://github.com/ModAVD/ModAVD/releases/tag/v0.44.1) 发布。这一版改了什么,见 ModAVD 的发布说明。 + +ModAVDHostIME (host input method) 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 | +| --- | --- | +| `modavd-ime.apk` | `010bb4fba90cd7845d200df72261d98180041ce3931e633076a30ffaad4bc056` | 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()