Esempio n. 1
0
def set_product_data(_: Dict[str, str]):
    """Set new product uuid on installers and product uuid database """
    pyrevit_pc = _installer_set_uuid(configs.PYREVIT_INSTALLER_FILES)
    pyrevitcli_pc = _installer_set_uuid(configs.PYREVIT_CLI_INSTALLER_FILES)
    release_ver = props.get_version()
    _update_product_data_file(release_ver, pyrevit_pc)
    _update_product_data_file(release_ver, pyrevitcli_pc, cli=True)
Esempio n. 2
0
def sign_installers(_: Dict[str, str]):
    """Sign installers with certificate (must be installed on machine)"""
    print("digitally signing installers...")
    build_version = props.get_version()
    for installer_exe_fmt in configs.INSTALLER_EXES:
        installer_exe = installer_exe_fmt.format(version=build_version)
        utils.system([
            "signtool",
            "sign",
            "/n",
            "Ehsan Iran Nejad",
            "/t",
            "http://timestamp.digicert.com",
            "/fd",
            "sha256",
            f"{installer_exe}",
        ])
Esempio n. 3
0
def generate_release_notes(args: Dict[str, str]):
    """Generate release notes from given <tag> to HEAD
    Queries github issue information for better reporting
    """
    # print downloads section
    build_version = props.get_version()

    build_version_urlsafe = build_version.replace("+", "%2B")
    base_url = ("https://github.com/eirannejad/pyRevit/"
                f"releases/download/v{build_version_urlsafe}/")

    # add easy download links
    print("# Downloads")
    pyrevit_installer = (
        configs.PYREVIT_INSTALLER_NAME.format(version=build_version) + ".exe")
    print("- [pyRevit {version} Installer]({url})".format(
        version=build_version, url=base_url + pyrevit_installer))

    pyrevit_admin_installer = (
        configs.PYREVIT_ADMIN_INSTALLER_NAME.format(version=build_version) +
        ".exe")
    print("- [pyRevit {version} Installer - "
          "Admin / All Users / %PROGRAMDATA%]({url})".format(
              version=build_version, url=base_url + pyrevit_admin_installer))

    pyrevit_cli_installer = (
        configs.PYREVIT_CLI_INSTALLER_NAME.format(version=build_version) +
        ".exe")
    print("- [pyRevit CLI {version} Installer]({url})".format(
        version=build_version, url=base_url + pyrevit_cli_installer))

    pyrevit_cli_admin_installer = (
        configs.PYREVIT_CLI_ADMIN_INSTALLER_NAME.format(version=build_version)
        + ".exe")
    print("- [pyRevit CLI {version} Installer - "
          "Admin / All Users / %PROGRAMDATA%]({url})".format(
              version=build_version,
              url=base_url + pyrevit_cli_admin_installer))

    # output change log
    report_changelog(args)
Esempio n. 4
0
            args=["[<tag>]"],
            run=clog.report_changelog),
    Command(name="report",
            target="releasenotes",
            args=[],
            run=clog.generate_release_notes),
    # misc
    Command(name="add", target="host", args=[], run=hostdata.add_hostdata),
    Command(name="open", target="docs", args=[], run=apidocspy.open_docs),
    Command(name="help", target="", args=[], run=print_help),
]

if __name__ == "__main__":
    if "--debug" in sys.argv:
        logger.setLevel(logging.DEBUG)
        sys.argv.remove("--debug")

    try:
        # process args
        args = docopt(
            doc=prepare_docopt_help(),
            version="{} {}".format(__binname__, props.get_version()),
            help=False,
        )
        # run the appropriate command
        utils.run_command(COMMANDS, args)
    # gracefully handle exceptions and print results
    except Exception as run_ex:
        logger.error("%s", str(run_ex))
        sys.exit(1)
Esempio n. 5
0
def _tag_changes():
    build_version = props.get_version()
    utils.system(["git", "tag", f"v{build_version}"])
    utils.system(["git", "tag", f"cli-v{build_version}"])