diff --git a/PrepareRelease.ps1 b/PrepareRelease.ps1 new file mode 100644 index 0000000..f95ee7c --- /dev/null +++ b/PrepareRelease.ps1 @@ -0,0 +1,64 @@ +Function Build() +{ + $msbuild=$env:MSBUILD + $solutionPath = Join-Path $solutionDir 'WindowsPhoneDriver.sln' + + &$msbuild ($solutionPath, '/v:minimal', '/p:configuration=Release', '/t:Clean,Build') + if (!$?) { + Write-Host "Build failed. $?" -ForegroundColor Red + Exit 1 + } +} + +Function Clean() +{ + Remove-Item $releaseDir -Force -Recurse + New-Item -ItemType directory -Path $releaseDir +} + +Function PackNuGet () +{ + Write-Host "Packing Nuget package" + Get-ChildItem -Path $releaseDir -Filter "*.nupkg" | foreach ($_) { Remove-Item $_.FullName } + + $nuget = Join-Path $solutionDir '.nuget\nuget.exe' + + $innerServerProjectDir = Join-Path $solutionDir 'WindowsPhoneDriver.InnerDriver' + $innerServerprojectPath = Join-Path $innerServerProjectDir 'WindowsPhoneDriver.InnerDriver.csproj' + + &$nuget ('pack', $innerServerprojectPath, '-IncludeReferencedProjects', '-Properties', 'Configuration=Release', '-OutputDirectory', $releaseDir) +} + +Function PackRelease() +{ + Add-Type -assembly "system.io.compression.filesystem" + + $driverSourcePath = Join-Path $solutionDir "WindowsPhoneDriver.OuterDriver\Bin\Release" + $innerServerSourcePath = Join-Path $solutionDir "WindowsPhoneDriver.InnerDriver\Bin\Release" + + Get-ChildItem -Path $releaseDir -Filter "*.zip" | foreach ($_) { Remove-Item $_.FullName } + + [IO.Compression.ZipFile]::CreateFromDirectory($driverSourcePath, "$releaseDir/WindowsPhoneDriver.OuterDriver.zip") + [IO.Compression.ZipFile]::CreateFromDirectory($innerServerSourcePath, "$releaseDir/WindowsPhoneDriver.InnerDriver.zip") +} + +$workspace=$PSScriptRoot +$releaseDir = Join-Path $workspace "Release" +$solutionDir=Join-Path $workspace "WindowsPhoneDriver" + +Write-Host "Update CHANGELOG.md" +Write-Host "Update version in Assemblies" +Write-Host "Update version in NuSpec file" + +Pause + +Clean +Build +# Test +PackNuGet +PackRelease + +Write-Host "Finished" -ForegroundColor Green +Write-Host "Publish NuGet package using nuget.exe push $releaseDir\WindowsPhoneDriver.InnerDriver.*.nupkg" +Write-Host "Add and push tag using git tag -a v*.*.* -m 'Version *.*.*'" +Write-Host "Upload and attach $releaseDir\*.zip files to release" diff --git a/WindowsPhoneDriver/WindowsPhoneDriver.Common/Properties/AssemblyInfo.cs b/WindowsPhoneDriver/WindowsPhoneDriver.Common/Properties/AssemblyInfo.cs index 81c91ee..a55011a 100644 --- a/WindowsPhoneDriver/WindowsPhoneDriver.Common/Properties/AssemblyInfo.cs +++ b/WindowsPhoneDriver/WindowsPhoneDriver.Common/Properties/AssemblyInfo.cs @@ -24,7 +24,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.1.*")] +[assembly: AssemblyVersion("0.3.1.*")] [assembly: InternalsVisibleTo("WindowsPhoneDriver.OuterDriver")] [assembly: InternalsVisibleTo("WindowsPhoneDriver.InnerDriver")] \ No newline at end of file diff --git a/WindowsPhoneDriver/WindowsPhoneDriver.InnerDriver/Properties/AssemblyInfo.cs b/WindowsPhoneDriver/WindowsPhoneDriver.InnerDriver/Properties/AssemblyInfo.cs index f1c6957..06e901e 100644 --- a/WindowsPhoneDriver/WindowsPhoneDriver.InnerDriver/Properties/AssemblyInfo.cs +++ b/WindowsPhoneDriver/WindowsPhoneDriver.InnerDriver/Properties/AssemblyInfo.cs @@ -31,7 +31,7 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.3.0.*")] -[assembly: AssemblyFileVersion("0.3.0.0")] +[assembly: AssemblyVersion("0.3.1.*")] +[assembly: AssemblyFileVersion("0.3.1.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/WindowsPhoneDriver/WindowsPhoneDriver.OuterDriver/Properties/AssemblyInfo.cs b/WindowsPhoneDriver/WindowsPhoneDriver.OuterDriver/Properties/AssemblyInfo.cs index 3998a9c..3460a67 100644 --- a/WindowsPhoneDriver/WindowsPhoneDriver.OuterDriver/Properties/AssemblyInfo.cs +++ b/WindowsPhoneDriver/WindowsPhoneDriver.OuterDriver/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.3.0.*")] -[assembly: AssemblyFileVersion("0.3.0")] +[assembly: AssemblyVersion("0.3.1.*")] +[assembly: AssemblyFileVersion("0.3.1")]