This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
config.yml
50 lines (50 loc) · 1.51 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
version: 2
jobs:
build:
docker:
- image: circleci/node:9.5.0
working_directory: ~/html-webpack-externals-plugin
steps:
- checkout
- run:
name: Authenticate to npm registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Update npm
command: |
npm install npm@latest --no-save &&
sudo rm -rf /usr/local/lib/node_modules/npm &&
sudo mv node_modules/npm /usr/local/lib/node_modules/npm
- run:
name: Install greenkeeper-lockfile
command: sudo npm install -g greenkeeper-lockfile@1
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run:
name: Install dependencies
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: Build
command: npm run build
- run:
name: Test
command: npm test
- run:
name: Update lockfile
command: greenkeeper-lockfile-update
- run:
name: Upload lockfile
command: greenkeeper-lockfile-upload
- deploy:
name: Publish
command: |
export TAG="v$(git log -1 --pretty=%B)"
if echo $TAG | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$"; then
npm publish
else
echo "No tag pushed, skipping deploy"
fi