diff --git a/client/build_tools/release_manifest.py b/client/build_tools/release_manifest.py index 9acf557..d15a64a 100644 --- a/client/build_tools/release_manifest.py +++ b/client/build_tools/release_manifest.py @@ -17,7 +17,7 @@ _VERSION_PATTERN = re.compile( def versioned_manifest_file_name(version: str) -> str: - """返回版本化清单文件名,例如 ``autobuy_manifest_0.2.2.json``。""" + """返回版本化清单文件名,例如 ``autobuy_manifest_0.1.0.json``。""" normalized = version.strip() if _VERSION_PATTERN.fullmatch(normalized) is None: diff --git a/client/packaging/build.ps1 b/client/packaging/build.ps1 index d0c6cfc..952ff5e 100644 --- a/client/packaging/build.ps1 +++ b/client/packaging/build.ps1 @@ -181,7 +181,7 @@ VSVersionInfo( $manifestPath = Join-Path $releaseRoot "autobuy_manifest.json" Invoke-Checked -FailureMessage "Failed to generate the release manifest" -Command { & $buildPython (Join-Path $clientRoot "build_tools\release_manifest.py") ` - --version $version --update $updateZip --portable $portableZip ` + --version $version --update $updateZip --portable $portableLatestZip ` --output $manifestPath } $versionedManifestPath = Join-Path $releaseRoot "autobuy_manifest_$version.json" diff --git a/client/src/version.py b/client/src/version.py index 73455c3..01d6abb 100644 --- a/client/src/version.py +++ b/client/src/version.py @@ -3,4 +3,4 @@ 发布脚本和程序界面需要版本号时都从这里读取,避免多个文件各写一份。 """ -__version__ = "0.2.2" +__version__ = "0.1.0" diff --git a/client/test/test_packaging.py b/client/test/test_packaging.py index 062125b..e40a434 100644 --- a/client/test/test_packaging.py +++ b/client/test/test_packaging.py @@ -145,7 +145,7 @@ class ReleaseManifestTest(unittest.TestCase): with tempfile.TemporaryDirectory() as directory: root = Path(directory) update_zip = root / "CMAutoBuy_0.1.0.zip" - portable_zip = root / "自动采集采购工具_0.1.0.zip" + portable_zip = root / "自动采集采购工具.zip" update_zip.write_bytes(b"update") portable_zip.write_bytes(b"portable") output = root / MANIFEST_FILE_NAME @@ -160,6 +160,7 @@ class ReleaseManifestTest(unittest.TestCase): manifest["update"]["sha256"], hashlib.sha256(b"update").hexdigest(), ) + self.assertEqual(manifest["update"]["file"], "CMAutoBuy_0.1.0.zip") self.assertEqual(manifest["portable"]["file"], portable_zip.name) def test_versioned_manifest_name_is_stable_and_validated(self): diff --git a/client/test/test_update_service.py b/client/test/test_update_service.py index 9d4cf18..ff4d8b5 100644 --- a/client/test/test_update_service.py +++ b/client/test/test_update_service.py @@ -258,7 +258,7 @@ class UpdateServiceTest(unittest.TestCase): health = json.loads( (self.update_directory / "healthy.json").read_text(encoding="utf-8") ) - self.assertEqual(health["version"], "0.2.2") + self.assertEqual(health["version"], "0.1.0") if __name__ == "__main__": diff --git a/client/test/test_update_ui_event.py b/client/test/test_update_ui_event.py index 658c7f2..6809ce1 100644 --- a/client/test/test_update_ui_event.py +++ b/client/test/test_update_ui_event.py @@ -47,7 +47,7 @@ class FakeCredentialStore: class FakeUpdateService: def __init__(self, result=None, delay=0.0, download_error=None): - self.result = result or UpdateCheckResult("0.2.2", "0.2.2", False) + self.result = result or UpdateCheckResult("0.1.0", "0.1.0", False) self.delay = delay self.download_error = download_error self.check_count = 0 @@ -58,7 +58,7 @@ class FakeUpdateService: def check( self, manifest_url, - current_version="0.2.2", + current_version="0.1.0", is_cancelled=None, credentials=None, ): @@ -142,7 +142,7 @@ class UpdateUiEventTest(unittest.TestCase): def test_update_card_uses_safe_defaults_and_password_input(self): page = self._page(FakeUpdateService()) - self.assertEqual(page.currentVersionLabel.text(), "0.2.2") + self.assertEqual(page.currentVersionLabel.text(), "0.1.0") self.assertEqual( page.updateManifestUrlInput.text(), DEFAULT_UPDATE_MANIFEST_URL ) @@ -313,7 +313,7 @@ class UpdateUiEventTest(unittest.TestCase): sha256="0" * 64, ) service = FakeUpdateService( - UpdateCheckResult("0.2.2", "0.3.0", True, update) + UpdateCheckResult("0.1.0", "0.3.0", True, update) ) page = self._page(service) self._save_configuration(page) diff --git a/docs/client/01-requirements.md b/docs/client/01-requirements.md index 4dbdbdd..01ca618 100644 --- a/docs/client/01-requirements.md +++ b/docs/client/01-requirements.md @@ -218,8 +218,9 @@ CMAutoBuy/ 整个文件夹拷到任何机器都能用 - `autobuy_manifest.json`:Client 固定读取的在线更新清单; - `autobuy_manifest_<版本号>.json`:与固定清单内容完全相同的归档副本。 -清单中的更新包和便携包都引用带版本号的文件名,并记录版本、字节大小和 SHA256; -SHA256 用于发现下载损坏,不等同于发布者身份认证。 +清单中的更新包引用带版本号的文件名,便携包固定引用 +`自动采集采购工具.zip`,并记录版本、字节大小和 SHA256;SHA256 用于发现下载 +损坏,不等同于发布者身份认证。 **在线更新:**设置页默认显示已确认的发布清单地址和账号,密码由操作人员首次 填写并保存到 Windows 凭据管理器;URL 和账号作为非敏感设置保存在 SQLite,密码