Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
150 lines (133 sloc) 6.38 KB
# Appveyor configuration template for Rust using rustup for Rust installation
# https://github.com/starkat99/appveyor-rust
#
# AppVeyor environment variables: https://www.appveyor.com/docs/environment-variables/
## Operating System (VM environment) ##
# Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets.
os: Visual Studio 2017
## Build Matrix ##
environment:
global:
GITHUB_TOKEN:
secure: 9IwzBZ/BmopG5LYT0We7UlSNHIDpJO/l4NebW1+A7IZuV/hDMAb8raLEbcV0gZXx
matrix:
### MSVC Targets ###
# Stable 64-bit MSVC
- target: x86_64-pc-windows-msvc
channel: stable
toolchain: stable-x86_64-pc-windows-msvc
target_env: msvc
# Stable 32-bit MSVC
# - channel: stable
# toolchain: stable-i686-pc-windows-msvc
# target: i686-pc-windows-msvc
# target_env: msvc
# mingw_subdir: mingw32
# mingw_target: i686-w64-mingw32
# mingw_package_prefix: mingw-w64-i686
### GNU Targets ###
# Stable 64-bit GNU
- target: x86_64-pc-windows-gnu
channel: stable
toolchain: stable-x86_64-pc-windows-msvc
target_env: gnu
mingw_subdir: mingw64
mingw_target: x86_64-w64-mingw32
mingw_package_prefix: mingw-w64-x86_64
# Stable 32-bit GNU
# - channel: stable
# toolchain: stable-i686-pc-windows-msvc
# target: i686-pc-windows-gnu
# target_env: gnu
# mingw_subdir: mingw32
# mingw_target: i686-w64-mingw32
# mingw_package_prefix: mingw-w64-i686
# This filter is misleadingly named and applies to both tags and branches.
#
# The context for our settings is the Tectonic continuous deployment model, in
# which Travis CI updates a tag named `continuous` for every push to master.
# Running builds and deployments based on that tag update, rather than
# directly on pushes to master, allows us to use the same logic to publish
# artifacts for both continuous deployment and for release tags.
#
# So, ideally our CI scripts should run in three circumstances: (1) pull
# requests, (2) release tags (`vX.Y.Z`), and (3) the `continuous` tag.
#
# It seems that AppVeyor won't build pull requests unless you activate builds
# for the `master` branch, though, so we need to include it here. Farther
# below we short-circuit and exit for pushes to master that are not PR builds.
branches:
only:
- continuous
- master
- /^v[0-9]\..*/
cache:
- '%USERPROFILE%\.cargo\bin'
- '%USERPROFILE%\.cargo\config'
- '%USERPROFILE%\.cargo\env'
- '%USERPROFILE%\.cargo\.crates.toml'
- target
## Install Script ##
# As mentioned above: short-circuit if this is a push to master that isn't a
# PR. Travis CI will update the `continuous` tag and we should trigger a build
# and deployment off of that instead. Annoyingly, AppVeyor considers tag
# pushes to also be pushes to master.
init:
- ps: if ($env:APPVEYOR_REPO_BRANCH -eq "master" -and !$env:APPVEYOR_PULL_REQUEST_TITLE -and !$env:APPVEYOR_REPO_TAG_NAME) {Exit-AppveyorBuild}
# This is the most important part of the Appveyor configuration. This installs the version of Rust
# specified by the 'channel' and 'target' environment variables from the build matrix. This uses
# rustup to install Rust.
#
# For simple configurations, instead of using the build matrix, you can simply set the
# default-toolchain and default-host manually here.
install:
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain %channel%-msvc --default-host %target%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- if "%target_env%" == "gnu" set PATH=C:\msys64\%mingw_subdir%\bin;C:\msys64\usr\bin;%PATH%
- rustup target add %target%
- rustup component add rust-src
- if "%target_env%" == "gnu" pacman -S --noconfirm "%mingw_package_prefix%-fontconfig" "%mingw_package_prefix%-freetype" "%mingw_package_prefix%-icu"
- if "%target_env%" == "msvc" git clone https://github.com/microsoft/vcpkg %USERPROFILE%\vcpkg
- if "%target_env%" == "msvc" call %USERPROFILE%\vcpkg\bootstrap-vcpkg.bat
- if "%target_env%" == "msvc" %USERPROFILE%\vcpkg\vcpkg install --triplet x64-windows-static fontconfig freetype harfbuzz[icu,graphite2]
- if "%target_env%" == "msvc" set VCPKG_ROOT=%USERPROFILE%\vcpkg
- if "%target_env%" == "msvc" set TECTONIC_DEP_BACKEND=vcpkg
- if "%target_env%" == "msvc" set RUSTFLAGS=-Ctarget-feature=+crt-static
- rustc -vV
- cargo -vV
## Build Script ##
# 'cargo test' takes care of building for us, so disable Appveyor's build stage. This prevents
# the "directory does not contain a project or solution file" error.
build: false
before_test:
- set RUST_BACKTRACE=1
# Building on msvc toolchain is seen as cross compilation.
- set PKG_CONFIG_ALLOW_CROSS=1
# Workaround rust#53454
- if "%target_env%" == "gnu" copy /y "C:\msys64\%mingw_subdir%\%mingw_target%\lib\crt2.o" "%USERPROFILE%\.rustup\toolchains\%toolchain%\lib\rustlib\%target%\lib\crt2.o"
- if "%target_env%" == "gnu" copy /y "C:\msys64\%mingw_subdir%\%mingw_target%\lib\dllcrt2.o" "%USERPROFILE%\.rustup\toolchains\%toolchain%\lib\rustlib\%target%\lib\dllcrt2.o"
# Dodge format file locking issue in the test suite
- set RUST_TEST_THREADS=1
# Settings for continuous deployment. %var:~,1% is first character of $var,
# %var:~1% is all but the first character. For some reason, if
# APPVEYOR_REPO_TAG_NAME is left undefined, I get bizarre batch syntax
# errors that I can't reproduce locally or figure out how to fix.
- if not defined APPVEYOR_REPO_TAG_NAME set APPVEYOR_REPO_TAG_NAME=notag
- if "%APPVEYOR_REPO_TAG_NAME%" == "continuous" set VERSION_TEXT=latest
- if "%APPVEYOR_REPO_TAG_NAME:~,1%" == "v" set VERSION_TEXT=%APPVEYOR_REPO_TAG_NAME:~1%
# Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs
# directly or perform other testing commands. Rust will automatically be placed in the PATH
# environment variable.
test_script:
- cargo test --target %target% --release
- copy target\%target%\release\tectonic.exe tectonic-%VERSION_TEXT%-%target%.exe
artifacts:
- path: 'tectonic-*-$(target).exe'
name: 'Tectonic executable for $(target)'
deploy_script:
- ps: |
If ($env:APPVEYOR_REPO_TAG_NAME -ne "notag") {
appveyor-retry appveyor DownloadFile https://github.com/tectonic-typesetting/tectonic-ci-support/releases/download/production/ttcitool-latest-x86_64-pc-windows-msvc.exe -FileName ttcitool.exe
.\ttcitool.exe upload-gh-artifact tectonic-${env:VERSION_TEXT}-${env:target}.exe
}
You can’t perform that action at this time.