Skip to content

Commit

Permalink
Adjust nuke release script to fix tags publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed Jan 29, 2024
1 parent b53cf89 commit 6d2fee1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/BuildOnPipelines.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ partial class Build {

var nuget = NuGet.Protocol.Core.Types.Repository.Factory.GetCoreV3(Parameters.NugetFeedUrl);
foreach (var nugetArtifact in nugetArtifacts) {
var packageName = nugetArtifact.Name.Split(Parameters.Version)[0];
var packageName = nugetArtifact.Name.Split(Parameters.Version)[0].TrimEnd('.');
await HideOutdatedPackages(nuget, releaseVersion, packageName);
}
return;
Expand Down
12 changes: 6 additions & 6 deletions build/BuildParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@ public BuildParameters(Build b) {
if (IsRunningOnGitHubActions) {
RepositoryName = $"{GitHubActions.Instance.ServerUrl}/{GitHubActions.Instance.Repository}";
RepositoryBranch = GitHubActions.Instance.Ref;
NightlyHeight = GitHubActions.Instance.RunNumber;
IsReleasableBranch = StringComparer.OrdinalIgnoreCase.Equals(MasterBranch, RepositoryBranch)
|| GitHubActions.Instance.Ref.StartsWith("refs/heads/release/")
|| StringComparer.OrdinalIgnoreCase.Equals(GitHubActions.Instance.RefType, "tag");
}

IsMainRepo = StringComparer.OrdinalIgnoreCase.Equals(MainRepo, RepositoryName);
IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals(MasterBranch, RepositoryBranch);
IsReleasable = Configuration.Release == Configuration;

ShouldPublishNugetPackages = IsRunningOnGitHubActions && IsMasterBranch && IsReleasable
ShouldPublishNugetPackages = IsRunningOnGitHubActions && IsReleasableBranch && IsReleasable
&& (b.MinVer.MinVerPreRelease is null || !b.MinVer.MinVerPreRelease.EndsWith(".0"));

// VERSION
Version = b.ForceVersion ?? b.MinVer.Version;
}

public Configuration Configuration { get; }
public string MainRepo { get; }
public string MasterBranch { get; }
public string RepositoryBranch { get; } = null!;
public string RepositoryName { get; } = null!;
public bool IsRunningOnGitHubActions { get; }
public bool IsMainRepo { get; }
public bool IsMasterBranch { get; }
public bool IsReleasableBranch { get; }
public bool IsReleasable { get; }
public string Version { get; set; }
public long NightlyHeight { get; }
public bool ShouldPublishNugetPackages { get; set; }
public string NugetFeedUrl { get; set; }
public string? NugetApiKey { get; set; }
public bool IsReleaseToPublish { get; set; }
}
}

0 comments on commit 6d2fee1

Please sign in to comment.