tasks/libs/github_actions_tools.py
def download_artifacts(run_id, destination="."):
    """
    Download all artifacts for a given job in the specified location.
    """
    print(color_message(f"Downloading artifacts for run {run_id} to {destination}", "blue"))

    github_workflows = create_or_refresh_macos_build_github_workflows()
    run_artifacts = github_workflows.workflow_run_artifacts(run_id)
    if run_artifacts is None:
        print("Workflow run not found.")
        raise Exit(code=1)

    # Create temp directory to store the artifact zips
    with tempfile.TemporaryDirectory() as tmpdir:
        for artifact in run_artifacts["artifacts"]:
            # Download artifact
            github_workflows = create_or_refresh_macos_build_github_workflows(github_workflows)
            zip_path = github_workflows.download_artifact(artifact["id"], tmpdir)

            # Unzip it in the target destination
            with zipfile.ZipFile(zip_path, "r") as zip_ref:
                zip_ref.extractall(destination)

    Download all artifacts for a given job in the specified location.
    
Download all artifacts for a given job in the specified location.
Download all artifacts for a given job in the specified location .
def download_artifacts(run_id, destination="."):
    print(color_message(f"Downloading artifacts for run {run_id} to {destination}", "blue"))
    github_workflows = create_or_refresh_macos_build_github_workflows()
    run_artifacts = github_workflows.workflow_run_artifacts(run_id)
    if run_artifacts is None:
        print("Workflow run not found.")
        raise Exit(code=1)
    with tempfile.TemporaryDirectory() as tmpdir:
        for artifact in run_artifacts["artifacts"]:
            github_workflows = create_or_refresh_macos_build_github_workflows(github_workflows)
            zip_path = github_workflows.download_artifact(artifact["id"], tmpdir)
            with zipfile.ZipFile(zip_path, "r") as zip_ref:
                zip_ref.extractall(destination)
def download_artifacts ( run_id , destination = "." ) : print ( color_message ( f"Downloading artifacts for run {run_id} to {destination}" , "blue" ) ) github_workflows = create_or_refresh_macos_build_github_workflows ( ) run_artifacts = github_workflows . workflow_run_artifacts ( run_id ) if run_artifacts is None : print ( "Workflow run not found." ) raise Exit ( code = 1 ) with tempfile . TemporaryDirectory ( ) as tmpdir : for artifact in run_artifacts [ "artifacts" ] : github_workflows = create_or_refresh_macos_build_github_workflows ( github_workflows ) zip_path = github_workflows . download_artifact ( artifact [ "id" ] , tmpdir ) with zipfile . ZipFile ( zip_path , "r" ) as zip_ref : zip_ref . extractall ( destination )
Download all artifacts for a given job in the specified location.
Download all artifacts for a given job in the specified location .
"""
    Download all artifacts for a given job in the specified location.
    """ # Create temp directory to store the artifact zips # Download artifact # Unzip it in the target destination
run_id
destination