Skip to content

Commit 39187b8

Browse files
committed
ci(circle): add semantic release
1 parent 62f57b3 commit 39187b8

4 files changed

Lines changed: 16221 additions & 10453 deletions

File tree

.circleci/config.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#
55
version: 2
66
jobs:
7-
build:
7+
test:
88
docker:
99
# specify the version you desire here
10-
- image: circleci/node:8.12.0
10+
- image: circleci/node:10
1111

1212
# Specify service dependencies here if necessary
1313
# CircleCI maintains a library of pre-built images
@@ -19,13 +19,48 @@ jobs:
1919
- run: npm install
2020
- run: npm run lint
2121
# run the tests on the original source to get coverage info
22+
- run: npx commitlint --from HEAD~1 --to HEAD --verbose
2223
- run: npm test
2324
- run: npm run coveralls
2425
# test the final bundled builds
2526
- run: npm run build
2627
- run: npm run test-builds
27-
# test with older react versions
28-
# TODO: the lib works with older React versions but some tests
29-
# rely on newer React features
30-
# - run: npm i react@15 react-dom@15 --no-save
31-
# - run: npm run test-builds
28+
29+
release:
30+
docker:
31+
- image: circleci/node:10
32+
steps:
33+
- run:
34+
# Decrypt the git_deploy_key.enc key into /tmp/git_deploy_key
35+
- openssl aes-256-cbc -d -K $REPO_ENC_KEY -iv $REPO_ENC_IV -in git_deploy_key.enc -out /tmp/git_deploy_key
36+
# Make sure only the current user can read the private key
37+
- chmod 600 /tmp/git_deploy_key
38+
# Create a script to return the passphrase environment variable to ssh-add
39+
- echo 'echo ${SSL_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass
40+
# Start the authentication agent
41+
- eval "$(ssh-agent -s)"
42+
# Add the key to the authentication agent
43+
- DISPLAY=":0.0" SSH_ASKPASS="/tmp/askpass" setsid ssh-add /tmp/git_deploy_key </dev/null
44+
- checkout
45+
- run:
46+
name: Install dependencies
47+
command: |
48+
npm install
49+
- run:
50+
name: Build /dist folder
51+
command: npm run build
52+
- run:
53+
name: Release to NPM
54+
command: npm run semantic-release
55+
56+
workflows:
57+
version: 2
58+
test_and_release:
59+
jobs:
60+
- test
61+
- release:
62+
requires:
63+
- test
64+
filters:
65+
branches:
66+
only: master

git_deploy_key.enc

3.36 KB
Binary file not shown.

0 commit comments

Comments
 (0)