<commit_before>sudo: required
dist: trusty
group: travis_latest

services:
  - docker

language: node_js

os:
  - linux
  - osx

osx_image: xcode8.3

node_js:
  - '4'
  - '6'
  - '8'

env:
  global:
    - CI_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
    - secure: "<KEY> # DOCKER_EMAIL
    - secure: "<KEY> # DOCKER_USER
    - secure: "<KEY> # DOCKER_PASS
    - secure: "<KEY> # GITHUB_TOKEN
#    - secure: "<KEY> # CSC_LINK
#    - secure: "<KEY> # CSC_KEY_PASSWORD

cache:
  directories:
    - $HOME/.electron

addons:
  apt:
    packages:
      - icnsutils
      - graphicsmagick
      - gcc-multilib
      - g++-multilib

before_install:
  - git --version
  - git config --global user.name "Travis CI"
  - git config --global user.email "<EMAIL>"
  #
  # https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#os-x
  #
  # Use brew to install required packages.
  #
  # To build app in distributable format for Windows on OS X:
  # $ brew install Caskroom/cask/xquartz wine mono
  #
  # To build app in distributable format for Linux on OS X:
  # $ brew install ruby gnu-tar libicns graphicsmagick
  #
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update;
    fi
  - npm install -g npm
  - npm --version

install: travis_wait 40 npm install

script:
  - |
    if [[ -z "$TRAVIS_TAG" ]]; then
      npm run build-latest
    else
      npm run build
    fi

