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