Skip to content

Commit 866ed5b

Browse files
authored
Merge pull request #4 from fullstorydev/circleci-editor/661/master
Set up CircleCI
2 parents 5720093 + 5476705 commit 866ed5b

File tree

2 files changed

+62
-9
lines changed

2 files changed

+62
-9
lines changed

.circleci/config.yml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,76 @@
22
# See: https://circleci.com/docs/2.0/configuration-reference
33
version: 2.1
44

5+
executors:
6+
browser-executor:
7+
docker:
8+
- image: circleci/node:16-browsers
9+
working_directory: ~/repo
510
# Define a job to be invoked later in a workflow.
611
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
712
jobs:
8-
say-hello:
9-
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
10-
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
11-
docker:
12-
- image: cimg/base:stable
13+
build-plugin:
14+
executor: browser-executor
1315
# Add steps to the job
1416
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
1517
steps:
1618
- checkout
19+
- restore_cache:
20+
keys:
21+
- v1-dependencies-{{ checksum "package-lock.json" }}
22+
- run:
23+
name: Install
24+
command: npm ci
25+
- save_cache:
26+
paths:
27+
- node_modules
28+
key: v1-dependencies-{{ checksum "package-lock.json" }}
29+
- run:
30+
name: Audit
31+
command: npm audit --audit-level=low
32+
- run:
33+
name: Test
34+
command: npm test
35+
- run:
36+
name: Build
37+
command: npm run prepack
38+
- persist_to_workspace:
39+
root: .
40+
paths: [.]
41+
deploy-plugin:
42+
executor: browser-executor
43+
steps:
44+
- attach_workspace:
45+
at: ~/repo
46+
- run:
47+
name: Authenticate with registry
48+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > .npmrc
1749
- run:
18-
name: "Say hello"
19-
command: "echo Hello, World!"
50+
name: Publish package
51+
command: npm publish --access public
2052

2153
# Invoke jobs via workflows
2254
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
2355
workflows:
24-
say-hello-workflow:
56+
test-deploy:
2557
jobs:
26-
- say-hello
58+
- build-plugin
59+
- hold:
60+
type: approval
61+
requires:
62+
- build-plugin
63+
filters:
64+
# hold only on version tags
65+
tags:
66+
only: /^v.*/
67+
branches:
68+
ignore: /.*/
69+
- deploy-plugin:
70+
requires:
71+
- hold
72+
filters:
73+
# deploy only on version tags
74+
tags:
75+
only: /^v.*/
76+
branches:
77+
ignore: /.*/

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# @fullstory/segment-react-native-plugin-fullstory
22

3+
[![CircleCI](https://circleci.com/gh/fullstorydev/segment-react-native-plugin-fullstory.svg?style=svg)](https://circleci.com/gh/fullstorydev/segment-react-native-plugin-fullstory)
4+
35
`EnrichmentPlugin` for [FullStory](https://www.fullstory.com/). This is a segment analytics plugin that wraps [`@fullstory/react-native`](https://github.com/fullstorydev/fullstory-react-native).
46

57
## Prerequisite

0 commit comments

Comments
 (0)