after_success:
  - npm run coveralls
  - mkdir -p releases
  - PRODUCT_NAME=CNCjs
  - PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
  - PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
  - RELEASE=${PACKAGE_NAME}-${PACKAGE_VERSION}
  - COMMIT_LOG=`git log -1 --format='%ci %H %s'`
  - |
    # build:mac-x64
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "osx" ]]; then
      # https://github.com/electron-userland/electron-builder/issues/398
      security import "scripts/certs/Certum-Code-Signing-CA-SHA2.cer" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign;
      # https://github.com/electron-userland/electron-osx-sign/issues/83
      # Temporarily Bypass Gatekeeper
      sudo spctl --master-disable;
      sudo spctl --status;
      npm run build:mac-x64;
      ls -al output output/*;
      cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/${RELEASE}-mac-x64.dmg";
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-mac-x64.dmg";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-mac-x64.dmg";
      fi
    fi
  - |
    # build:linux-ia32
    if [[ "$TRAVIS_BRANCH" = "master" && "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      npm run build:linux-ia32;
      ls -al output output/*;
      cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_i386.deb" "releases/${RELEASE}-linux-i386.deb";
      pushd releases;
      ln -sf ../output/linux-ia32-unpacked "${RELEASE}-linux-ia32";
      tar zcfh "${RELEASE}-linux-ia32.tar.gz" "${RELEASE}-linux-ia32";
      rm -f "${RELEASE}-linux-ia32";
      popd;
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-linux-i386.deb" "*-linux-ia32.tar.gz";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-linux-i386.deb" "releases/${RELEASE}-linux-ia32.tar.gz";
      fi
    fi
  - |
    # build:linux-x64
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      npm run build:linux-x64;
      ls -al output output/*;
      cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_amd64.deb" "releases/${RELEASE}-linux-amd64.deb";
      pushd releases;
      ln -sf ../output/linux-unpacked "${RELEASE}-linux-x64";
      tar zcfh "${RELEASE}-linux-x64.tar.gz" "${RELEASE}-linux-x64";
      rm -f "${RELEASE}-linux-x64";
      popd;
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-linux-amd64.deb" "*-linux-x64.tar.gz";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-linux-amd64.deb" "releases/${RELEASE}-linux-x64.tar.gz";
      fi
    fi
  - |
    # docker image
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      travis_wait scripts/travis-docker-build.sh;
    fi

before_deploy:
  - echo "Deploying to GitHub releases"
deploy:
  provider: releases
  api_key:
    secure: "<KEY>
  file_glob: true
  file:
    - 'releases/*.*'
  overwrite: true
  skip_cleanup: true
  on:
    # https://docs.travis-ci.com/user/deployment#Conditional-Releases-with-on
    tags: true  # Deploy app only when a tag is applied to the commit
    node: '8'
<commit_msg>Target on Node.js v6 for building Electron apps<commit_after>sudo: required
dist: trusty
group: travis_latest

services:
  - docker

language: node_js

os:
  - linux
  - osx

osx_image: xcode8.3

node_js:
  - '4'
  - '6'
  - '8'

env:
  global:
    - CI_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER
    - secure: "<KEY> # DOCKER_EMAIL
    - secure: "<KEY> # DOCKER_USER
    - secure: "<KEY> # DOCKER_PASS
    - secure: "<KEY> # GITHUB_TOKEN
#    - secure: "<KEY> # CSC_LINK
#    - secure: "<KEY> # CSC_KEY_PASSWORD

cache:
  directories:
    - $HOME/.electron

addons:
  apt:
    packages:
      - icnsutils
      - graphicsmagick
      - gcc-multilib
      - g++-multilib

before_install:
  - git --version
  - git config --global user.name "<NAME>"
  - git config --global user.email "<EMAIL>"
  #
  # https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#os-x
  #
  # Use brew to install required packages.
  #
  # To build app in distributable format for Windows on OS X:
  # $ brew install Caskroom/cask/xquartz wine mono
  #
  # To build app in distributable format for Linux on OS X:
  # $ brew install ruby gnu-tar libicns graphicsmagick
  #
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
      brew update;
    fi
  - npm install -g npm
  - npm --version

install: travis_wait 40 npm install

script:
  - |
    if [[ -z "$TRAVIS_TAG" ]]; then
      npm run build-latest
    else
      npm run build
    fi

after_success:
  - npm run coveralls
  - mkdir -p releases
  - PRODUCT_NAME=CNCjs
  - PACKAGE_NAME=`node -e "console.log(require('./src/package.json').name)"`
  - PACKAGE_VERSION=`node -e "console.log(require('./src/package.json').version)"`
  - RELEASE=${PACKAGE_NAME}-${PACKAGE_VERSION}
  - COMMIT_LOG=`git log -1 --format='%ci %H %s'`
  - |
    # build:mac-x64
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "6" && "$TRAVIS_OS_NAME" == "osx" ]]; then
      # https://github.com/electron-userland/electron-builder/issues/398
      security import "scripts/certs/Certum-Code-Signing-CA-SHA2.cer" -k ~/Library/Keychains/login.keychain -T /usr/bin/codesign;
      # https://github.com/electron-userland/electron-osx-sign/issues/83
      # Temporarily Bypass Gatekeeper
      sudo spctl --master-disable;
      sudo spctl --status;
      npm run build:mac-x64;
      ls -al output output/*;
      cp -af "output/${PRODUCT_NAME}-${PACKAGE_VERSION}.dmg" "releases/${RELEASE}-mac-x64.dmg";
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-mac-x64.dmg";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-mac-x64.dmg";
      fi
    fi
  - |
    # build:linux-ia32
    if [[ "$TRAVIS_BRANCH" = "master" && "$TRAVIS_NODE_VERSION" == "6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      npm run build:linux-ia32;
      ls -al output output/*;
      cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_i386.deb" "releases/${RELEASE}-linux-i386.deb";
      pushd releases;
      ln -sf ../output/linux-ia32-unpacked "${RELEASE}-linux-ia32";
      tar zcfh "${RELEASE}-linux-ia32.tar.gz" "${RELEASE}-linux-ia32";
      rm -f "${RELEASE}-linux-ia32";
      popd;
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-linux-i386.deb" "*-linux-ia32.tar.gz";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-linux-i386.deb" "releases/${RELEASE}-linux-ia32.tar.gz";
      fi
    fi
  - |
    # build:linux-x64
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "6" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      npm run build:linux-x64;
      ls -al output output/*;
      cp -af "output/${PACKAGE_NAME}_${PACKAGE_VERSION}_amd64.deb" "releases/${RELEASE}-linux-amd64.deb";
      pushd releases;
      ln -sf ../output/linux-unpacked "${RELEASE}-linux-x64";
      tar zcfh "${RELEASE}-linux-x64.tar.gz" "${RELEASE}-linux-x64";
      rm -f "${RELEASE}-linux-x64";
      popd;
      ls -al releases/*;
      if [[ -z "$TRAVIS_TAG" ]]; then
        npm run github-release -- delete \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          "*-linux-amd64.deb" "*-linux-x64.tar.gz";
        npm run github-release -- upload \
          --owner=cncjs \
          --repo=cncjs \
          --tag="${TRAVIS_BRANCH}-latest" \
          --name="${TRAVIS_BRANCH}" \
          --body="${COMMIT_LOG}" \
          "releases/${RELEASE}-linux-amd64.deb" "releases/${RELEASE}-linux-x64.tar.gz";
      fi
    fi
  - |
    # docker image
    if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_NODE_VERSION" == "8" && "$TRAVIS_OS_NAME" == "linux" ]]; then
      travis_wait scripts/travis-docker-build.sh;
    fi

before_deploy:
  - echo "Deploying to GitHub releases"
deploy:
  provider: releases
  api_key:
    secure: "<KEY>
  file_glob: true
  file:
    - 'releases/*.*'
  overwrite: true
  skip_cleanup: true
  on:
    # https://docs.travis-ci.com/user/deployment#Conditional-Releases-with-on
    tags: true  # Deploy app only when a tag is applied to the commit
    node: '6'

{'fraction_non_alphanumeric': 0.16951653502300149, 'fraction_numerical': 0.014495269507855221, 'mean_word_length': 2.2292600896860986, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5721724', 'n_tokens_mistral': 4415, 'n_tokens_neox': 4163, 'n_words': 806}