Codebase list bettercap / upstream/latest .travis.yml
upstream/latest

Tree @upstream/latest (Download .tar.gz)

.travis.yml @upstream/latestraw · history · blame

# Globals
language: go
go:
  - 1.16.x
env:
  global:
    - VERSION=$(echo ${TRAVIS_BRANCH} | sed "s/\//_/g")
    - OUTPUT="bettercap"
cache:
  apt: true

# Includes
linux_deps: &linux_deps
  os: linux
  dist: bionic
  addons:
    apt:
      packages:
        - p7zip-full
        - libpcap-dev
        - libnetfilter-queue-dev
        - libusb-1.0-0-dev
      update: true

finish: &finish
  after_success:
    - file "${OUTPUT}"
    - openssl dgst -sha256 "${OUTPUT}" | tee bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.sha256
    - 7z a "bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.zip" "${OUTPUT}" "bettercap_${TARGET_OS}_${TARGET_ARCH}_${VERSION}.sha256"
    - ls -la bettercap*

cross_deps: &cross_deps
  <<: *linux_deps
  before_install:
    - wget --show-progress -qcO "qemu.deb" "https://debian.grena.ge/debian/pool/main/q/qemu/qemu-user-static_5.2+dfsg-6+b1_amd64.deb"
    - sudo dpkg -i "qemu.deb"

normal_install: &normal_install
  install:
    - make -e TARGET="${OUTPUT}"
  <<: *finish

cross_install: &cross_install
  install:
    - sudo builder/arm_builder.sh bettercap make -e TARGET="${OUTPUT}"
  <<: *finish

# Tasks
matrix:
  include:
    - name: Linux - amd64
      if: tag IS present
      arch: amd64
      env:
        - TARGET_OS=linux
        - TARGET_ARCH=amd64
      <<: *linux_deps
      <<: *normal_install

    - name: Linux - aarch64
      if: tag IS present
      arch: arm64
      env:
        - TARGET_OS=linux
        - TARGET_ARCH=aarch64
        - GEM_HOME=~/.ruby
        - PATH=$PATH:~/.ruby/bin
      <<: *linux_deps
      <<: *normal_install
      before_install:
        - mkdir -p ~/.ruby

    - name: Linux - armhf
      if: tag IS present
      language: minimal
      arch: amd64
      env:
        - TARGET_OS=linux
        - TARGET_ARCH=armhf
      <<: *cross_deps
      <<: *cross_install

    - name: OSX - amd64
      if: tag IS present
      os: osx
      arch: amd64
      addons:
        homebrew:
          packages:
            - libpcap
            - libusb
            - p7zip
          update: true
      env:
        - TARGET_OS=darwin
        - TARGET_ARCH=amd64
        - PATH="/usr/local/opt/libpcap/bin:$PATH"
        - LDFLAGS="-L/usr/local/opt/libpcap/lib $LDFLAGS"
        - CPPFLAGS="-I/usr/local/opt/libpcap/include $CPPFLAGS"
        - PKG_CONFIG_PATH="/usr/local/opt/libpcap/lib/pkgconfig:$PKG_CONFIG_PATH"
      <<: *normal_install

    - name: Windows - amd64
      if: tag IS present
      os: windows
      arch: amd64
      env:
        - TARGET_OS=windows
        - TARGET_ARCH=amd64
        - PKG_CONFIG_PATH="c:/pkg-config"
        - OUTPUT=bettercap.exe
        - CGO_CFLAGS="-I/c/winpcap/WpdPack/Include -I/c/libusb/include/libusb-1.0"
        - CGO_LDFLAGS="-L/c/winpcap/WpdPack/Lib/x64 -L/c/libusb/MinGW64/static"
      before_install:
        - choco install openssl.light -y
        - choco install make -y
        - choco install 7zip -y
        - choco install pkgconfiglite -y
        - mkdir /c/pkg-config
        - choco install zadig -y
        - curl -L "https://github.com/libusb/libusb/releases/download/v1.0.24/libusb-1.0.24.7z" -o "/c/libusb.7z"
        - 7z x -y "/c/libusb.7z" -o"/c/libusb"
        - cp builder/libusb.pc /c/pkg-config/libusb.pc
        - cp builder/libusb.pc /c/pkg-config/libusb-1.0.pc
        - choco install winpcap -y
        - curl -L "https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip" -o "c:/wpcap-sdk.zip"
        - 7z x -y "/c/wpcap-sdk.zip" -o"/c/winpcap"
 
      <<: *normal_install

    - name: Linux - tests
      if: tag IS blank
      os: linux
      arch: amd64
      allow_failures:
        - go: master
      fast_finish: true
      <<: *linux_deps
      script:
        - env GO111MODULE=on make test
      after_success:
        - base <(curl -s https://codecov.io/bash)

deploy:
  provider: releases
  api_key:
    secure: gaQDeYOe/8lL3++jok73kSNtJVyj5Dk8RdxerjSa3hsVrL5IljsNsGGXocesCQ4ubFrnOO26RmO1FxMKmqYBpewRwQ6GKqZjc7IbwR9Cy0c0AyRRULnCsXue3NxIQBobqAwKtaaqDPHZcX1eOVgDnrheMpT5nt9YN2Xyv9zdFAmjfhUxv8K3nyv9eOMHYy0TmcKanQSXcYTHnUONt4Af5XA2NZGTtLUB+FAEf93vLqyqmmkX0EJciYu3HSZmCPFLLACi1WDSvt+e4TlozrutMpgm3JNzZ3eg6IsesRzxy/s2HeOnVJLMCadGjqap98xfSY6V00cUdCny+n8xfDgCzMljM0bEMDUhIs97AFdLXJZKPRGrNSmnurIcJ+NaVrFS5BMiLwQ2J6WiRvDaCWROVd+Vml/bWWZIUsMxVapEN5vbtw8R/gSVQyZnZUXLrArIBQxenSFlMcWDi+VMF38GrQgAB/ddlMZqWjVubpWOSN45Eity0SsLAgsAuNjH1YCeCr0zj1sG08NPsnTPSKr+661iuOTpsdgu/4crF6qcFcl/kvJsw6tyFPVLO5yzbX9q4O778vXRduzPuBeD63eFuHD8pwceGxWWxN9vnQtX6OqRKmEsrLP7aL9dkI2zgp7TOj058hNQefQ5FD25yfKNCUfp/tnxa6XrkrPzWq/SX7c=
  skip_cleanup: true
  file_glob: true
  file:
    - bettercap_*.zip
    - bettercap_*.sha256
  on:
    tags: true
    repo: bettercap/bettercap
  branches:
    only:
      - "/^v[0-9]+\\.[0-9]+\\.[0-9]+[A-Za-z0-9]+?$/"