forked from facebook/metro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
109 lines (101 loc) 路 2.63 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
102
103
104
105
106
107
108
109
commands:
yarn_install:
description: "A wrapper to yarn install with caching"
parameters:
working_directory:
type: string
default: ""
steps:
- restore_cache:
keys:
- dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}
# Fallback in case checksum fails
- dependencies-{{ .Branch }}-
- run:
command: NPM_TOKEN= yarn --no-progress
working_directory: << parameters.working_directory >>
- save_cache:
paths:
- node_modules
key: dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}
yarn_run:
description: "A wrapper to execute yarn commands in a safe way"
parameters:
working_directory:
type: string
default: ""
command:
type: string
steps:
- run:
command: NPM_TOKEN= yarn run << parameters.command >>
working_directory: << parameters.working_directory >>
deploy_website:
steps:
- run: git config --global user.email "metro-bot@users.noreply.github.com"
- run: git config --global user.name "Website Deployment Script"
- run: echo "machine github.com login metro-bot password $GITHUB_TOKEN" > ~/.netrc
- yarn_install:
working_directory: website
- yarn_run:
command: write-translations
working_directory: website
- yarn_run:
command: publish-gh-pages
working_directory: website
version: 2.1
jobs:
run-js-checks:
docker:
- image: circleci/node:8
steps:
- checkout
- yarn_install
- yarn_run:
command: test-ci
test-node-10:
docker:
- image: circleci/node:10
steps:
- checkout
- yarn_install
- yarn_run:
command: jest
test-node-8:
docker:
- image: circleci/node:8
steps:
- checkout
- yarn_install
- yarn_run:
command: jest
publish-to-npm:
docker:
- image: circleci/node:8
steps:
- checkout
- yarn_install
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: npm run publish
- run: rm ~/.npmrc
test-and-deploy-website:
docker:
- image: circleci/node:8
steps:
- checkout
- 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-10
- test-and-deploy-website
- publish-to-npm:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*/