Skip to content

Commit 4152b0f

Browse files
author
ADMSK\AVROGAL1
committed
2 parents 3e10516 + 68db615 commit 4152b0f

File tree

1 file changed

+4
-77
lines changed

1 file changed

+4
-77
lines changed

.circleci/config.yml

Lines changed: 4 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,7 @@
11
version: 2.1
2-
3-
docker_defaults: &docker_defaults
4-
docker:
5-
- image: circleci/node:latest
6-
7-
commands:
8-
prep_env:
9-
description: Prepares environment with cache
10-
steps:
11-
- checkout:
12-
path: ~/repo
13-
# - run:
14-
# name: 'Update Node.js and npm'
15-
# command: |
16-
# curl -sSL "https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v12.13.0-linux-x64/bin/node
17-
# curl https://www.npmjs.com/install.sh | sudo bash
18-
- run:
19-
name: Check current version of node
20-
command: node -v
21-
- restore_cache:
22-
name: Restore node_modules cache
23-
keys:
24-
- github-action-user-contribution-{{ checksum "package-lock.json" }}-{{ .Branch }} # appends cache key with a hash of pom.xml file
25-
- github-action-user-contribution- # fallback in case previous cache key is not found
26-
27-
save_env_cache:
28-
description: Saves environment cache
29-
steps:
30-
- save_cache:
31-
name: Save node_modules cache
32-
key: github-action-user-contribution-{{ checksum "package-lock.json" }}-{{ .Branch }}
33-
paths:
34-
- node_modules/
35-
36-
jobs:
37-
node_modules:
38-
<<: *docker_defaults
39-
working_directory: ~/repo
40-
steps:
41-
- prep_env
42-
- run: npm install
43-
- save_env_cache
44-
45-
publish_release:
46-
<<: *docker_defaults
47-
working_directory: ~/repo
48-
steps:
49-
- prep_env
50-
- run:
51-
name: Don't allow install of package, when published
52-
command:
53-
cat package.json | jq '.scripts.postinstall = "node index.js"' > package.json.tmp && mv
54-
package.json.tmp package.json
55-
- run:
56-
name: Semantic release to NPM and GitHub releases
57-
command: npx -p @semantic-release/release-notes-generator -p @semantic-release/npm -p @semantic-release/github semantic-release
58-
2+
orbs:
3+
node: circleci/[email protected]
594
workflows:
60-
version: 2
61-
build_and_deploy:
5+
node-tests:
626
jobs:
63-
- node_modules:
64-
filters:
65-
branches:
66-
only:
67-
- master
68-
- publish_release:
69-
requires:
70-
- node_modules
71-
filters:
72-
branches:
73-
only:
74-
- master
75-
76-
experimental:
77-
notify:
78-
branches:
79-
only:
80-
- master
7+
- node/test

0 commit comments

Comments
 (0)