Skip to content

Commit 9bbc24b

Browse files
committed
Added choco push command
1 parent 18d2e8c commit 9bbc24b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ artifacts:
2424

2525
test: off
2626
environment:
27-
IS_SECURE_BUILDENVIRONM∥ENT:
27+
IS_SECURE_BUILDENVIRONMENT:
2828
secure: The encoded value of 'true' (not including the apostrophes)
2929
GITHUB_REPO_TOKEN:
3030
secure: The encoded value of your GitHub Access Token.

build/Choco.csx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ public static class Choco
1717
Command.Execute("choco.exe", $@"pack Chocolatey\chocolatey.nuspec --outputdirectory {outputFolder}");
1818
}
1919

20+
public static void Push(string packagesFolder, string apiKey, string source = "https://push.chocolatey.org/")
21+
{
22+
var packageFiles = Directory.GetFiles(packagesFolder, "*.nupkg");
23+
foreach(var packageFile in packageFiles)
24+
{
25+
Command.Execute("choco.exe", $"push {packageFile} --source {source} --key {apiKey}");
26+
}
27+
}
28+
2029
private static void CreateSpecificationFromProject(string pathToProjectFile, string pathToBinaries)
2130
{
2231
var projectFile = XDocument.Load(pathToProjectFile);

0 commit comments

Comments
 (0)