From 4a305941fdbe139b6b48dc0c031d30dd6c7e75e8 Mon Sep 17 00:00:00 2001 From: Jun Han Date: Wed, 29 Nov 2017 15:59:35 +0800 Subject: [PATCH] Automatic release in CI (#20) * Automatic release in CI * Run test after build --- .travis.yml | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 581cd4ef..1386306a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,37 @@ sudo: false language: node_js node_js: - - "node" +- node os: - - osx - - linux - +- osx +- linux before_install: - - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - sleep 3; - fi - +- if [ $TRAVIS_OS_NAME == "linux" ]; then export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; + sh -e /etc/init.d/xvfb start; sleep 3; fi install: - - npm install - - npm run vscode:prepublish - +- npm install +- npm install -g vsce script: - - npm run tslint - - npm test --silent \ No newline at end of file +- npm run tslint +- vsce package +- npm test --silent +deploy: +- provider: releases + skip_cleanup: true + api_key: "$GIT_TOKEN" + file_glob: true + file: "*.vsix" + on: + tags: true + condition: "$TRAVIS_OS_NAME == linux" +- provider: script + skip_cleanup: true + script: vsce publish -p $VSCE_TOKEN --packagePath *.vsix + on: + tags: true + condition: "$TRAVIS_OS_NAME == linux && $TRAVIS_TAG =~ $ISPRODTAG" +env: + global: + - ISPRODTAG=^v?[0-9]+\.[0-9]+\.[0-9]+$ + - secure: naq0cSeZte9cjXrvz8zbpTLSa3FFJH1nUtEhgEt/6SPjMRFdwCH2uHIwg9CvPd/kUlpBc0HpqX+f3Zj/xRldnBXYSB/6yvFJcajjYPaRzFobqIpFzSchQHEFRVZLXbKfi6GqeAezieLadmuFP8Mae3/JcNBhxyVTjiMQQOoyCAOwZMK+GufwutcFC1F7h/ibJsk5N1IqVk+MtkmvezA9Ni4Z1gNptOVhZox5d1T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