Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ime/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.modavd.ime"
android:versionCode="1"
android:versionName="1.0">
android:versionCode="4401"
android:versionName="0.44.1">

<!-- 编译用 android-36 的 android.jar,但只用 API 34 及以下的接口;不申请任何权限 -->
<uses-sdk android:minSdkVersion="30" android:targetSdkVersion="34" />
Expand Down
1 change: 1 addition & 0 deletions release/0.44.1.SHA256SUMS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
010bb4fba90cd7845d200df72261d98180041ce3931e633076a30ffaad4bc056 modavd-ime.apk
11 changes: 11 additions & 0 deletions release/0.44.1.md
Original file line number Diff line number Diff line change
@@ -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` |
18 changes: 14 additions & 4 deletions scripts/repo_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]


Expand All @@ -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
Expand Down
28 changes: 28 additions & 0 deletions scripts/test_repo_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()