From d42657a3f0d135e856598e3c3abd226bfa908592 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Wed, 13 Nov 2019 18:23:55 +0100 Subject: [PATCH] release script added --- Changelog.md | 3 ++ Release.ps1 | 66 ++++++++++++++++++++++++++++++++++++++++++ mpv.net.sln | 12 ++++---- mpv.net/mpv.net.csproj | 6 ++-- 4 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 Release.ps1 diff --git a/Changelog.md b/Changelog.md index a92efb2..663b976 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ - new: forecolors in the dark theme are slightly darker now - new: readme/website and manual were improved +- new: source code includes now the release script to build the archives and setup files - new: install via Scoop and Chocolatey added to readme/website (maintained by Restia666Ashdoll) - new: update check, it must be enabled first in the conf editor under General - new: update feature, requires PowerShell 5 and curl, @@ -13,6 +14,8 @@ or on app startup, this is now suppressed - fix: the file association routine uses no longer 'Play with mpv.net' for the default open verb because it doesn't support multi selection. +- fix: x86 builds had an older version included because + of a misconfiguration in the solution file ### 5.4.3.0 diff --git a/Release.ps1 b/Release.ps1 new file mode 100644 index 0000000..63d503f --- /dev/null +++ b/Release.ps1 @@ -0,0 +1,66 @@ + +$ErrorActionPreference = 'Stop' + +$desktopDir = [Environment]::GetFolderPath('Desktop') +$exePath = (Get-Location).Path + '\mpv.net\bin\x64\mpvnet.exe' +$version = [Reflection.Assembly]::LoadFile($exePath).GetName().Version +$msbuild = 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe' +$iscc = 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' +$7z = 'C:\Program Files\7-Zip\7z.exe' + +if ($version.Revision -ne 0) +{ + & $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64 + if ($LastExitCode) { throw $LastExitCode } + + $targetDir = "$desktopDir\mpv.net-portable-x64-$version-beta" + Copy-Item .\mpv.net\bin\x64 $targetDir -Recurse -Exclude System.Management.Automation.xml + & $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*" + if ($LastExitCode) { throw $LastExitCode } + + $targetDirectories = 'C:\Users\frank\OneDrive\StaxRip\TestBuilds\', + 'C:\Users\frank\Dropbox\public\StaxRip\Builds\' + + foreach ($dir in $targetDirectories) + { + if (Test-Path $dir) + { + Copy-Item ($targetDir + '.7z') ($dir + (Split-Path $targetDir -Leaf) + '.7z') + Invoke-Item $dir + } + } +} +else +{ + & $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x64 + if ($LastExitCode) { throw $LastExitCode } + + & $msbuild mpv.net.sln /p:Configuration=Debug /p:Platform=x86 + if ($LastExitCode) { throw $LastExitCode } + + & $iscc /Darch=x64 setup.iss + if ($LastExitCode) { throw $LastExitCode } + + & $iscc /Darch=x86 setup.iss + if ($LastExitCode) { throw $LastExitCode } + + $targetDir = $desktopDir + "\mpv.net-portable-x64-$version" + Copy-Item .\mpv.net\bin\x64 $targetDir -Recurse -Exclude System.Management.Automation.xml + + & $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*" + if ($LastExitCode) { throw $LastExitCode } + + & $7z a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*" + if ($LastExitCode) { throw $LastExitCode } + + $targetDir = $desktopDir + "\mpv.net-portable-x86-$version" + Copy-Item .\mpv.net\bin\x86 $targetDir -Recurse -Exclude System.Management.Automation.xml + + & $7z a -t7z -mx9 "$targetDir.7z" -r "$targetDir\*" + if ($LastExitCode) { throw $LastExitCode } + + & $7z a -tzip -mx9 "$targetDir.zip" -r "$targetDir\*" + if ($LastExitCode) { throw $LastExitCode } +} + +Write-Host 'successfully finished' -ForegroundColor Green diff --git a/mpv.net.sln b/mpv.net.sln index e58b54b..739cfb8 100644 --- a/mpv.net.sln +++ b/mpv.net.sln @@ -19,24 +19,24 @@ Global GlobalSection(ProjectConfigurationPlatforms) = postSolution {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.ActiveCfg = Debug|x64 {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x64.Build.0 = Debug|x64 - {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.ActiveCfg = Debug|x64 - {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.Build.0 = Debug|x64 + {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.ActiveCfg = Debug|x86 + {1751F378-8EDF-4B62-BE6D-304C7C287089}.Debug|x86.Build.0 = Debug|x86 {1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.ActiveCfg = Release|x64 {1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x64.Build.0 = Release|x64 {1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.ActiveCfg = Release|x86 {1751F378-8EDF-4B62-BE6D-304C7C287089}.Release|x86.Build.0 = Release|x86 {55C88710-539D-4402-84C8-31694841C731}.Debug|x64.ActiveCfg = Debug|x64 {55C88710-539D-4402-84C8-31694841C731}.Debug|x64.Build.0 = Debug|x64 - {55C88710-539D-4402-84C8-31694841C731}.Debug|x86.ActiveCfg = Debug|x64 - {55C88710-539D-4402-84C8-31694841C731}.Debug|x86.Build.0 = Debug|x64 + {55C88710-539D-4402-84C8-31694841C731}.Debug|x86.ActiveCfg = Debug|x86 + {55C88710-539D-4402-84C8-31694841C731}.Debug|x86.Build.0 = Debug|x86 {55C88710-539D-4402-84C8-31694841C731}.Release|x64.ActiveCfg = Release|x64 {55C88710-539D-4402-84C8-31694841C731}.Release|x64.Build.0 = Release|x64 {55C88710-539D-4402-84C8-31694841C731}.Release|x86.ActiveCfg = Release|x86 {55C88710-539D-4402-84C8-31694841C731}.Release|x86.Build.0 = Release|x86 {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x64.ActiveCfg = Debug|x64 {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x64.Build.0 = Debug|x64 - {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.ActiveCfg = Debug|x64 - {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.Build.0 = Debug|x64 + {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.ActiveCfg = Debug|x86 + {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Debug|x86.Build.0 = Debug|x86 {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x64.ActiveCfg = Release|x64 {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x64.Build.0 = Release|x64 {94255EF2-C823-4D82-9017-0E993CC0F5A1}.Release|x86.ActiveCfg = Release|x86 diff --git a/mpv.net/mpv.net.csproj b/mpv.net/mpv.net.csproj index 4627885..9726e5c 100644 --- a/mpv.net/mpv.net.csproj +++ b/mpv.net/mpv.net.csproj @@ -39,7 +39,7 @@ DEBUG;TRACE full x86 - On + Auto 7.3 prompt MinimumRecommendedRules.ruleset @@ -52,6 +52,7 @@ x86 prompt MinimumRecommendedRules.ruleset + Auto true @@ -59,7 +60,7 @@ DEBUG;TRACE full x64 - On + Auto 7.3 prompt MinimumRecommendedRules.ruleset @@ -72,6 +73,7 @@ x64 prompt MinimumRecommendedRules.ruleset + Auto