isoflow/.circleci/config.yml

59 lines
1.2 KiB
YAML
Raw Normal View History

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
command: npm i
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
npm config set tag-version-prefix 'v'
npm publish --tag << pipeline.git.tag >>
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.*/