release.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:release-script 作者: mitodl 项目源码 文件源码
def release(github_access_token, repo_url, new_version):
    """
    Run a release

    Args:
        github_access_token (str): The github access token
        repo_url (str): URL for a repo
        new_version (str): The version of the new release
    """

    validate_dependencies()

    with init_working_dir(github_access_token, repo_url):
        check_call(["git", "checkout", "-qb", "release-candidate"])
        old_version = update_version(new_version)
        if parse_version(old_version) >= parse_version(new_version):
            raise ReleaseException("old version is {old} but the new version {new} is not newer".format(
                old=old_version,
                new=new_version,
            ))
        verify_new_commits(old_version)
        update_release_notes(old_version, new_version)
        build_release()
        generate_release_pr(github_access_token, repo_url, old_version, new_version)

    print("version {old_version} has been updated to {new_version}".format(
        old_version=old_version,
        new_version=new_version,
    ))
    print("Go tell engineers to check their work. PR is on the repo.")
    print("After they are done, run the finish_release.py script.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号