Skip to content

Commit fc26073

Browse files
committed
Improvement of CircleCI config + version bump
1 parent 4559253 commit fc26073

File tree

3 files changed

+28
-33
lines changed

3 files changed

+28
-33
lines changed

.circleci/config.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,48 @@
1+
defaults: &defaults
2+
docker:
3+
- image: circleci/node:8.11.2
4+
15
version: 2
26
jobs:
3-
# Release.
4-
# TODO: Probably, it is possible to reuse the test job below as a part of
5-
# the release job; but as I don't know how to do it at the moment, let's
6-
# just dublicate the logic for now.
7-
release:
8-
docker:
9-
- image: circleci/node:8.9.4
7+
test:
8+
<<: *defaults
109
steps:
1110
- checkout
1211
- restore_cache:
13-
# Careful here, though, at the moment, there should be no problem
14-
# to reuse the same cache of "node_modules" between test and release
15-
# jobs.
16-
key: test-node-modules-{{ checksum "package-lock.json" }}
12+
key: node-modules-{{ checksum "package-lock.json" }}
1713
- run: npm install
1814
- save_cache:
19-
key: test-node-modules-{{ checksum "package-lock.json" }}
15+
key: node-modules-{{ checksum "package-lock.json" }}
2016
paths:
2117
- node_modules
2218
- run: npm test
23-
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
24-
- run: npm publish
25-
26-
# Just tests commited code.
27-
test:
28-
docker:
29-
- image: circleci/node:8.9.4
19+
- run: npm build
20+
- persists_to_workspace:
21+
root: .
22+
paths:
23+
- dist
24+
release:
25+
<<: *defaults
3026
steps:
3127
- checkout
32-
- restore_cache:
33-
key: test-node-modules-{{ checksum "package-lock.json" }}
34-
- run: npm install
35-
- save_cache:
36-
key: test-node-modules-{{ checksum "package-lock.json" }}
37-
paths:
38-
- node_modules
39-
- run: npm test
28+
- attach_workspace:
29+
at: .
30+
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
31+
- run: npm publish
4032

4133
workflows:
4234
version: 2
4335
build:
4436
jobs:
37+
- test:
38+
filters:
39+
tags:
40+
only: /.*/
4541
- release:
4642
filters:
4743
branches:
4844
ignore: /.*/
4945
tags:
5046
only: /v[0-9]+(\.[0-9]+)*/
51-
- test
47+
requires:
48+
- test

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@
114114
"lint": "npm run lint:js && npm run lint:scss",
115115
"lint:js": "eslint --ext .js,.jsx .",
116116
"lint:scss": "./node_modules/.bin/stylelint **/*.scss --syntax scss",
117-
"prepublishOnly": "npm run build",
118117
"test": "npm run lint && npm run jest"
119118
},
120-
"version": "0.4.2"
119+
"version": "0.4.3"
121120
}

0 commit comments

Comments
 (0)