@@ -19,7 +19,7 @@ Properties {
1919Task Default - Depends Build;
2020Task Build - Depends Clean , Setup, Deploy;
2121Task Stage - Depends Build, Version, Sign, Zip;
22- Task Publish - Depends Stage, Release, Chocolatey ;
22+ Task Publish - Depends Stage, Release;
2323
2424Task Clean {
2525 # # Remove build directory
@@ -113,28 +113,3 @@ Task Release {
113113 Set-Variable - Name assetUri - Value $asset.Browser_Download_Url - Scope Script - Force;
114114 }
115115}
116-
117- Task Chocolatey {
118- Set-Variable chocolateyBuildPath - Value (Join-Path - Path $psake.build_script_dir - ChildPath " $buildDir \Chocolatey" ) - Scope Script;
119- # # Create the Chocolatey folder
120- Write-Host (' Creating Chocolatey directory "{0}".' -f $chocolateyBuildPath ) - ForegroundColor Yellow;
121- [Ref ] $null = New-Item $chocolateyBuildPath - ItemType Directory - Force - ErrorAction Stop;
122- $chocolateyToolsPath = New-Item " $chocolateyBuildPath \tools" - ItemType Directory - Force - ErrorAction Stop;
123-
124- # # Create the Chocolatey package
125- $nuspecFilename = ' {0}.nuspec' -f $manifest.Name ;
126- $nuspecPath = Join-Path - Path $chocolateyBuildPath - ChildPath $nuspecFilename ;
127- Write-Host (' Creating Nuget specification "{0}".' -f $nuspecPath ) - ForegroundColor Yellow;
128- (New-NuGetNuspec - InputObject $manifest ).Save($nuspecPath );
129-
130- Write-Host ' Creating Chocolatey install files.' - ForegroundColor Yellow;
131- New-ChocolateyInstallZipModule - Path $chocolateyToolsPath.FullName - PackageName $manifest.Name - Uri $assetUri ;
132- Write-Host (' Creating Nuget package from "{0}".' -f $nuspecPath ) - ForegroundColor Yellow;
133- $nugetOutput = Invoke-NuGetPack - Path $nuspecPath - DestinationPath $releasePath ;
134- if ($nugetOutput ) {
135- $nugetPackagePath = Join-Path - Path $releasePath - ChildPath (' {0}.{1}.nupkg' -f $manifest.Name.ToLower (), $version );
136- Write-Host (' Chocolatey package "{0}" created.' -f $nugetPackagePath ) - ForegroundColor Yellow;
137- $chocolateyApiKey = (New-Object System.Management.Automation.PSCredential ' OAUTH' , (Get-Content - Path $chocolateyTokenPath | ConvertTo-SecureString )).GetNetworkCredential().Password;
138- Write-Host (' MANUAL: Push Chocolatey package "{0}".' -f $nugetPackagePath ) - ForegroundColor Yellow;
139- }
140- }
0 commit comments