-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathconfig.yml
More file actions
executable file
·108 lines (104 loc) · 3.24 KB
/
config.yml
File metadata and controls
executable file
·108 lines (104 loc) · 3.24 KB
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
106
107
108
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2.1
npm-login: &npm-login
# NPM_TOKEN is manually defined in CircleCI
# project settings > Build settings > Environment variables
# Add the NPM_TOKEN name and the value is your npm token
# Get your npm token via npm token create
# https://docs.npmjs.com/cli/token
# Token represents the npm gravity.bot user
run:
name: Create .npmrc
command: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
orbs:
node: circleci/node@1.1.6
jobs:
test:
executor:
name: node/default
tag: '14'
working_directory: ~/repo
steps:
# Check out the git repo to the working directory
- checkout
- add_ssh_keys:
fingerprints:
# You need to add a deploy key with write permission in order for the CI to commit changes
# back to the repo
# https://circleci.com/docs/2.0/gh-bb-integration/#adding-readwrite-deployment-keys-to-github-or-bitbucket
- '30:87:05:71:0d:09:ab:2f:d6:02:5e:24:64:1a:ce:6a'
# Download and cache dependencies so subsequent builds run faster
- restore_cache:
keys:
- dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run:
name: Install deps
command: |
npm i
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package-lock.json" }}
- run:
name: Run tests
command: |
npm run test:ci
- run:
name: Build the libraries
command: |
npm run build
publish:
executor:
name: node/default
tag: '14'
working_directory: ~/repo
steps:
# Check out the git repo to the working directory
- checkout
# Create the .npmrc file so npm can auth for publishing
- *npm-login
- add_ssh_keys:
fingerprints:
# You need to add a deploy key with write permission in order for the CI to commit changes
# back to the repo
# https://circleci.com/docs/2.0/gh-bb-integration/#adding-readwrite-deployment-keys-to-github-or-bitbucket
- 'c0:d3:c4:b7:ee:55:37:0e:3a:a4:ba:42:a4:c6:9b:04'
# Download and cache dependencies so subsequent builds run faster
- restore_cache:
keys:
- dependencies-{{ checksum "package-lock.json" }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run:
name: Install deps
command: |
npm i
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package-lock.json" }}
- run:
name: Build the libraries
command: |
npm run build
- run:
name: npm publish (master only)
command: |
.circleci/deploy.sh
workflows:
version: 2
build:
jobs:
- test
- publish:
filters:
branches:
only: master
requires:
- test