Skip to content

Commit 8b12465

Browse files
package: Publish tags to NPM. (#17)
1 parent da8b1e8 commit 8b12465

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

.circleci/config.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,33 @@ jobs:
3131
paths: .
3232
- store_artifacts:
3333
path: ~/repo/dist
34+
deploy:
35+
<<: *defaults
36+
steps:
37+
- attach_workspace:
38+
at: ~/repo
39+
- run:
40+
name: Configure registry auth
41+
command: echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/repo/.npmrc
42+
- run:
43+
name: Publish package
44+
# For now we only publish on tags here and assume the version number is already correct.
45+
# If we change this then we need to automate updating the version number.
46+
command: npm publish $(if [ -z "$CIRCLE_TAG" ]; then echo "--tag next"; fi)
3447

3548
workflows:
3649
version: 2
37-
test:
50+
test-deploy:
3851
jobs:
39-
- test_and_build
52+
- test_and_build:
53+
filters:
54+
tags:
55+
only: /^v.*/
56+
- deploy:
57+
requires:
58+
- test_and_build
59+
filters:
60+
tags:
61+
only: /^v.*/
62+
branches:
63+
ignore: /.*/

0 commit comments

Comments
 (0)