Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created February 16, 2014 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaka-takayoshi/9035651 to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/9035651 to your computer and use it in GitHub Desktop.
Param (
$parameters = @{},
$srcFolder,
$scriptFolder,
$projectName,
$projectVersion
)
# get script variables
$nugetApiKey = $parameters["NuGetApiKey-secure"]
# update package version in nuspec file
Write-Output "Updating version in nuspec file"
$nuspecPath = "$scriptFolder\Chatwork.Api.nuspec"
[xml]$xml = Get-Content $nuspecPath
$xml.package.metadata.version = $projectVersion
$xml.Save($nuspecPath)
# build NuGet package
Write-Output "Building NuGet package"
."$srcFolder\.nuget\NuGet.exe" pack $scriptFolder\Chatwork.Api.nuspec
# publish NuGet package
Write-Output "Publishing NuGet package"
."$srcFolder\.nuget\NuGet.exe" push $srcFolder\Chatwork.Api.$projectVersion.nupkg $nugetApiKey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment