diff --git a/appveyor.yml b/appveyor.yml index d71950fc82..8bd62212c4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -31,3 +31,6 @@ artifacts: name: OpenRCT2-installer - path: .\artifacts\openrct2-symbols*.zip name: OpenRCT2 debug symbols +deploy_script: +- ps: >- + .\scripts\ps\appveyor_deploy.ps1 diff --git a/openrct2.proj b/openrct2.proj index 364a5ef2e7..9b8919cee9 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -9,7 +9,7 @@ - OPENRCT2_ORG_TOKEN - NO_NSIS: set to true to prevent the NSIS installer building --> - + @@ -269,9 +269,4 @@ CustomErrorRegularExpression=""error":1" /> - - - - - diff --git a/scripts/ps/appveyor_deploy.ps1 b/scripts/ps/appveyor_deploy.ps1 new file mode 100644 index 0000000000..059525bec0 --- /dev/null +++ b/scripts/ps/appveyor_deploy.ps1 @@ -0,0 +1,21 @@ +########################################### +# Script to deploy OpenRCT2 from AppVeyor # +########################################### + +# Check if OpenRCT2.org API security token is available +if (${env:OPENRCT2_ORG_TOKEN}) +{ + # Only upload tagged builds, develop branch or push/ branches + if (${env:APPVEYOR_REPO_TAG} -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/") + { + msbuild openrct2.proj /t:UploadArtifacts /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" + } + else + { + Write-Host "No deployment: Non-tagged or push branch." -ForegroundColor Yellow + } +} +else +{ + Write-Host "No deployment: %OPENRCT2_ORG_TOKEN% not available." -ForegroundColor Yellow +} diff --git a/scripts/ps/appveyor_install.ps1 b/scripts/ps/appveyor_install.ps1 index 4125dfa2a3..762318c20e 100644 --- a/scripts/ps/appveyor_install.ps1 +++ b/scripts/ps/appveyor_install.ps1 @@ -23,6 +23,7 @@ if ($env:ENCKEY) Check-ExitCode } +# Check if OpenRCT2.org API security token is available if (${env:OPENRCT2_ORG_TOKEN}) { if (-not (Test-Path "C:\ProgramData\chocolatey\lib\nsis.portable")) @@ -43,18 +44,6 @@ if (${env:OPENRCT2_ORG_TOKEN}) cp FindProcDLL.dll "C:\ProgramData\chocolatey\lib\nsis.portable\tools\nsis-3.0b1\Plugins\x86-ansi" } } - -# Check if OpenRCT2.org API security token is available -if (${env:OPENRCT2_ORG_TOKEN}) -{ - # Only upload tagged builds, develop branch or push/ branches - if (${env:APPVEYOR_REPO_TAG} -or ${env:APPVEYOR_REPO_BRANCH} -match "^develop$|^push/") - { - # Remove the OPENRCT2_ORG_TOKEN environment variable so that the msbuild will not - # try to upload the artifacts - ${env:OPENRCT2_ORG_TOKEN} = $null - } -} else { # Don't build the NSIS installer for non-uploaded builds