Example #1
0
            protected override Task PublishOnePackageAsync(ArtifactPush p)
            {
                var tags    = p.Version.PackageQuality.GetLabels().Select(l => l.ToString().ToLowerInvariant()).ToList();
                var project = (NPMPublishedProject)p.LocalArtifact;

                using (TokenInjector(project))
                {
                    var absTgzPath = Path.GetFullPath(ArtifactType.GlobalInfo.ReleasesFolder.AppendPart(project.TGZName));
                    Cake.NpmPublish(
                        new NpmPublishSettings()
                    {
                        Source           = absTgzPath,
                        WorkingDirectory = project.DirectoryPath.Path,
                        Tag = tags.First()
                    });
                    foreach (string tag in tags.Skip(1))
                    {
                        Cake.Information($"Setting tag '{tag}' on '{project.Name}' to '{project.ArtifactInstance.Version.ToNormalizedString()}' version.");
                        // The FromPath is actually required - if executed outside the relevant directory,
                        // it will miss the .npmrc with registry configs.
                        Cake.NpmDistTagAdd(project.Name, project.ArtifactInstance.Version.ToNormalizedString(), tag, s => s.FromPath(project.DirectoryPath.Path));
                    }
                }
                return(System.Threading.Tasks.Task.CompletedTask);
            }
Example #2
0
            protected override Task PublishOnePackageAsync(ArtifactPush p)
            {
                if (p.Feed != this)
                {
                    throw new ArgumentException("ArtifactPush: feed mismatch.");
                }
                var project = (NPMPublishedProject)p.LocalArtifact;
                var target  = _pathToLocalFeed.AppendPart(project.TGZName);
                var source  = ArtifactType.GlobalInfo.ReleasesFolder.AppendPart(project.TGZName);

                Cake.CopyFile(source.Path, target.Path);
                return(System.Threading.Tasks.Task.CompletedTask);
            }
Example #3
0
 protected abstract Task PublishOnePackageAsync(ArtifactPush push);