Skip to content

Commit

Permalink
Auto merge of #87 - indiv0:chore-appveyor-support, r=indiv0
Browse files Browse the repository at this point in the history
Add Appveyor Support

Add `appveyor.yml` with build instructions for Appveyor builds.

Closes #8.
  • Loading branch information
homu committed May 16, 2016
2 parents db2d345 + b099aad commit 39bd6d7
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 14 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,6 @@ A quick overview of the platforms and their status can be found below:
<td></td>
<td>64-bit MinGW (Windows 7+)</td>
</tr>
<tr>
<td>i686-pc-windows-msvc</td>
<td></td>
<td></td>
<td></td>
<td>32-bit MSVC (Windows 7+)</td>
</tr>
<tr>
<td>x86_64-pc-windows-msvc</td>
<td></td>
<td></td>
<td></td>
<td>64-bit MSVC (Windows 7+)</td>
</tr>
<tr>
<td>i686-apple-darwin</td>
<td></td>
Expand Down
111 changes: 111 additions & 0 deletions appveyor.yml
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

0 comments on commit 39bd6d7

Please sign in to comment.