From 421b2e7a843a63abe532d414035d0038e55174cf Mon Sep 17 00:00:00 2001 From: ZhuoZhou Date: Wed, 25 Jun 2025 14:31:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=B0=E5=BD=95git=20hash?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tools/build_package/build_package.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/FindObjectBundleBuilder/Tools/build_package/build_package.py b/FindObjectBundleBuilder/Tools/build_package/build_package.py index 66a3db2..a7809df 100644 --- a/FindObjectBundleBuilder/Tools/build_package/build_package.py +++ b/FindObjectBundleBuilder/Tools/build_package/build_package.py @@ -158,6 +158,21 @@ def generateLevelIdListByGitLog(): print(f'资源修改列表:{str(_levelModifiedIdList_)}') config.notification_helper.append_msg(f"构建资源列表: {str(_levelModifiedIdList_)}") +def update_new_git_hash(): + if opts.old_hash != '' and opts.new_hash != '': + current_commit_hash = opts.old_hash + new_commit_hash = opts.new_hash + else: + current_commit_hash = getCurrentGitHash() + new_commit_hash = getNewGitHash() + if new_commit_hash != '' and new_commit_hash != current_commit_hash: + writeGitCommitLog(new_commit_hash) + recordNewGitHash(new_commit_hash) + config.notification_helper.append_msg( + f"[step] update git hash success, old hash:{current_commit_hash}, new hash:{new_commit_hash}") + else: + config.notification_helper.append_msg("[Error] current_commit_hash is empty") + def build_package(opts, modify_files): """ 打资源包 @@ -425,6 +440,7 @@ if __name__ == '__main__': tmBuildPackage2 = time.time() print(f"{len(modify_files)}个资源, unity打包耗时:{tmBuildPackage2 - tmBuildPackage1}") if is_build_success and is_upload: + update_new_git_hash() print(f"开始上传ab包到firebase") storage_path = "Bundles/{}".format(opts.platform) # 上传ab包到firebase