diff --git a/appveyor.yml b/appveyor.yml index 4ec9361b08..ebc413671f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,10 +5,12 @@ environment: secure: saYAIpqXzpq0U+JH+MNi/isRQ6Y51PZhm4BrnePDiAPptFO5htxFOLegrYqxdy67 CODE-SIGN-KEY-OPENRCT2.ORG.PFX.PASSWORD: secure: bzYmf0ElxisSGyZnIjUOYQ== + OPENRCT2.ORG_TOKEN: + secure: leQX3xCQpmBLGuMqrxjFlzexDt96ypNRMM5TTRVHbGE8PwVg9crgeykLc2BIZU6HDHveJCHqh2cGMdHtHYJYcw== install: - nuget install secure-file -ExcludeVersion -- secure-file\tools\secure-file -decrypt distribution\windows\code-sign-key-openrct2.org.pfx.enc -secret %enckey% -- cinst nsis.portable -pre +- secure-file\tools\secure-file -decrypt distribution\windows\code-sign-key-openrct2.org.pfx.enc -secret %ENCKEY% +- cinst nsis.portable -pre > nul - ps: >- curl "http://nsis.sourceforge.net/mediawiki/images/5/53/KillProcDll%26FindProcDll.zip" -OutFile nsisxtra.zip diff --git a/scripts/ps/appveyor_run.ps1 b/scripts/ps/appveyor_run.ps1 index 97724a7197..d69b8c128b 100644 --- a/scripts/ps/appveyor_run.ps1 +++ b/scripts/ps/appveyor_run.ps1 @@ -2,6 +2,22 @@ # Script to build OpenRCT2 on AppVeyor ######################################################### +function Push-Build($file, $name, $version, $flavourId) +{ + curl.exe -s -o - ` + --form "key=${env:OPENRCT2.ORG_TOKEN}" ` + --form "fileName=$name" ` + --form "version=$version" ` + --form "gitHash=${env:APPVEYOR_REPO_COMMIT}" ` + --form "gitBranch=${env:APPVEYOR_REPO_BRANCH}" ` + --form "flavourId=$flavourId" ` + --form "file=@$file" ` + "https://openrct2.org/altapi/?command=push-build" +} + +# Provide a short commit SHA1 too +${env:APPVEYOR_REPO_COMMIT_SHORT} = (${env:APPVEYOR_REPO_COMMIT}).Substring(0, 7) + # Install dependencies install -Quiet @@ -30,3 +46,19 @@ publish package ` -BuildNumber $env:APPVEYOR_BUILD_NUMBER ` -GitBranch $env:APPVEYOR_REPO_BRANCH ` -CodeSign + +$version = "0.0.4.0" +$pushFileName = "OpenRCT2-$version-windows-${env:APPVEYOR_REPO_COMMIT_SHORT}" + +# Push portable zip +Write-Host "Sending portable zip to OpenRCT2.org" -ForegroundColor Cyan +Push-Build -file ".\artifacts\openrct2.zip" ` + -name "$pushFileName.zip" ` + -version $version ` + -flavourId 1 + +Write-Host "Sending installer to OpenRCT2.org" -ForegroundColor Cyan +Push-Build -file ".\artifacts\openrct2-install.exe" ` + -name "$pushFileName.exe" ` + -version $version ` + -flavourId 2 diff --git a/scripts/ps/publish.ps1 b/scripts/ps/publish.ps1 index ce77846642..bd70effaf9 100644 --- a/scripts/ps/publish.ps1 +++ b/scripts/ps/publish.ps1 @@ -165,7 +165,7 @@ function Do-Installer() if (-not (Sign-Binary($installerPath))) { return 1 } } - Move-Item -Force $installerPath $artifactsDir + Move-Item -Force $installerPath "$artifactsDir\openrct2-install.exe" return 0 }