-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (53 loc) · 1.74 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
os: linux
language: node_js
node_js:
- '10.17'
cache:
directories:
- ~/.npm
- ./node_modules
- ~/.cache
install:
- npm ci # Install a project with a clean slate, similar to npm install (see https://docs.npmjs.com/cli/ci.html)
# We want to achieve the following (in CI):
# 1. build the lib into a tar package
# 2. build the app with this very same package (and **not** the lib sources !)
# 3. run all tests
# 4. if all went well, publish that lib package with confidence
script:
- cp README.md LICENSE projects/@abolis/plate-maker/
- npm run build.lib
- source travis/travis_package_lib.sh # Execute (source) the script in the current shell environment (to be able to export variables)
- rm -r dist/plate-maker projects/@abolis/plate-maker # To be 100% sure we use the code of the same .tar package that we will push later
- ./travis/make_app_depend_on_tar.sh
- npm install
- npm run build.app.prod
- npm run cypress.verify
- npm run start.server.and.test
- source travis/travis_tag_commit.sh
before_deploy:
- | # verbatim block operator => multi-line shell script
if [[ $TRAVIS_BRANCH = "release" ]]; then
cd dist && tar -xvf $PACKAGE_TO_UPLOAD plate-maker && cd plate-maker
fi
deploy:
- provider: releases
token: $GITHUB_TOKEN
file: dist/$PACKAGE_TO_UPLOAD # PACKAGE_TO_UPLOAD is exported from travis_tag_commit.sh
skip_cleanup: true
on:
all_branches: true
- provider: npm
email: developers@abolis.fr
api_token: $NPM_TOKEN
skip_cleanup: true
on:
branch: release
after_deploy:
- |
if [[ $TRAVIS_BRANCH = "release" ]]; then
cd ../..
fi
branches:
except:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/ # Ensure no build is triggered on release tag pushes