def format_target(os_name, arch):
    """
    Formats target name for provided OS name and CPU architecture.
    """
    os_name = os_name.lower().replace("win32", "windows").replace("darwin", "macos")
    extension = ".exe" if os_name == "windows" else ""

    assert os_name in ["linux", "windows", "macos"]

    return {
        "amd64": f"{os_name}-x64{extension}",
        "x86_64": f"{os_name}-x64{extension}",
        "arm64": f"{os_name}-arm64",
        "aarch64": f"{os_name}-arm64",
    }[arch.lower()]