diff --git a/Tools/appveyor_publish_build.ps1 b/Tools/appveyor_publish_build.ps1 new file mode 100644 index 00000000..831ebb5b --- /dev/null +++ b/Tools/appveyor_publish_build.ps1 @@ -0,0 +1,85 @@ +if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) { + Write-Output "NOT running via Appveyor - Exiting" + Throw "NOT running via Appveyor - Exiting" +} + +$appvDir = $Env:APPVEYOR_BUILD_FOLDER + +$SIGCHECK="Tools\exes\sigcheck.exe" +$SEVENZIP="Tools\7zip\7za.exe" + +Write-Output "Appveyor Build Dir: '$($appvDir)'" +#$ConfigurationName = $Env:CONFIGURATION.Trim() +#Write-Output "Config Name (tirmmed): '$($ConfigurationName)'" + +Write-Output "Decrypt Cert" +& appveyor-tools\secure-file -decrypt "$($Env.cert_path).enc" -secret "$Env.cert_decrypt_pwd" + +if($LastExitCode == $false) { + Write-Output "Could not decrypt cert" + Throw "Could not decrypt cert" +} + +Write-Output "Restoring NuGets" +& nuget restore + + +Write-Output "Build Release Installer" +& msbuild "$($appvDir)\mRemoteV1.sln" /nologo /t:Clean,Build /p:Configuration="Release Installer" /p:Platform=x86 /p:CertPath="$($Env.cert_path)" /p:CertPassword=($Env.cert_decrypt_pwd) /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + +Write-Output "Packaging debug symbols" + +$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\Release Installer\mRemoteNG.exe" + +Write-Output "Version is $($version)" + +$zipFilePrefix = "mRemoteNG-symbols" + + +$outputZipPath="Release\$zipFilePrefix-$($version).zip" + +Write-Output "Creating debug symbols ZIP file $($outputZipPath)" +Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue +$SymPath = (Join-Path -Path "mRemoteV1\bin\Release" -ChildPath "*.pdb") +if(Test-Path "$SymPath") { + & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath "$SymPath" +} else { + Write-Output "No Debugging Symbols Found..." +} + + +Write-Output "Build Release Portable" +& msbuild "$($appvDir)\mRemoteV1.sln" /nologo /t:Clean,Build /p:Configuration="Release Portable" /p:Platform=x86 /p:CertPath="$($Env.cert_path)" /p:CertPassword=$($Env.cert_decrypt_pwd) /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + + +Write-Output "Packaging Release Portable ZIP" + +$version = & $SIGCHECK /accepteula -q -n "mRemoteV1\bin\Release Portable\mRemoteNG.exe" + +Write-Output "Version is $($version)" + +$zipFilePrefix = "mRemoteNG-Portable-symbols" +$outputZipPath="Release\$zipFilePrefix-$($version).zip" + +Write-Output "Creating debug symbols ZIP file $($outputZipPath)" +Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue +$SymPath = (Join-Path -Path "mRemoteV1\bin\Release Portable" -ChildPath "*.pdb") +if(Test-Path "$SymPath") { + & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath "$SymPath" +} else { + Write-Output "No Debugging Symbols Found..." +} + +$PortableZip="Release\mRemoteNG-Portable-$($version).zip" + +Remove-Item -Recurse "mRemoteV1\bin\package" -ErrorAction SilentlyContinue | Out-Null +New-Item "mRemoteV1\bin\package" -ItemType "directory" | Out-Null + +Copy-Item "mRemoteV1\Resources\PuTTYNG.exe" -Destination "mRemoteV1\bin\package" + +Copy-Item "mRemoteV1\bin\Release Portable\*" -Destination "mRemoteV1\bin\package" -Recurse -Force +Copy-Item "*.txt" -Destination "mRemoteV1\bin\package" + +Write-Output "Creating portable ZIP file $($PortableZip)" +Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue +& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip ".\mRemoteV1\bin\package\*.*" diff --git a/appveyor_publish.yml b/appveyor_publish.yml index d25aa074..689aab86 100644 --- a/appveyor_publish.yml +++ b/appveyor_publish.yml @@ -1,4 +1,4 @@ -version: 1.76.{build} +version: 1.77.{build} pull_requests: do_not_increment_build_number: true environment: @@ -7,53 +7,33 @@ environment: secure: QK1ldldzIUSVA0u+OtbHixPmsXHAO9ksOKcyByq0FHM= cert_pwd: secure: Fni66m2OgoTxjRzahUNUUNHl5gGwTXLvXIMQYiOMqX8= +branches: + only: + - /release.*/ + - master + - develop +skip_non_tags: true +skip_branch_with_pr: true image: Visual Studio 2017 -configuration: -- Release Portable -- Release -- Release Installer -platform: x86 +configuration: Deployment shallow_clone: true -clone_depth: 1 install: - ps: >- - iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1')) - date mRemoteV1\Resources\CitrixReceiver.exe ENABLE_SSON="No" /silent /noreboot /EnableCEIP=false /AutoUpdateCheck=disabled /EnableTracing=false | out-null date -before_build: -- cmd: >- - echo %TIME% - nuget restore - echo %TIME% - - appveyor-tools\secure-file -decrypt %cert_path%.enc -secret %cert_decrypt_pwd% + iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1')) build_script: - - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release Portable" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" -for: - - - matrix: - only: - - configuration: "Release Installer" - build_script: - - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release Installer" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - - - matrix: - only: - - configuration: Release - build_script: - - cmd: msbuild mRemoteV1.sln /t:Clean,Build /p:Configuration="Release" /p:Platform=x86 /p:CertPath="%APPVEYOR_BUILD_FOLDER%\%cert_path%" /p:CertPassword=%cert_pwd% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" -after_build: -- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Exit\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n$ConfigurationName = $Env:CONFIGURATION.Trim()\nWrite-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\n\n$SIGCHECK=\"Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"Tools\\7zip\\7za.exe\"\n\nif ($ConfigurationName -eq \"Release Portable\") {\n Write-Output \"Packaging Release Portable ZIP\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n $PortableZip=\"Release\\mRemoteNG-Portable-$($version).zip\"\n\n Remove-Item -Recurse \"mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\n New-Item \"mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n \n Copy-Item \"mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"mRemoteV1\\bin\\package\"\n\n Copy-Item \"mRemoteV1\\bin\\$ConfigurationName\\*\" -Destination \"mRemoteV1\\bin\\package\" -Recurse -Force \n Copy-Item \"*.txt\" -Destination \"mRemoteV1\\bin\\package\"\n\n Write-Output \"Creating portable ZIP file $($PortableZip)\"\n Remove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \".\\mRemoteV1\\bin\\package\\*.*\"\n}\nelse {\n Write-Output \"We will not zip anything - this isnt a portable release build.\"\n}\n\nWrite-Output \"\"\nWrite-Output \"\"\n\nif ($ConfigurationName -match \"Release\" -And $ConfigurationName -ne \"Release Installer\") {\n Write-Output \"Packaging debug symbols\"\n \n $version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\$($ConfigurationName)\\mRemoteNG.exe\"\n\n Write-Output \"Version is $($version)\"\n\n if ($ConfigurationName -match \"Portable\") {\n $zipFilePrefix = \"mRemoteNG-Portable-symbols\"\n } else {\n $zipFilePrefix = \"mRemoteNG-symbols\"\n }\n\n $outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\n Write-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\n Remove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n $SymPath = (Join-Path -Path mRemoteV1\\bin\\$($ConfigurationName) -ChildPath \"*.pdb\")\n if(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n } else {\n Write-Output \"No Debugging Symbols Found...\"\n }\n \n}\nelse {\n Write-Output \"We will not package debug symbols for this configuration $($ConfigurationName)\"\n}\n\nWrite-Output \"\"" +- ps: "if([string]::IsNullOrEmpty($Env:APPVEYOR_BUILD_FOLDER)) {\n Write-Output \"NOT running via Appveyor - Exiting\"\n Throw \"NOT running via Appveyor - Exiting\"\n}\n\n$appvDir = $Env:APPVEYOR_BUILD_FOLDER\n \n$SIGCHECK=\"Tools\\exes\\sigcheck.exe\"\n$SEVENZIP=\"Tools\\7zip\\7za.exe\"\n\nWrite-Output \"Appveyor Build Dir: '$($appvDir)'\"\n#$ConfigurationName = $Env:CONFIGURATION.Trim()\n#Write-Output \"Config Name (tirmmed): '$($ConfigurationName)'\"\n\nWrite-Output \"Decrypt Cert\"\n& appveyor-tools\\secure-file -decrypt \"$($Env.cert_path).enc\" -secret \"$Env.cert_decrypt_pwd\"\n\nif($LastExitCode == $false) {\n Write-Output \"Could not decrypt cert\"\n Throw \"Could not decrypt cert\"\n}\n\nWrite-Output \"Restoring NuGets\"\n& nuget restore\n\n\nWrite-Output \"Build Release Installer\"\n& msbuild \"$($appvDir)\\mRemoteV1.sln\" /nologo /t:Clean,Build /p:Configuration=\"Release Installer\" /p:Platform=x86 /p:CertPath=\"$($Env.cert_path)\" /p:CertPassword=($Env.cert_decrypt_pwd) /m /verbosity:normal /logger:\"C:\\Program Files\\AppVeyor\\BuildAgent\\Appveyor.MSBuildLogger.dll\"\n\nWrite-Output \"Packaging debug symbols\"\n \n$version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\Release Installer\\mRemoteNG.exe\"\n\nWrite-Output \"Version is $($version)\"\n\n$zipFilePrefix = \"mRemoteNG-symbols\"\n\n\n$outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\nWrite-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\nRemove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n$SymPath = (Join-Path -Path \"mRemoteV1\\bin\\Release\" -ChildPath \"*.pdb\")\nif(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n} else {\n Write-Output \"No Debugging Symbols Found...\"\n}\n \n\nWrite-Output \"Build Release Portable\"\n& msbuild \"$($appvDir)\\mRemoteV1.sln\" /nologo /t:Clean,Build /p:Configuration=\"Release Portable\" /p:Platform=x86 /p:CertPath=\"$($Env.cert_path)\" /p:CertPassword=$($Env.cert_decrypt_pwd) /m /verbosity:normal /logger:\"C:\\Program Files\\AppVeyor\\BuildAgent\\Appveyor.MSBuildLogger.dll\"\n\n\nWrite-Output \"Packaging Release Portable ZIP\"\n\n$version = & $SIGCHECK /accepteula -q -n \"mRemoteV1\\bin\\Release Portable\\mRemoteNG.exe\"\n\nWrite-Output \"Version is $($version)\"\n\n$zipFilePrefix = \"mRemoteNG-Portable-symbols\"\n$outputZipPath=\"Release\\$zipFilePrefix-$($version).zip\"\n\nWrite-Output \"Creating debug symbols ZIP file $($outputZipPath)\"\nRemove-Item -Force $outputZipPath -ErrorAction SilentlyContinue\n$SymPath = (Join-Path -Path \"mRemoteV1\\bin\\Release Portable\" -ChildPath \"*.pdb\")\nif(Test-Path \"$SymPath\") {\n & $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $outputZipPath \"$SymPath\"\n} else {\n Write-Output \"No Debugging Symbols Found...\"\n}\n\n$PortableZip=\"Release\\mRemoteNG-Portable-$($version).zip\"\n\nRemove-Item -Recurse \"mRemoteV1\\bin\\package\" -ErrorAction SilentlyContinue | Out-Null\nNew-Item \"mRemoteV1\\bin\\package\" -ItemType \"directory\" | Out-Null\n\nCopy-Item \"mRemoteV1\\Resources\\PuTTYNG.exe\" -Destination \"mRemoteV1\\bin\\package\"\n\nCopy-Item \"mRemoteV1\\bin\\Release Portable\\*\" -Destination \"mRemoteV1\\bin\\package\" -Recurse -Force \nCopy-Item \"*.txt\" -Destination \"mRemoteV1\\bin\\package\"\n\nWrite-Output \"Creating portable ZIP file $($PortableZip)\"\nRemove-Item -Force $PortableZip -ErrorAction SilentlyContinue\n& $SEVENZIP a -bt -bd -bb1 -mx=9 -tzip -y -r $PortableZip \".\\mRemoteV1\\bin\\package\\*.*\"" test: assemblies: only: - - mRemoteNGTests\bin\$(configuration)\mRemoteNGTests.dll + - mRemoteNGTests\bin\Release\mRemoteNGTests.dll + - mRemoteNGTests\bin\Release Portable\mRemoteNGTests.dll artifacts: - path: Release\*.msi name: mRemoteNG-installer.msi @@ -62,4 +42,7 @@ artifacts: - path: Release\mRemoteNG-Portable-symbols*.zip name: mRemoteNG-Portable-symbols.zip - path: Release\mRemoteNG-symbols*.zip - name: mRemoteNG-symbols.zip \ No newline at end of file + name: mRemoteNG-symbols.zip +deploy: +- provider: Environment + name: GitHubRelease \ No newline at end of file