public async Task <bool> PushMetadataAsync() { try { Log.LogMessage("Starting build metadata push to the Build Asset Registry..."); if (!File.Exists(ManifestZipFilePath)) { Log.LogError($"Required file '{ManifestZipFilePath}' does not exist."); } else { string tmpManifestsPath = null; try { tmpManifestsPath = $"{Path.GetTempPath()}\asset-manifests"; if (!Directory.Exists(tmpManifestsPath)) { Directory.Delete(tmpManifestsPath, true); } Directory.CreateDirectory(tmpManifestsPath); ZipFile.ExtractToDirectory(ManifestZipFilePath, tmpManifestsPath); List <BuildData> buildsManifestMetadata = GetBuildManifestsMetadata(tmpManifestsPath); BuildData finalBuild = MergeBuildManifests(buildsManifestMetadata); MaestroApi client = (MaestroApi)ApiFactory.GetAuthenticated(MaestroApiEndpoint, BuildAssetRegistryToken); Builds buildAssetRegistryBuilds = new Builds(client); Client.Models.Build recordedBuild = await buildAssetRegistryBuilds.CreateAsync(finalBuild, s_cancellationToken); Log.LogMessage($"Metadata has been pushed. Build id in the Build Asset Registry is '{recordedBuild.Id}'"); } finally { if (tmpManifestsPath != null) { Directory.Delete(tmpManifestsPath, true); } } } } catch (Exception exc) { Log.LogErrorFromException(exc, true); } return(!Log.HasLoggedErrors); }