From 5623e8bb0395f900af66be6c8f136859922da9d2 Mon Sep 17 00:00:00 2001 From: Dan Graham Date: Wed, 15 Feb 2017 13:16:34 -0800 Subject: [PATCH] Add Travis deployment script --- .travis.yml | 49 +++++++++++++++++++++++++++++++++++++++ appveyor.yml | 29 +++++++++++++++++++++++ package.json | 2 +- test/e2e/main-e2e.test.js | 13 +++++++++-- 4 files changed, 90 insertions(+), 3 deletions(-) create mode 100644 .travis.yml create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..2fafb77e4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,49 @@ +language: c +sudo: required +node: +matrix: + include: + # - os: osx # Uncomment this when OSX becomes less flaky + - os: linux + env: CC=clang CXX=clang++ npm_config_clang=1 + compiler: clang +node_js: +- '7' +before_install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends + -y icnsutils graphicsmagick xz-utils; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export RELEASE_FILE_PATH='release/*.AppImage'; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export RELEASE_FILE_PATH='release/mac/*.app'; fi + - echo "Deploying to $RELEASE_FILE_PATH" +addons: + apt: + packages: + - xvfb +before_script: +- node --version +- npm install +- npm install -g electron +- node --version +- npm run package || true # TODO: Remove this once electron-builder has a new version that includes dpgraham's PR (https://github.com/electron-userland/electron-builder/pull/1274) +cache: + directories: + - node_modules + - "$HOME/.electron" + - "$HOME/.cache" +script: +- npm run e2e +install: +- nvm install 7 +- export DISPLAY=':99.0' +- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & +dist: trusty +deploy: + provider: releases + skip_cleanup: true + file_glob: true + file: "${RELEASE_FILE_PATH}" + api_key: + secure: oEQR3OIKVftqOwPOagzN7/RPw4fJjK64gbg4ziq9TUcsMSKHxI5kpoWLJPnahyMtO7Vkj6ee7Xy3QJXPJ1fl0ZX7Mo8P3t+bl3bKMfQBv1ld6iBMgrNxnB0ABd9084n4pfYAbV7N5g5ZkX9oV4ExcJWPKD2eSp3AaiyguPit3JpGwlSOsJByg1vCmB9yDgfo5dih9gEuId+tF/1ylpATqA+3rijtRdNOmoTTNXxmN+o/Hu8GzqP8LmlucGUqOKIyhM46/6ypWVtTWpmu5KAx3qXkqTed/S4I+VZ1EC7EigXPX2MD09w2/d44udGWJGAHVSGDNUTH3Kex6QT/2VPJ72CKUm7RV/xrKudx+6MhprbYkcsi0HdcbpMz0c3L30ps6src3S1zBQHC69RZrL/5WgFdEm0uG/i//SaYVuAD1dO7+0lBxnPqQrft3sdj6qOkAP1w9cUbNeYTihojyzTlgbrL1XsGji3M2Ir0DF4AxRdFI2vnyEmrZDtJKynGYBlfMFFc9RGTrFGSq1hP03/E7Hhg+BOnMDrfkPM2TXlj/xdhxeRzC9qtUwVyulEQrsdHV0ALzwC4eXR/w0xygABqhTM8GxodPQmBK1W9sP9DZy0YiEzWwMPKsWYkSDyqXUcfkX+sp37d0lTuWpDjWzyZ3GYrT+6STVTnyU5NZ5FT6VE= + on: + repo: dpgraham/appium-desktop + tags: true diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..c4b03f8f7 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +environment: + nodejs_version: "6" + +install: + - ps: Install-Product node $env:nodejs_version + - npm install + +test_script: + - node --version + - npm --version + - npm run package + #- npm run e2e # TODO: How to make script windows compatible? + +build: off + +artifacts: + - path: 'release\Appium*.exe' + +# TODO: How to deploy AppVeyor without overwriting tag +#deploy: + #description: 'Windows release' + #provider: GitHub + #force_update: true + #auth_token: + #secure: KqmUhAUI3Hhu13HH8pCYpleGyFrTpj+CxB4+yrvUMgPqiYoGamgD9x0DV8lOkGfR + #artifact: /Appium-Setup-*.exe/ + #on: + #branch: master + #appveyor_repo_tag: true \ No newline at end of file diff --git a/package.json b/package.json index 233baebfa..58fc62afc 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "appId": "io.appium.desktop", "category": "public.app-category.tools", "asar": false, + "artifactName": "Appium", "directories": { "output": "release" }, @@ -75,7 +76,6 @@ }, "linux": { "target": [ - "deb", "AppImage" ] } diff --git a/test/e2e/main-e2e.test.js b/test/e2e/main-e2e.test.js index b6488b5ef..f675c7aee 100644 --- a/test/e2e/main-e2e.test.js +++ b/test/e2e/main-e2e.test.js @@ -1,10 +1,19 @@ var Application = require('spectron').Application; var assert = require('assert'); +var os = require('os'); +var platform = os.platform(); describe('application launch', function () { - this.timeout(30000); + this.timeout(process.env.TRAVIS ? 10 * 60 * 1000 : 30 * 1000); - var app = __dirname + '/../../release/mac/Appium.app/Contents/MacOS/Appium'; + var app = __dirname; + if (platform === 'linux') { + app += '/../../release/linux-unpacked/appium-desktop'; + } else if (platform === '') { + app += '/../../release/mac/Appium.app/Contents/MacOS/Appium'; + } else if (platform === 'win32') { + app += '../../release/win-ia32-unpacked/Appium.exe'; + } beforeEach(function () { this.app = new Application({