Skip to content

Commit

Permalink
CI/DI Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ScarletKuro committed May 27, 2024
1 parent 0e2ceb5 commit d95db1a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
OnPushTags = new[] { @"\d+\.\d+\.\d+" },
PublishArtifacts = true,
InvokedTargets = new[] { nameof(Push), nameof(PushGithubNuget) },
ImportSecrets = new[] { nameof(NuGetApiKey), nameof(GithubToken) })]
ImportSecrets = new[] { nameof(NuGetApiKey) })]
class Build : NukeBuild
{
/// Support plugins are available for:
Expand All @@ -49,7 +49,6 @@ class Build : NukeBuild
bool IsTag => GitHubActions.Instance?.Ref?.StartsWith("refs/tags/") ?? false;

[Parameter] [Secret] readonly string NuGetApiKey;
[Parameter] [Secret] readonly string GithubToken;

[Solution] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
Expand Down Expand Up @@ -128,14 +127,11 @@ class Build : NukeBuild
Target PushGithubNuget => _ => _
.DependsOn(Pack)
.OnlyWhenStatic(() => IsTag && IsServerBuild)
.Requires(() => GithubToken)
.Requires(() => Configuration.Equals(Configuration.Release))
.Executes(() =>
{
Log.Information("Running push to packages directory.");

Assert.True(!string.IsNullOrEmpty(GithubToken));

PackagesDirectory.GlobFiles("*.nupkg")
.ForEach(x =>
{
Expand All @@ -144,7 +140,7 @@ class Build : NukeBuild
DotNetNuGetPush(s => s
.SetTargetPath(x)
.SetSource($"https://nuget.pkg.github.com/{GitHubActions.Instance.RepositoryOwner}/index.json")
.SetApiKey(GithubToken)
.SetApiKey(GitHubActions.Instance.Token)
.EnableSkipDuplicate()
);
});
Expand Down

0 comments on commit d95db1a

Please sign in to comment.