def export_artifacts()

in src/build_workflow/builder_from_dist.py [0:0]


    def export_artifacts(self, build_recorder: 'BuildRecorder') -> None:
        os.makedirs(self.output_path, exist_ok=True)
        component_manifest = self.build_manifest.components[self.component.name]
        logging.info(f"Downloading {component_manifest.name} {component_manifest.version} ({component_manifest.commit_id}) ...")
        logging.info(f"Distribution was built from {component_manifest.repository}#{component_manifest.ref}")
        build_recorder.record_component(self.component.name, BuilderFromDist.ManifestGitRepository(component_manifest))
        for artifact_type in component_manifest.artifacts:
            artifact_path = os.path.join(self.output_path, artifact_type)
            logging.info(f"Downloading into {artifact_path} ...")
            if artifact_type not in ["maven"]:  # avoid re-publishing maven artifacts, see https://github.com/opensearch-project/opensearch-build/issues/1279
                for artifact in component_manifest.artifacts[artifact_type]:
                    artifact_url = f"{self.distribution_url}/{artifact}"
                    artifact_dest = os.path.realpath(os.path.join(self.output_path, artifact))
                    os.makedirs(os.path.dirname(artifact_dest), exist_ok=True)
                    logging.info(f"Downloading {artifact_url} into {artifact_dest}")
                    urllib.request.urlretrieve(artifact_url, artifact_dest)
                    build_recorder.record_artifact(self.component.name, artifact_type, artifact, artifact_dest)