Skip to content

Commit 3570ab5

Browse files
author
Jimmy Merrild Krag
committed
Added NuGet publishing and released first stable version
1 parent 1380a84 commit 3570ab5

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

NuGet-publish.ps1

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
# Run this file with powershell to publish package to NuGet
3+
4+
$nuget_url = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
5+
6+
function WriteMessage ([string] $message){
7+
Write-Host $message -ForegroundColor Yellow -BackgroundColor Black
8+
}
9+
10+
function Pause ($message = "Press any key to continue . . . ") {
11+
if ((Test-Path variable:psISE) -and $psISE) {
12+
$Shell = New-Object -ComObject "WScript.Shell"
13+
$Button = $Shell.Popup("Click OK to continue.", 0, "Script Paused", 0)
14+
}
15+
else {
16+
WriteMessage $message
17+
[void][System.Console]::ReadKey($true)
18+
Write-Host
19+
}
20+
}
21+
22+
WriteMessage "Downloading nuget.exe"
23+
Invoke-WebRequest -Uri $nuget_url -OutFile "nuget.exe"
24+
25+
WriteMessage "Remember to update release notes in UriBuilderExtended/UriBuilderExtended.nuspec"
26+
Pause
27+
28+
WriteMessage "Creating package"
29+
./nuget pack UriBuilderExtended\UriBuilderExtended.csproj -Prop Configuration=Release
30+
31+
32+
$file = Get-ChildItem *.nupkg
33+
$package = ""
34+
if($file -is [System.IO.FileSystemInfo])
35+
{
36+
$package = $file.Name
37+
}
38+
if($package -ne "")
39+
{
40+
WriteMessage "Package created: $package"
41+
42+
WriteMessage "Pushing package"
43+
$api_key = Read-Host "Please enter API key"
44+
./nuget push $package -Source nuget.org -ApiKey $api_key -NonInteractive
45+
}
46+
else
47+
{
48+
WriteMessage "Unable to detect package after creation. Please clean the directory for any existing packages."
49+
}
50+
51+
WriteMessage "Cleaning up"
52+
Remove-Item "nuget.exe"
53+
Remove-Item $package

UriBuilderExtended/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyInformationalVersion("1.0 RC1")]
35+
[assembly: AssemblyVersion("1.1.0.*")]
36+
[assembly: AssemblyInformationalVersion("1.1")]

UriBuilderExtended/UriBuilderExtended.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
<Compile Include="Properties\AssemblyInfo.cs" />
4949
</ItemGroup>
5050
<ItemGroup>
51+
<None Include="UriBuilderExtended.nuspec">
52+
<SubType>Designer</SubType>
53+
</None>
5154
</ItemGroup>
5255
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
5356
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<package >
3+
<metadata>
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<title>$title$</title>
7+
<authors>$author$</authors>
8+
<owners>$author$</owners>
9+
<licenseUrl>https://opensource.org/licenses/MIT</licenseUrl>
10+
<projectUrl>https://github.com/beruic/UriBuilderExtended</projectUrl>
11+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
12+
<description>$description$</description>
13+
<releaseNotes>First stable release. Changed version scheme.</releaseNotes>
14+
<copyright>Copyright 2016 $author$</copyright>
15+
<tags>URI URL Uri UriBuilder Extended Extensions</tags>
16+
</metadata>
17+
</package>

0 commit comments

Comments
 (0)