Skip to content

Commit f0774fc

Browse files
author
Josh Goldberg
authored
Added 'publish' CircleCI step for master branch (#71)
* Added 'publish' CircleCI step for master branch Runs `npm publish` on each master build, ignoring any failure (such as from the version having not changed. Kind of like a try/catch with an empty catch block in CI. Heh. Fixes 37. * Also excluded all stub and test files, not just .ts
1 parent 5229559 commit f0774fc

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.circleci/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
version: 2.1
22

3+
references:
4+
set_npm_token: &set_npm_token
5+
run:
6+
name: Add NPM auth token file
7+
command: echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
8+
39
jobs:
410
build:
511
docker:
@@ -43,6 +49,22 @@ jobs:
4349

4450
- run: npm run eslint
4551

52+
publish:
53+
docker:
54+
- image: circleci/node:latest
55+
56+
working_directory: ~/repo
57+
58+
steps:
59+
- checkout
60+
61+
- *set_npm_token
62+
63+
- attach_workspace:
64+
at: "."
65+
66+
- run: npm publish || exit 0
67+
4668
prettier:
4769
docker:
4870
- image: circleci/node:latest
@@ -93,6 +115,12 @@ workflows:
93115
- eslint:
94116
requires:
95117
- build
118+
- publish:
119+
filters:
120+
branches:
121+
only: master
122+
requires:
123+
- tsc
96124
- prettier:
97125
requires:
98126
- build

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
*.log
33
*.map
44
coverage/
5-
src/**/*.test.ts
5+
src/**/*.stubs.*
6+
src/**/*.test.*
67
src/**/*.ts
78
!src/**/*.d.ts
89
src/**/*.test.d.ts

0 commit comments

Comments
 (0)