mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-01 01:25:27 +08:00 
			
		
		
		
	Do not push packages to GitHub
This commit is contained in:
		 Patrik Svensson
					Patrik Svensson
				
			
				
					committed by
					
						 Patrik Svensson
						Patrik Svensson
					
				
			
			
				
	
			
			
			 Patrik Svensson
						Patrik Svensson
					
				
			
						parent
						
							4d6541dd14
						
					
				
				
					commit
					383bee0e3e
				
			
							
								
								
									
										33
									
								
								build.cake
									
									
									
									
									
								
							
							
						
						
									
										33
									
								
								build.cake
									
									
									
									
									
								
							| @@ -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") | Task("Publish-NuGet") | ||||||
|     .WithCriteria(ctx => BuildSystem.IsRunningOnGitHubActions, "Not running on GitHub Actions") |     .WithCriteria(ctx => BuildSystem.IsRunningOnGitHubActions, "Not running on GitHub Actions") | ||||||
|     .IsDependentOn("Package") |     .IsDependentOn("Package") | ||||||
| @@ -152,7 +120,6 @@ Task("Publish-NuGet") | |||||||
| // Targets | // Targets | ||||||
|  |  | ||||||
| Task("Publish") | Task("Publish") | ||||||
|     .IsDependentOn("Publish-GitHub") |  | ||||||
|     .IsDependentOn("Publish-NuGet"); |     .IsDependentOn("Publish-NuGet"); | ||||||
|  |  | ||||||
| Task("Default") | Task("Default") | ||||||
|   | |||||||
| @@ -8,12 +8,6 @@ | |||||||
|         "dotnet-cake" |         "dotnet-cake" | ||||||
|       ] |       ] | ||||||
|     }, |     }, | ||||||
|     "gpr": { |  | ||||||
|       "version": "0.1.281", |  | ||||||
|       "commands": [ |  | ||||||
|         "gpr" |  | ||||||
|       ] |  | ||||||
|     }, |  | ||||||
|     "dotnet-example": { |     "dotnet-example": { | ||||||
|       "version": "2.0.0", |       "version": "2.0.0", | ||||||
|       "commands": [ |       "commands": [ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user