Repository navigation
ci: 预装 SDK 不匹配时下载并校验 Android 36 r2 - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
预装 android-36 被运行机更新或移除时,CI 和发版核对原来会直接失败。两个 workflow 现在先核对预装 android.jar;缺失或 SHA-256 不符时,从 Google 下载固定的 Android 36 r2,依次校验压缩包和解压后的 android.jar,再用原有 build-tools 36.1.0 和构建参数编译。finally 清理临时目录,构建进程的非零退出码也会终止流程。
Refs ModAVD/ModAVD#83。宿主输入法及这两个 workflow 已在本仓库,ModAVD 主仓库没有对应文件。
Google 官方依据:
2c1a80dd4d9f7d0e6dd336ec603d9b5c55a6f576。37607369a28c5b640b3a7998868d45898ebcb777565a0e85f9acf36f29631d2e,固定在两个 workflow。XML 只公布 SHA-1,没有 SHA-256;此处没有把计算值冒称为 Google 公布值。d9eb9da824d9e247a352f570f01e1169e725b2954bca9e283a71786c59b59f9a。备用逻辑留在 workflow 内,使 verify-release 检出旧 tag(如 v1.0.0)时也能运行,不要求旧 tag 包含新增脚本。新增测试提取并执行 workflow 代码,要求两份代码一致;只替换测试 ZIP/jar 的哈希并拦截网络和构建调用,实际执行文件校验、解压、分支和清理。中英文 README 补充了不依赖 Actions 的获取和双重校验步骤。
本地验证:
pwsh -NoProfile -File scripts/test_android_sdk_fallback.ps1:9/9,通过正确预装、预装缺失、预装错误、下载哈希错误、解压后 jar 错误、解压后缺失 jar、下载失败、解压失败、构建失败。错误内容无法进入构建,坏压缩包无法进入解压,临时目录均清理。ebff38996f8fc448f785d69e7fb65aad1c9c832fe76940d2fc5bc9cdc866a6c5,测试 APK 为9c2552a69fb980b69711445cd6b592244caee01338be4dcebbfff9359362daed。v1.0.0 一致性:
912c9c9724e63fa606fa5d4e4212cef0e24148b013923ba49d1ebf8cfd38e0e2。GitHub Actions:
8ec0ec03e8b3247f47bc6fdafe7faaef1539e319。912c9c9724e63fa606fa5d4e4212cef0e24148b013923ba49d1ebf8cfd38e0e2。临时验证步骤只在verify/83-force-sdk-download分支,没有进入本 PR。action_required,需要维护者批准外部贡献者运行;未将其标为通过。