scratch-l10n/.circleci/config.yml
2020-05-13 15:10:18 -04:00

50 lines
1.2 KiB
YAML

version: 2.1
orbs:
node: circleci/node@2.1.0
defaults: &defaults
working_directory: ~/project
executor:
name: node/default
tag: 'lts'
jobs:
build-and-test:
<<: *defaults
steps:
- checkout
- node/install-packages #node orb cmd caches
- run: npm run test
- persist_to_workspace:
root: ~/project
paths: .
deploy-npm:
<<: *defaults
steps:
- attach_workspace:
at: ~/project
- run:
name: "configure npm version"
command: |
VPKG=$($(npm bin)/json -f package.json version)
echo "export VERSION=${VPKG/%?/}$(date +%Y%m%d%H%M%S)" >> $BASH_ENV
npm --no-git-tag-version version $VERSION
- run:
name: "publish"
command: |
npm set //registry.npmjs.org/:_authToken=$NPM_TOKEN
npm publish
- run:
name: "tag release"
command: |
git tag $VERSION
git push $CIRCLE_REPOSITORY_URL $VERSION
workflows:
version: 2
build-test-and-deploy:
jobs:
- build-and-test
- deploy-npm:
requires:
- build-and-test
filters:
branches:
only: master