-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: standardize release script (#270)
* chore: standardize release script * chore: add explicit registry * chore: add circleci script for publishing to npm
- Loading branch information
Showing
2 changed files
with
80 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,85 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
version: 2.1 | ||
|
||
deploy_filters: &deploy_filters | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
# Trigger on tags that begin with `v` | ||
only: /^v.*/ | ||
|
||
|
||
executors: | ||
node: | ||
docker: | ||
- image: circleci/node:lts | ||
- image: circleci/node:14 | ||
|
||
steps: | ||
- checkout | ||
|
||
commands: | ||
save_yarn_cache: | ||
description: Save cache for future build | ||
steps: | ||
- save_cache: | ||
key: v1-yarn-deps-{{ checksum "yarn.lock" }} | ||
paths: | ||
- ~/.cache/yarn | ||
restore_yarn_cache: | ||
description: Restore cache from previous build | ||
steps: | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "yarn.lock" }} | ||
- v1-dependencies- | ||
- v1-yarn-deps-{{ checksum "yarn.lock" }} | ||
|
||
- run: yarn install --frozen-lock | ||
jobs: | ||
build: | ||
executor: node | ||
steps: | ||
- checkout | ||
- restore_yarn_cache | ||
- run: | ||
name: Install dependencies and build | ||
command: yarn install --frozen-lockfile | ||
- save_yarn_cache | ||
- run: | ||
name: Check License Headers | ||
command: yarn check-license-headers | ||
- run: | ||
name: Check formatting | ||
command: yarn format:check | ||
- run: | ||
name: Run linter | ||
command: yarn lint | ||
- run: | ||
name: Run unit tests | ||
command: yarn test | ||
|
||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "yarn.lock" }} | ||
deploy: | ||
executor: node | ||
steps: | ||
- checkout | ||
- restore_yarn_cache | ||
- run: | ||
name: Install dependencies and build | ||
command: yarn install --frozen-lockfile | ||
- run: | ||
name: Configure NPM authentication | ||
command: npm config set "//registry.npmjs.org/:_authToken" "$NPM_AUTOMATION_TOKEN" | ||
- run: | ||
name: Publish package | ||
command: yarn release:publish | ||
|
||
- run: yarn check-license-headers | ||
- run: yarn format:check | ||
- run: yarn lint | ||
- run: yarn test | ||
workflows: | ||
workflow: | ||
jobs: | ||
- build | ||
build_and_test: | ||
jobs: | ||
- build | ||
build_and_test_and_deploy: | ||
jobs: | ||
- build: | ||
<<: *deploy_filters | ||
- deploy: | ||
<<: *deploy_filters | ||
requires: | ||
- build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters