From 43ae40fa00db0ab9751edd067c4d2399e069fdf3 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Tue, 28 Jan 2020 08:56:00 -0400 Subject: [PATCH] remove Travis metadata and replace with Actions (#2073) --- build/Context.cs | 2 +- build/Lifetime.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/Context.cs b/build/Context.cs index d31d037875..a36ce0fc4f 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -23,7 +23,7 @@ public class Context : FrostingContext public bool ForcePublish { get; set; } public bool AppVeyor { get; set; } - public bool TravisCI { get; set; } + public bool GitHubActions { get; set; } public Project[] Projects { get; set; } diff --git a/build/Lifetime.cs b/build/Lifetime.cs index 6468c5675d..929066f865 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -20,8 +20,8 @@ public override void Setup(Context context) var buildSystem = context.BuildSystem(); context.IsLocalBuild = buildSystem.IsLocalBuild; + context.GitHubActions = buildSystem.GitHubActions.IsRunningOnGitHubActions; context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor; - context.TravisCI = buildSystem.TravisCI.IsRunningOnTravisCI; context.IsTagged = IsBuildTagged(buildSystem); if (context.AppVeyor) @@ -30,11 +30,11 @@ public override void Setup(Context context) context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.AppVeyor.Environment.Repository.Name); context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.AppVeyor.Environment.Repository.Branch); } - else if (context.TravisCI) + else if (context.GitHubActions) { - context.IsPullRequest = !string.IsNullOrEmpty(buildSystem.TravisCI.Environment.Repository.PullRequest); - context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.TravisCI.Environment.Repository.Slug); - context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.TravisCI.Environment.Build.Branch); + context.IsPullRequest = buildSystem.GitHubActions.Environment.PullRequest.IsPullRequest; + context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals("octokit/octokit.net", buildSystem.GitHubActions.Environment.Workflow.Repository); + context.IsMasterBranch = StringComparer.OrdinalIgnoreCase.Equals("master", buildSystem.GitHubActions.Environment.Workflow.Ref); } // Force publish? @@ -64,7 +64,7 @@ public override void Setup(Context context) context.Information("LinkSources: {0}", context.LinkSources); context.Information("Target: {0}", context.Target); context.Information("AppVeyor: {0}", context.AppVeyor); - context.Information("TravisCI: {0}", context.TravisCI); + context.Information("GitHub Actions: {0}", context.GitHubActions); } private static bool IsBuildTagged(BuildSystem buildSystem)