forked from facebook/metro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.yml
101 lines (95 loc) · 2.6 KB
/
circle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
aliases:
- &restore-cache
keys:
- dependencies-{{ .Branch }}-{{ checksum "package.json" }}
# Fallback in case checksum fails
- dependencies-{{ .Branch }}-
- &save-cache
paths:
- node_modules
key: dependencies-{{ .Branch }}-{{ checksum "package.json" }}
- &deploy-website
command: |
# Deploy Metro website
git config --global user.email "metro-bot@users.noreply.github.com"
git config --global user.name "Website Deployment Script"
echo "machine github.com login metro-bot password $GITHUB_TOKEN" > ~/.netrc
# install Docusaurus and generate file of English strings
cd website && yarn && yarn run write-translations
# build and publish website
GIT_USER=metro-bot yarn run publish-gh-pages
version: 2
jobs:
run-js-checks:
working_directory: ~/metro
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn run test-ci
test-node-9:
working_directory: ~/metro
docker:
- image: circleci/node:9
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn run jest
test-node-8:
working_directory: ~/metro
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- run: yarn run jest
publish-to-npm:
working_directory: ~/metro
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run:
working_directory: packages/metro
command: yarn --no-progress
- save-cache: *save-cache
- run:
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
working_directory: ~/metro
command: npm run publish
test-and-deploy-website:
working_directory: ~/metro
docker:
- image: circleci/node:8
steps:
- checkout
- restore-cache: *restore-cache
- run: |
cd website
yarn --no-progress
- save-cache: *save-cache
- deploy: *deploy-website
# Workflows enables us to run multiple jobs in parallel
workflows:
version: 2
build-and-deploy:
jobs:
- run-js-checks
- test-node-8
- test-node-9
- test-and-deploy-website
- publish-to-npm:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*/