Skip to content

Commit

Permalink
Do not push packages to GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson committed Nov 19, 2023
1 parent 4d6541d commit 383bee0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
33 changes: 0 additions & 33 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,6 @@ Task("Package")
});
});

Task("Publish-GitHub")
.WithCriteria(ctx => BuildSystem.IsRunningOnGitHubActions, "Not running on GitHub Actions")
.IsDependentOn("Package")
.Does(context =>
{
var apiKey = Argument<string>("github-key", null);
if(string.IsNullOrWhiteSpace(apiKey)) {
throw new CakeException("No GitHub API key was provided.");
}

// Publish to GitHub Packages
var exitCode = 0;
foreach(var file in context.GetFiles("./.artifacts/*.nupkg"))
{
context.Information("Publishing {0}...", file.GetFilename().FullPath);
exitCode += StartProcess("dotnet",
new ProcessSettings {
Arguments = new ProcessArgumentBuilder()
.Append("gpr")
.Append("push")
.AppendQuoted(file.FullPath)
.AppendSwitchSecret("-k", " ", apiKey)
}
);
}

if(exitCode != 0)
{
throw new CakeException("Could not push GitHub packages.");
}
});

Task("Publish-NuGet")
.WithCriteria(ctx => BuildSystem.IsRunningOnGitHubActions, "Not running on GitHub Actions")
.IsDependentOn("Package")
Expand All @@ -152,7 +120,6 @@ Task("Publish-NuGet")
// Targets

Task("Publish")
.IsDependentOn("Publish-GitHub")
.IsDependentOn("Publish-NuGet");

Task("Default")
Expand Down
6 changes: 0 additions & 6 deletions dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
"dotnet-cake"
]
},
"gpr": {
"version": "0.1.281",
"commands": [
"gpr"
]
},
"dotnet-example": {
"version": "2.0.0",
"commands": [
Expand Down

0 comments on commit 383bee0

Please sign in to comment.