2023-03-16 21:27:09 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
defaults: &defaults
|
|
|
|
working_directory: ~/repo
|
|
|
|
docker:
|
|
|
|
- image: cimg/node:19.7.0
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: Install dependencies
|
2023-07-25 15:31:06 +00:00
|
|
|
command: npm ci
|
2023-03-29 22:50:05 +00:00
|
|
|
- run:
|
|
|
|
name: Run tests
|
|
|
|
command: npm run test
|
2023-03-16 21:27:09 +00:00
|
|
|
- run:
|
|
|
|
name: Build
|
|
|
|
command: npm run build
|
2023-03-16 21:44:04 +00:00
|
|
|
- persist_to_workspace:
|
|
|
|
root: ~/repo
|
|
|
|
paths:
|
|
|
|
- ./dist
|
|
|
|
- ./LICENSE
|
|
|
|
- ./package.json
|
|
|
|
- ./README.md
|
2023-03-16 21:27:09 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
<<: *defaults
|
|
|
|
steps:
|
|
|
|
- attach_workspace:
|
|
|
|
at: ~/repo
|
|
|
|
- run:
|
|
|
|
name: Publish package
|
2023-03-16 21:44:04 +00:00
|
|
|
command: |
|
2023-03-16 21:57:52 +00:00
|
|
|
npm set //registry.npmjs.org/:_authToken=$npm_TOKEN
|
2023-07-04 18:44:32 +00:00
|
|
|
npm publish
|
2023-03-16 21:27:09 +00:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
main:
|
|
|
|
jobs:
|
|
|
|
- build:
|
|
|
|
filters:
|
2023-03-22 00:30:44 +00:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2023-03-16 21:44:04 +00:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|
2023-03-16 21:27:09 +00:00
|
|
|
- deploy:
|
|
|
|
requires:
|
|
|
|
- build
|
2023-03-16 22:42:15 +00:00
|
|
|
filters:
|
2023-03-22 00:30:44 +00:00
|
|
|
branches:
|
|
|
|
ignore: /.*/
|
2023-03-16 22:42:15 +00:00
|
|
|
tags:
|
|
|
|
only: /^v.*/
|