/
config.yml
75 lines (61 loc) 路 2.27 KB
/
config.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
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
working_directory: ~/repo
steps:
- checkout
# The `ledger-wallet-provider` lib has `node-hid` as a dependency, which won't build on certain
# Linux systems without installing libusb first
- type: shell
name: Install System Dependencies
command: sudo apt-get update && sudo apt install -y libusb-1.0-0 libusb-1.0-0-dev
- restore_cache:
keys:
- v3-dependencies-{{ checksum "package-lock.json" }}
- run: npm install
- save_cache:
paths:
- node_modules
key: v3-dependencies-{{ checksum "package-lock.json" }}
# run tests!
- run: npm run prebuild && npm test
- run: npm run build
- save_cache:
paths:
- "."
key: dist-{{ .Revision }}
deploy:
docker:
- image: circleci/node:7.10
working_directory: ~/repo
steps:
- restore_cache:
keys:
- dist-{{ .Revision }}
# semantic-release requires node >= 8.3 and the latest version available at circle-ci is node 7.10
# they recommend using npx to install node 8 and then use it to run semantic-release (https://github.com/semantic-release/semantic-release/blob/caribou/docs/support/node-version.md)
# since node 7.10 comes with npm 4 and npx is only available on npm >= 5 it has to be installed first, and run from the local node_modules
# TODO: we should replace the following line with just "npm run semantic-release" once there's a node:8 image available at circle-ci
- run: npm install --save-dev npx && node_modules/npx/index.js -p node@8 -c "npx semantic-release"
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master