-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #87 - indiv0:chore-appveyor-support, r=indiv0
Add Appveyor Support Add `appveyor.yml` with build instructions for Appveyor builds. Closes #8.
- Loading branch information
Showing
2 changed files
with
111 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
matrix: | ||
fast_finish: true | ||
allow_failures: | ||
- CHANNEL: nightly | ||
environment: | ||
global: | ||
# This will be used as part of the zipfile name | ||
PROJECT_NAME: colonize | ||
matrix: | ||
# Stable channel | ||
- TARGET: i686-pc-windows-gnu | ||
CHANNEL: stable | ||
MINGW_DIR: C:\msys64\mingw32\bin | ||
MBASH: C:\msys64\usr\bin\bash --login -c | ||
MSYS2_ARCH: i686 | ||
- TARGET: x86_64-pc-windows-gnu | ||
CHANNEL: stable | ||
MINGW_DIR: C:\msys64\mingw64\bin | ||
MBASH: C:\msys64\usr\bin\bash --login -c | ||
MSYS2_ARCH: x86_64 | ||
# Nightly channel | ||
- TARGET: i686-pc-windows-gnu | ||
CHANNEL: nightly | ||
MINGW_DIR: C:\msys64\mingw32\bin | ||
MBASH: C:\msys64\usr\bin\bash --login -c | ||
MSYS2_ARCH: i686 | ||
- TARGET: x86_64-pc-windows-gnu | ||
CHANNEL: nightly | ||
MINGW_DIR: C:\msys64\mingw64\bin | ||
MBASH: C:\msys64\usr\bin\bash --login -c | ||
MSYS2_ARCH: x86_64 | ||
|
||
# Install Rust and Cargo | ||
# (Based on https://github.com/rust-lang/libc/blob/master/appveyor.yml) | ||
install: | ||
# Install freetype on gnu builds | ||
- if DEFINED MINGW_DIR call %MBASH% "pacman -Syu --noconfirm mingw-w64-%MSYS2_ARCH%-freetype" | ||
# install rust | ||
- ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable" | ||
- ps: $env:RUST_VERSION = Get-Content channel-rust-stable | select -first 1 | %{$_.split('-')[1]} | ||
- if NOT "%CHANNEL%" == "stable" set RUST_VERSION=%CHANNEL% | ||
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:RUST_VERSION}-${env:TARGET}.exe" | ||
- rust-%RUST_VERSION%-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" | ||
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin | ||
# Set the PATH for gnu builds | ||
- if "%TARGET%" == "i686-pc-windows-gnu" set PATH=%PATH%;C:\msys64\mingw32\bin | ||
- if "%TARGET%" == "x86_64-pc-windows-gnu" set PATH=%PATH%;C:\msys64\mingw64\bin | ||
- set RUST_BACKTRACE=1 | ||
- rustc -V | ||
- cargo -V | ||
|
||
build: false | ||
|
||
# Equivalent to Travis' `script` phase | ||
test_script: | ||
- cargo build --verbose | ||
- cargo test --verbose | ||
|
||
before_deploy: | ||
# Generate artifacts for release | ||
- cargo rustc --release -- -C link_args="-Wl,--subsystem,windows -s" -C opt-level=3 | ||
- mkdir staging | ||
# Copy the artifacts | ||
- copy target\release\colonize.exe staging | ||
- copy -R assets staging | ||
- copy colonize.json.example staging | ||
# If using mingw, copy the necessary DLLs | ||
- ps: >- | ||
if (${env:MINGW_DIR}) { | ||
$dllList = ( | ||
"libbz2-1.dll", | ||
"libfreetype-6.dll", | ||
"libgcc_s_seh-1.dll", | ||
"libglib-2.0-0.dll", | ||
"libgraphite2.dll", | ||
"libharfbuzz-0.dll", | ||
"libiconv-2.dll", | ||
"libintl-8.dll", | ||
"libpcre-1.dll", | ||
"libpng16-16.dll", | ||
"libstdc++-6.dll", | ||
"libwinpthread-1.dll", | ||
"zlib1.dll" | ||
) | ||
foreach ($itemToCopy in $dllList) { | ||
Copy-Item -Path ${env:MINGW_DIR}/$itemToCopy -Destination staging | ||
} | ||
} | ||
- cd staging | ||
# Release zipfile will look like 'colonize-v1.2.3-x86_64-pc-windows-msvc' | ||
- 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * | ||
- appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip | ||
|
||
deploy: | ||
description: 'Windows release' | ||
# All the zipped artifacts will be deployed | ||
artifact: /.*\.zip/ | ||
auth_token: | ||
secure: oxFBGdBmg8tLcfvwisr8NdvtE0kD78vCinrE4gqxSlEpJcFT/boCFLhtEHhbqLNW | ||
provider: GitHub | ||
# deploy when a new tag is pushed and only on the stable channel | ||
on: | ||
# NOTE make sure you only release *once* per target | ||
CHANNEL: stable | ||
appveyor_repo_tag: true | ||
|
||
branches: | ||
only: | ||
- auto | ||
- master |