forked from sharmanikhil04/ngx-material-file-input
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (84 loc) · 2.29 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
dist: xenial
sudo: required
language: node_js
node_js:
- '16'
cache: npm
os:
- linux
services:
- xvfb
addons:
chrome: stable
stages:
- validate
- deploy
env:
globals:
- COVERALLS_SERVICE_NAME=travis-pro
notifications:
webhooks: https://coveralls.io/webhook
email: $EMAIL
install:
- npm ci --no-audit
jobs:
include:
# *--------------------*
# | VALIDATE |
# *--------------------*
- stage: validate
name: "Lint"
script:
- npm run lint
- stage: validate
name: "Unit tests and Coverage"
before_script:
- npm install coveralls
script:
- echo "> Running tests against $(node -v)"
- npm run test:once -- --code-coverage
after_success:
- cat ./coverage/libs/material-file-input/lcov.info | ./node_modules/coveralls/bin/coveralls.js
# *--------------------*
# | DEPLOY |
# *--------------------*
- stage: deploy
name: "Build and deploy"
script:
- npm run build:lib
- npm run build:demo
after_success:
- echo "Build successful - Branch($TRAVIS_BRANCH) Pull Request($TRAVIS_PULL_REQUEST) Tag($TRAVIS_TAG)"
before_deploy:
- zip -r9 ngx-material-file-input-$TRAVIS_TAG.zip dist/material-file-input
deploy:
- provider: pages
skip_cleanup: true
script: echo "> Deploying Demo to Github pages"
github_token: $GITHUB_TOKEN
keep-history: true
local_dir: dist/apps/demo-packaged
on:
repo: merlosy/ngx-material-file-input
branch: master
tags: true
- provider: releases
skip_cleanup: true
script: echo "> Drafting Github release"
api_key: $GITHUB_TOKEN
file_glob: true
file: ngx-material-file-input-$TRAVIS_TAG.zip
draft: true
on:
repo: merlosy/ngx-material-file-input
branch: master
tags: true
# - provider: npm
# skip_cleanup: true
# script: cd dist/material-file-input && echo "> Deploying package to NPM"
# email: $EMAIL
# api_key: $NPM_API_KEY
# on:
# repo: merlosy/ngx-material-file-input
# branch: master
# tags: true