Example #1
0
        protected override async Task RunDistribute(IEnumerable <BuildPath> buildPaths, TaskToken task)
        {
            if (string.IsNullOrEmpty(curlPath))
            {
                throw new Exception("UploadDistro: Path to curl not set.");
            }

            if (!File.Exists(curlPath))
            {
                throw new Exception("UploadDistro: curl not found at path: " + curlPath);
            }

            if (string.IsNullOrEmpty(uploadUrl))
            {
                throw new Exception("UploadDistro: No upload URL set.");
            }

            if (!string.IsNullOrEmpty(login.User) && login.GetPassword(keychainService) == null)
            {
                throw new Exception("UploadDistro: No password set for user: "******"Archiving builds");

            IEnumerable <BuildPath> zipPaths;
            var child = task.StartChild("Zip Builds");

            try {
                zipPaths = await ZipBuilds(buildPaths, child);
            } finally {
                child.Remove();
            }

            task.Report(1, description: "Uploading builds");

            child = task.StartChild("Upload Builds");
            try {
                foreach (var path in zipPaths)
                {
                    await Upload(path, child);
                }
            } finally {
                child.Remove();
            }
        }
Example #2
0
 /// <summary>
 /// Notarize a macOS build.
 /// </summary>
 /// <remarks>
 /// This method will silently ignore non-macOS builds.
 /// </remarks>
 /// <param name="buildPath">Build path</param>
 public async Task NotarizeIfMac(BuildPath buildPath, TaskToken task)
 {
     if (buildPath.target == BuildTarget.StandaloneOSX)
     {
         var child = task.StartChild("Notarize macOS Build");
         try {
             await Notarize(buildPath, child);
         } finally {
             child.Remove();
         }
     }
 }
Example #3
0
        void TaskDistribute(Job job)
        {
            token.Report(jobIndex, description: $"Running {job.distro.name}");

            var distroToken = token;

            if (jobs.Length > 1)
            {
                distroToken = token.StartChild(job.distro.name);
            }

            var source = new CancellationTokenSource();

            distroToken.cancellation = source.Token;
            Progress.RegisterCancelCallback(distroToken.taskId, () => {
                source.Cancel();
                return(true);
            });

            job.distro.DistributeWithoutBuilding(distroToken)
            .ContinueWith(t => {
                try {
                    if (jobs.Length > 1)
                    {
                        distroToken.Remove();
                    }

                    if (t.IsFaulted)
                    {
                        Debug.LogException(t.Exception);
                        Complete(false);
                    }
                    else
                    {
                        ContinueWith(ContinueTask.NextJob);
                    }
                } catch (Exception e) {
                    Debug.LogException(e);
                }
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }