]>
Commit | Line | Data |
---|---|---|
ea8adc8c XL |
1 | environment: |
2 | global: | |
3 | PROJECT_NAME: mdBook | |
ea8adc8c XL |
4 | matrix: |
5 | # Stable channel | |
6 | - TARGET: i686-pc-windows-msvc | |
7 | RUST_CHANNEL: stable | |
8 | - TARGET: x86_64-pc-windows-msvc | |
9 | RUST_CHANNEL: stable | |
ea8adc8c | 10 | # Nightly channel |
ea8adc8c XL |
11 | - TARGET: x86_64-pc-windows-msvc |
12 | RUST_CHANNEL: nightly | |
13 | ||
14 | # Install Rust and Cargo | |
15 | install: | |
416331ca XL |
16 | # Since rust-lang-libs is currently sharing 1 builder, only run 1 job when a |
17 | # PR is opened. Merges to master or tags will run all jobs. | |
18 | - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -gt 0 -and ($env:TARGET -ne "x86_64-pc-windows-msvc" -or $env:RUST_CHANNEL -ne "stable") ) {Exit-AppveyorBuild} | |
ea8adc8c XL |
19 | - ps: >- |
20 | If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') { | |
21 | $Env:PATH += ';C:\msys64\mingw64\bin' | |
22 | } ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') { | |
23 | $Env:PATH += ';C:\msys64\mingw32\bin' | |
24 | } | |
25 | - curl -sSf -o rustup-init.exe https://win.rustup.rs/ | |
26 | - rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_CHANNEL% | |
27 | - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin | |
28 | - rustc -Vv | |
29 | - cargo -V | |
ea8adc8c XL |
30 | |
31 | build: false | |
32 | ||
33 | # Equivalent to Travis' `script` phase | |
34 | test_script: | |
9fa01778 XL |
35 | - cargo test --all |
36 | - cargo test --all --no-default-features | |
ea8adc8c XL |
37 | |
38 | before_deploy: | |
39 | # Generate artifacts for release | |
9fa01778 | 40 | - cargo rustc --bin mdbook --release -- -C lto |
ea8adc8c XL |
41 | - mkdir staging |
42 | - copy target\release\mdbook.exe staging | |
43 | - cd staging | |
44 | - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * | |
45 | - appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip | |
46 | ||
47 | deploy: | |
48 | description: 'Windows release' | |
49 | artifact: /.*\.zip/ | |
dc9dc135 | 50 | auth_token: $(GITHUB_TOKEN) |
ea8adc8c XL |
51 | provider: GitHub |
52 | on: | |
53 | RUST_CHANNEL: stable | |
54 | appveyor_repo_tag: true | |
55 | ||
56 | branches: | |
57 | only: | |
58 | - master | |
9fa01778 | 59 | - /^v\d+\.\d+\.\d+.*$/ |