image: node:10.15.1

pipelines:
  branches:
    master: 
      - step:
          name: Publish
          deployment: production
          script:
            - git remote set-url origin https://${PIPELINES_USER}:${APP_SECRET}@bitbucket.org/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}
            - npm version minor -m "Upgrade to %s [skip ci]"
            - git push && git push --tags
            - pipe: atlassian/npm-publish:0.2.0
              variables:
                NPM_TOKEN: $NPM_TOKEN