forked from kaltura/playkit-js-flash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (81 loc) · 2.05 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
conditions: v1
sudo: required
dist: xenial
language: node_js
node_js:
- "node"
addons:
chrome: stable
services:
- xvfb
cache:
yarn: true
directories:
- node_modules
before_install:
- export DISPLAY=:99.0
- chmod +x ./scripts/travis.sh
script: ./scripts/travis.sh
stages:
- Tests
- Release canary
- Release
jobs:
fast_finish: true
include:
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Release
name: "Releasing a new version"
if: tag IS present
env: TRAVIS_MODE=release
deploy:
- provider: releases
api_key: $GH_TOKEN
file_glob: true
file: dist/*
prerelease: true
skip_cleanup: true
on:
branch: master
tags: true
- provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
on:
tags: true
branch: master
after_deploy:
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$TRAVIS_TAG" "$JENKINS_TAG_TOKEN"
# publish canary package if on master
- stage: Release canary
if: (branch = master) AND (type != pull_request) AND commit_message !~ /^chore\(release\)/
env: TRAVIS_MODE=releaseCanary
deploy:
provider: npm
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
tag: canary
on:
tags: false
branch: master
after_deploy:
- currentVersion=$(npx -c 'echo "$npm_package_version"')
- echo $currentVersion
- chmod +x ./scripts/after_deploy.sh
- ./scripts/after_deploy.sh "flash" "$currentVersion" "$JENKINS_CANARY_TOKEN"
# Required tests
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running lint"
env: TRAVIS_MODE=lint
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running Flow type check"
env: TRAVIS_MODE=flow
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running unit tests"
env: TRAVIS_MODE=unitTests