forked from microsoft/vscode-iot-workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
105 lines (96 loc) · 3.22 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
language: node_js
node_js:
- 'node'
services:
- docker
os:
- linux
dist: trusty # using Ubuntu 14.04.5 LTS
branches:
only:
- master
- develop
- /v?[0-9]+\.[0-9]+\.[0-9]+(.*)?/
env:
global:
- ISPRODTAG=^v?[0-9]+\.[0-9]+\.[0-9]+$
- ISTESTTAG=^v?[0-9]+\.[0-9]+\.[0-9]+-[rR][cC]
- RC_EXTENSION_ID="dilin.test-owl-project"
- NIGHTLY_BUILD_ID="dilin.test-hawk-project-nightly"
- NIGHTLY_BUILD_TAG="nightly-build"
# Non production situation: RC or nightly build
- IS_TEST=true
install:
- sudo apt-get install libsecret-1-dev
- npm install -g vsce
- npm install
script:
- tsc --version
- gts --version
- gts check
- node scripts/updateConfig.js
- if [[ $TRAVIS_TAG =~ $ISPRODTAG ]]; then export IS_TEST=false; fi
- if [[ $TRAVIS_EVENT_TYPE == "cron" ]]; then
git config --local user.name $USER_NAME &&
git config --local user.email $USER_EMAIL &&
git remote set-url origin https://dilin-MS:$GIT_TOKEN@github.com/dilin-MS/vscode-iot-workbench.git &&
export TRAVIS_TAG="nightly-build" &&
nightlyBuildTagExists=`git ls-remote --exit-code origin refs/tags/$NIGHTLY_BUILD_TAG` && nightlyBuildCommit=`git rev-list -n 1 $NIGHTLY_BUILD_TAG` &&
if [[ $nightlyBuildTagExists && $nightlyBuildCommit != $TRAVIS_COMMIT ]]; then git push --delete origin $TRAVIS_TAG && git tag -f $TRAVIS_TAG && git push --tags -f; fi
fi
- vsce package
- docker run -ti --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --allow-dupe --allow-redirect --skip-save-results `ls *.md`
deploy:
# deploy to github release
- provider: releases
api_key: $GIT_TOKEN
prerelease: $IS_TEST
file_glob: true
file: "*.vsix"
skip_cleanup: true
on:
tags: true
all_branches: true
# deploy nightly build to github release
- provider: releases
api_key: $GIT_TOKEN
prerelease: true
overwrite: true
file_glob: true
file: "*.vsix"
skip_cleanup: true
on:
branch: develop
condition: "$TRAVIS_EVENT_TYPE = 'cron'"
# deploy to vscode extension market
- provider: script
script: vsce publish -p $VSCE_TOKEN --packagePath *.vsix
skip_cleanup: true
on:
tags: true
all_branches: true
# if it's a PROD tag (something like 1.0.0), then publish extension to market.
condition: " $TRAVIS_TAG =~ $ISPRODTAG"
# deploy test version to vscode extension market
- provider: script
script: yes | vsce unpublish -p $VSCE_TEST_TOKEN $RC_EXTENSION_ID && vsce publish -p $VSCE_TEST_TOKEN --packagePath *.vsix
skip_cleanup: true
on:
tags: true
all_branches: true
# if it's a test version tag (something like 1.0.0-rc), then publish test extension to market.
condition: "$TRAVIS_TAG =~ $ISTESTTAG"
# deploy nightly version to vscode extension market
- provider: script
script: yes | vsce unpublish -p $VSCE_TEST_TOKEN $NIGHTLY_BUILD_ID && vsce publish -p $VSCE_TEST_TOKEN --packagePath *.vsix
skip_cleanup: true
on:
branch: develop
condition: "$TRAVIS_EVENT_TYPE = 'cron'"
notifications:
email:
if: $TRAVIS_EVENT_TYPE = 'cron'
recipients:
- dilin@microsoft.com
on_success: always
on_failure: always