Add Appveyor for Windows continuous integration (#9)

* Add appveyor based on https://users.rust-lang.org/t/rust-appveyor-windows-ci-scripts/4437/2

* Add build script in a separate file, based on https://github.com/briansmith/ring/blob/master/mk/appveyor.bat

* Add pacman installation packages from https://github.com/Thinkofname/steven/wiki/Compiling-and-or-running#compiling-on-windows

* Run msys2_shell from https://github.com/appveyor/ci/issues/352

* Set msys64 and mingw PATH

f000540506

* Add --noconfirm option to pacman

https://unix.stackexchange.com/questions/52277/pacman-option-to-assume-yes-to-every-question#52278

* Try installing OpenSSL using vcpkg

https://www.appveyor.com/docs/lang/cpp/#vc-packaging-tool

* Attempt to install OpenSSL using rust-openssl's appveyor.yml

https://github.com/sfackler/rust-openssl/blob/master/appveyor.yml

* Revert "Attempt to install OpenSSL using rust-openssl's appveyor.yml"

This reverts commit 50106089798615f5a6576651fe9ca88af9a43a0d.

* Set OPENSSL_DIR to C:\OpenSSL

* List contents of C:\OpenSSL

* List C:\OpenSSL after installation

* No such directory

* Use appveyor script from thinkofname

https://github.com/Thinkofname/steven/issues/72#issuecomment-433889692

* Enable echo in appveyor.bat

* Add exported build script, merge working with existing

* Remove environment matrix, nightly-2018-10-24 vs nightly

* Remove debug/release because it builds both in one go

* Echo the platform variable before forcing it

* Set platforms to x86 (not Win32) and x64

* Build x64 first

* Only install the proper platform for OpenSSL, not both
This commit is contained in:
iceiix 2018-10-31 19:22:16 -07:00 committed by GitHub
parent c36d0706ac
commit 24f71cf959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 75 additions and 1 deletions

View File

@ -24,7 +24,7 @@ Currently requires SDL2, OpenSSL and **nightly** rust to build.
`cargo build --release`
Windows users can download pre-compiled builds from here: https://ci.appveyor.com/project/thinkofdeath/steven-rust/branch/master
Windows users can download pre-compiled builds from here: https://ci.appveyor.com/project/iceiix/steven
(Select your platform, Click the artifacts tab and download Steven.zip)
The Visual Studio 2015 Redistributable is required to run these builds.

74
appveyor.yml Normal file
View File

@ -0,0 +1,74 @@
version: 1.0.{build}
image: Visual Studio 2015
clone_depth: 1
platform:
- x64
- x86
build_script:
- cmd: >-
echo on
echo AddMessage "PLATFORM is %PLATFORM%"
if "%PLATFORM%" == "x86" set RUST_INSTALL=i686-pc-windows-msvc
if "%PLATFORM%" == "x64" set RUST_INSTALL=x86_64-pc-windows-msvc
echo AddMessage "platform is %platform%"
appveyor AddMessage "Platform rust: %RUST_INSTALL%"
appveyor DownloadFile "https://static.rust-lang.org/dist/rust-nightly-%RUST_INSTALL%.exe" -FileName rust-install.exe
"./rust-install.exe" /VERYSILENT /NORESTART /DIR="C:\Rust\"
SET PATH=%PATH%;C:\Rust\bin
rustc -V
cargo -V
vcpkg integrate install
vcpkg install openssl:%PLATFORM%-windows
set VCPKGRS_DYNAMIC=1
appveyor DownloadFile https://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip -FileName sdl2-dev.zip
mkdir C:\sdl2
7z x sdl2-dev.zip -oC:\sdl2\ -y
cp C:\sdl2\SDL2-2.0.4\lib\%PLATFORM%\SDL2.lib C:\Rust\lib\rustlib\%RUST_INSTALL%\lib\SDL2.lib
cargo build
mkdir dist-debug
cp target\debug\steven.exe dist-debug
cp C:\sdl2\SDL2-2.0.4\lib\%PLATFORM%\SDL2.dll dist-debug
cp C:\tools\vcpkg\installed\%PLATFORM%-windows\bin\libeay32.dll dist-debug
cp C:\tools\vcpkg\installed\%PLATFORM%-windows\bin\ssleay32.dll dist-debug
cargo build --release
mkdir dist
cp target\release\steven.exe dist
cp C:\sdl2\SDL2-2.0.4\lib\%PLATFORM%\SDL2.dll dist
cp C:\tools\vcpkg\installed\%PLATFORM%-windows\bin\libeay32.dll dist
cp C:\tools\vcpkg\installed\%PLATFORM%-windows\bin\ssleay32.dll dist
artifacts:
- path: dist
- path: dist-debug