|
| 1 | +matrix: |
| 2 | + fast_finish: true |
| 3 | + allow_failures: |
| 4 | + - CHANNEL: nightly |
| 5 | +environment: |
| 6 | + global: |
| 7 | + # This will be used as part of the zipfile name |
| 8 | + PROJECT_NAME: colonize |
| 9 | + matrix: |
| 10 | + # Stable channel |
| 11 | + - TARGET: i686-pc-windows-gnu |
| 12 | + CHANNEL: stable |
| 13 | + MINGW_DIR: C:\msys64\mingw32\bin |
| 14 | + MBASH: C:\msys64\usr\bin\bash --login -c |
| 15 | + MSYS2_ARCH: i686 |
| 16 | + - TARGET: x86_64-pc-windows-gnu |
| 17 | + CHANNEL: stable |
| 18 | + MINGW_DIR: C:\msys64\mingw64\bin |
| 19 | + MBASH: C:\msys64\usr\bin\bash --login -c |
| 20 | + MSYS2_ARCH: x86_64 |
| 21 | + # Nightly channel |
| 22 | + - TARGET: i686-pc-windows-gnu |
| 23 | + CHANNEL: nightly |
| 24 | + MINGW_DIR: C:\msys64\mingw32\bin |
| 25 | + MBASH: C:\msys64\usr\bin\bash --login -c |
| 26 | + MSYS2_ARCH: i686 |
| 27 | + - TARGET: x86_64-pc-windows-gnu |
| 28 | + CHANNEL: nightly |
| 29 | + MINGW_DIR: C:\msys64\mingw64\bin |
| 30 | + MBASH: C:\msys64\usr\bin\bash --login -c |
| 31 | + MSYS2_ARCH: x86_64 |
| 32 | + |
| 33 | +# Install Rust and Cargo |
| 34 | +# (Based on https://github.com/rust-lang/libc/blob/master/appveyor.yml) |
| 35 | +install: |
| 36 | + # Install freetype on gnu builds |
| 37 | + - if DEFINED MINGW_DIR call %MBASH% "pacman -Syu --noconfirm mingw-w64-%MSYS2_ARCH%-freetype" |
| 38 | + # install rust |
| 39 | + - ps: Start-FileDownload "https://static.rust-lang.org/dist/channel-rust-stable" |
| 40 | + - ps: $env:RUST_VERSION = Get-Content channel-rust-stable | select -first 1 | %{$_.split('-')[1]} |
| 41 | + - if NOT "%CHANNEL%" == "stable" set RUST_VERSION=%CHANNEL% |
| 42 | + - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:RUST_VERSION}-${env:TARGET}.exe" |
| 43 | + - rust-%RUST_VERSION%-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" |
| 44 | + - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin |
| 45 | + # Set the PATH for gnu builds |
| 46 | + - if "%TARGET%" == "i686-pc-windows-gnu" set PATH=%PATH%;C:\msys64\mingw32\bin |
| 47 | + - if "%TARGET%" == "x86_64-pc-windows-gnu" set PATH=%PATH%;C:\msys64\mingw64\bin |
| 48 | + - set RUST_BACKTRACE=1 |
| 49 | + - rustc -V |
| 50 | + - cargo -V |
| 51 | + |
| 52 | +build: false |
| 53 | + |
| 54 | +# Equivalent to Travis' `script` phase |
| 55 | +test_script: |
| 56 | + - cargo build --verbose |
| 57 | + - cargo test --verbose |
| 58 | + |
| 59 | +before_deploy: |
| 60 | + # Generate artifacts for release |
| 61 | + - cargo rustc --release -- -C link_args="-Wl,--subsystem,windows -s" -C opt-level=3 |
| 62 | + - mkdir staging |
| 63 | + # Copy the artifacts |
| 64 | + - copy target\release\colonize.exe staging |
| 65 | + - copy -R assets staging |
| 66 | + - copy colonize.json.example staging |
| 67 | + # If using mingw, copy the necessary DLLs |
| 68 | + - ps: >- |
| 69 | + if (${env:MINGW_DIR}) { |
| 70 | + $dllList = ( |
| 71 | + "libbz2-1.dll", |
| 72 | + "libfreetype-6.dll", |
| 73 | + "libgcc_s_seh-1.dll", |
| 74 | + "libglib-2.0-0.dll", |
| 75 | + "libgraphite2.dll", |
| 76 | + "libharfbuzz-0.dll", |
| 77 | + "libiconv-2.dll", |
| 78 | + "libintl-8.dll", |
| 79 | + "libpcre-1.dll", |
| 80 | + "libpng16-16.dll", |
| 81 | + "libstdc++-6.dll", |
| 82 | + "libwinpthread-1.dll", |
| 83 | + "zlib1.dll" |
| 84 | + ) |
| 85 | +
|
| 86 | + foreach ($itemToCopy in $dllList) { |
| 87 | + Copy-Item -Path ${env:MINGW_DIR}/$itemToCopy -Destination staging |
| 88 | + } |
| 89 | + } |
| 90 | + - cd staging |
| 91 | + # Release zipfile will look like 'colonize-v1.2.3-x86_64-pc-windows-msvc' |
| 92 | + - 7z a ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip * |
| 93 | + - appveyor PushArtifact ../%PROJECT_NAME%-%APPVEYOR_REPO_TAG_NAME%-%TARGET%.zip |
| 94 | + |
| 95 | +deploy: |
| 96 | + description: 'Windows release' |
| 97 | + # All the zipped artifacts will be deployed |
| 98 | + artifact: /.*\.zip/ |
| 99 | + auth_token: |
| 100 | + secure: oxFBGdBmg8tLcfvwisr8NdvtE0kD78vCinrE4gqxSlEpJcFT/boCFLhtEHhbqLNW |
| 101 | + provider: GitHub |
| 102 | + # deploy when a new tag is pushed and only on the stable channel |
| 103 | + on: |
| 104 | + # NOTE make sure you only release *once* per target |
| 105 | + CHANNEL: stable |
| 106 | + appveyor_repo_tag: true |
| 107 | + |
| 108 | +branches: |
| 109 | + only: |
| 110 | + - auto |
| 111 | + - master |
0 commit comments