#  Template NodeJS build

#  This template allows you to validate your NodeJS code.
#  The workflow allows running tests and code linting on the default branch.

image: node:10.15.3

pipelines:
  tags:
    '*':
      - step:
          name: Publish library to NPM Repository
          caches:
            - node
          script:
            - set
            - apt update -y
            - apt install -y gettext-base
            - npm install -g npx nobj-build-tools
            - echo "registry=http://registry.npmjs.org/" > ${HOME}/.npmrc
            - echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" >> ${HOME}/.npmrc
            - chmod 600 ${HOME}/.npmrc
            - nobj-build-lib ${BITBUCKET_TAG}
