wesers 0.4.1

a simple HTTP/HTTPS server in Rust
language: rust
cache: cargo

env:
  global:
    # This will be part of the release tarball
    - PROJECT_NAME=wesers
    - MAKE_DEB=yes
    - DEB_MAINTAINER="Chiu-Hsiang Hsu <wdv4758h@gmail.com>"
    - DEB_DESCRIPTION="a simple HTTP/HTTPS server in Rust"

# AFAICT There are a few ways to set up the build jobs. This one is not the DRYest but I feel is the
# easiest to reason about.
# NOTE Make *sure* you don't remove a reference (&foo) if you are going to dereference it (*foo)
matrix:
  include:
    # # Stable channel
    # - os: linux
    #   rust: stable
    #   env: TARGET=aarch64-unknown-linux-gnu
    #   # need Trusty because the glibc in Precise is too old and doesn't support 64-bit arm
    #   dist: trusty
    #   sudo: required
    #   # Extra packages only for this job
    #   addons:
    #     apt:
    #       packages: &aarch64_unknown_linux_gnu
    #         # Transparent emulation
    #         - qemu-user-static
    #         - binfmt-support
    # - os: linux
    #   rust: stable
    #   env: TARGET=armv7-unknown-linux-gnueabihf
    #   # sudo is needed for binfmt_misc, which is needed for transparent user qemu emulation
    #   sudo: required
    #   addons:
    #     apt:
    #       packages: &armv7_unknown_linux_gnueabihf
    #         # Cross compiler and cross compiled C libraries
    #         - gcc-arm-linux-gnueabihf
    #         - libc6-armhf-cross
    #         - libc6-dev-armhf-cross
    #         # Transparent emulation
    #         - qemu-user-static
    #         - binfmt-support
    # - os: osx
    #   rust: stable
    #   env: TARGET=i686-apple-darwin
    # - os: linux
    #   rust: stable
    #   env: TARGET=i686-unknown-linux-gnu
    #   addons:
    #     apt:
    #       packages: &i686_unknown_linux_gnu
    #         # Cross compiler and cross compiled C libraries
    #         - gcc-multilib
    # - os: linux
    #   rust: stable
    #   env: TARGET=i686-unknown-linux-musl
    # - os: osx
    #   rust: stable
    #   env: TARGET=x86_64-apple-darwin
    # - os: linux
    #   rust: stable
    #   env: TARGET=x86_64-unknown-linux-gnu
    # - os: linux
    #   rust: stable
    #   env: TARGET=x86_64-unknown-linux-musl
    # # Beta channel
    # - os: linux
    #   rust: beta
    #   env: TARGET=aarch64-unknown-linux-gnu
    #   dist: trusty
    #   sudo: required
    #   addons:
    #     apt:
    #       packages: *aarch64_unknown_linux_gnu
    # - os: linux
    #   rust: beta
    #   env: TARGET=armv7-unknown-linux-gnueabihf
    #   sudo: required
    #   addons:
    #     apt:
    #       # Use the same packages the stable version uses
    #       packages: *armv7_unknown_linux_gnueabihf
    # - os: osx
    #   rust: beta
    #   env: TARGET=i686-apple-darwin
    # - os: linux
    #   rust: beta
    #   env: TARGET=i686-unknown-linux-gnu
    #   addons:
    #     apt:
    #       packages: *i686_unknown_linux_gnu
    # - os: linux
    #   rust: beta
    #   env: TARGET=i686-unknown-linux-musl
    # - os: osx
    #   rust: beta
    #   env: TARGET=x86_64-apple-darwin
    # - os: linux
    #   rust: beta
    #   env: TARGET=x86_64-unknown-linux-gnu
    # - os: linux
    #   rust: beta
    #   env: TARGET=x86_64-unknown-linux-musl
    #
    # Nightly channel
    #
    # TODO, open beta and stable channel when feature(stmt_expr_attributes) is OK
    # TODO, need to figure out how to let Travis CI cross-compile with OpenSSL's ARM version
    # TODO, need to figure out how to build statically linked with OpenSSL
    #     or make it use ld-linux-x86-64.so.2 as dynamic linker instead of /lib/ld64.so.1
    #     or run it by ld-linux-x86-64.so.2 to make CI pass
    - os: linux
      rust: nightly
      env: TARGET=aarch64-unknown-linux-gnu
      dist: trusty
      sudo: required
      addons:
        apt:
          packages: &aarch64_unknown_linux_gnu
            # Transparent emulation
            - qemu-user-static
            - binfmt-support
    - os: linux
      rust: nightly
      env: TARGET=armv7-unknown-linux-gnueabihf
      sudo: required
      addons:
        apt:
          packages: &armv7_unknown_linux_gnueabihf
            # Cross compiler and cross compiled C libraries
            - gcc-arm-linux-gnueabihf
            - libc6-armhf-cross
            - libc6-dev-armhf-cross
            # Transparent emulation
            - qemu-user-static
            - binfmt-support
    - os: osx
      rust: nightly
      env: TARGET=i686-apple-darwin
    - os: linux
      rust: nightly
      env: TARGET=i686-unknown-linux-gnu
      addons:
        apt:
          packages: &i686_unknown_linux_gnu
            # Cross compiler and cross compiled C libraries
            - gcc-multilib
    - os: linux
      rust: nightly
      env: TARGET=i686-unknown-linux-musl
    - os: osx
      rust: nightly
      env: TARGET=x86_64-apple-darwin
    - os: linux
      rust: nightly
      env: TARGET=x86_64-unknown-linux-gnu
    - os: linux
      rust: nightly
      env: TARGET=x86_64-unknown-linux-musl
  allow_failures:
    - os: linux
      rust: nightly
      env: TARGET=i686-unknown-linux-musl
    - os: linux
      rust: nightly
      env: TARGET=x86_64-unknown-linux-musl

