Skip to content

Commit

Permalink
remove Travis metadata and replace with Actions (#2073)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey authored Jan 28, 2020
1 parent e065c86 commit 43ae40f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down
12 changes: 6 additions & 6 deletions build/Lifetime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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?
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 43ae40f

Please sign in to comment.