utils/release.py/update_deploy_sh
def update_deploy_sh(version, commit):
    with open(DEPLOY_SH_FILE, "r", encoding="utf-8", newline="\n") as f:
        lines = f.readlines()

    index = len(lines) - 1
    while len(lines[index]) <= 1:
        index -= 1

    search = re.search(r'^deploy_doc\s+"(\S+)"\s+#\s+(v\S+)\s+', lines[index])
    old_commit, old_version = search.groups()
    lines[
        index
    ] = f'deploy_doc "{old_commit}" {old_version}\ndeploy_doc "{commit}"  # v{version} Latest stable release'

    with open(DEPLOY_SH_FILE, "w", encoding="utf-8", newline="\n") as f:
        f.writelines(lines)