before_install:
  - export PATH="$PATH:$HOME/.cargo/bin"

install:
  - bash ci/install.sh

script:
  - bash ci/script.sh

before_deploy:
  - bash ci/before_deploy.sh

deploy:
  provider: releases
  # - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
  # `public_repo` scope enabled
  # - Call `travis encrypt $github_token` where $github_token is the token you got in the previous
  # step and `travis` is the official Travis CI gem (see https://rubygems.org/gems/travis/)
  # - Enter the "encrypted value" below
  api_key:
    secure: NuWT9JWQ6GhuqQQ3VdcHswOUsAhJo/0do4hJuc5By3KmDXUuhXkyekGJCId0G2CTP93zOjRHBS29gSaUCqsAacmScOId7MrB51W/h9Ig+SxhT0iediDipP7sEPi/TCHctRJ81XVcdaOhOssTG4GifXZ+Eku3grsCHF3zfza4iLGUQ27JNi7lURvZVTf7uVWi/FJ4v494d6TF2DDl7k22qF/DfZJgfcpQENYYLGd1uwZaWrI+5bL0G1mQ6Cw4ZwNoNHF7/EOOno9B4L/LnoBr8YcuVHoPjpe8c47deKm52s43pE8zwkMEwGXki7611Pr5KNDPfqYoEOuffCQBrGh/rs+JnkLf8WM9hfWJhYi8MgQBQmgt2n06ZxKvNcf2q+TPVHKLO9qPQpSDQbF+SOOS37y2Z1PYLVz17G4qxizhudVrTXD6NcUYK2P0xC8PCeCzzt+xbdaKyD6KJYCPSQ5/9f+TzitcqLnvcPTnPYa3kmkctuSgKig5xSBfGKq62A9URFDw48bQWRoe5XH4cU4u+xe4P9r2OEdMkNAZGIXNbPPWSJpovUNVHL59jUMmYg7HnvG0h2DNh8+CImp5BKtSY4EaY0M/c7bUZpvoY6GLEgj8+XUiLYTl/VrLZvJWjnZpS4XPVequtOYJNWST/7MX8trsDQjGwre4Gh+K0Jz7afU=
  file_glob: true
  file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.*
  # don't delete the artifacts from previous phases
  skip_cleanup: true
  # deploy when a new tag is pushed
  on:
    # channel to use to produce the release artifacts
    # NOTE make sure you only release *once* per target
    condition: $TRAVIS_RUST_VERSION = nightly
    tags: true

branches:
  only:
    # Pushes and PR to the master branch
    - master
    # IMPORTANT Ruby regex to match tags. Required, or travis won't trigger deploys when a new tag
    # is pushed. This regex matches semantic versions like v1.2.3-rc4+2016.02.22
    - /^v\d+\.\d+\.\d+.*$/

notifications:
  email:
    on_success: never