# image: node:18
# pipelines:
#  branches:
#   main:
#   - step:
#         name: Build and Publish
#         caches:
#           - node
#         script:
#           - npm version -m "[skip ci] Releasing version , do not trigger new pipeline"  patch
#           - git push
#           - echo "Updated version number; publishing to repo."
#           # - npm install
#           # - npm run build
#           # - npm config ls
#           # - echo "@concord-consulting:registry=https://www.npmjs.com/package/@concord-consulting/concord-web-analytics:_authToken=${NPM_AUTOMATION_TOKEN}" > .npmrc
#           # - npm publish --access public
#           - npm install
#           - npm run build
#           # Create .npmrc for registry access
#           - echo "@concord-consulting:registry=https://www.npmjs.com/package/@concord-consulting/concord-web-analytics/" > .npmrc
#           - echo "//https://www.npmjs.com/package/@concord-consulting/concord-web-analytics:_authToken=${NPM_AUTOMATION_TOKEN}" >> .npmrc
#           - echo "//registry.npmjs.com/:_authToken=${NPM_TOKEN}" >> .npmrc
#           # Publish the package
#           - npm publish --access public --loglevel verbose

          

          #  - npm version -m "[skip ci] Releasing version , do not trigger new pipeline"  patch
#         - git push
#         - echo "Updated version number; publishing to repo."
#         - npm install
#         - npm run build
#         - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
#         - npm publish
  # - step:
  #     name: Build and Deploy
  #     caches:
  #       - node
  #     script:
  #       - npm install
  #       - npm run build
  # - step:
  #     name: Security Scan
  #     script:
  #       # Run a security scan for sensitive data.
  #       # See more security tools at https://bitbucket.org/product/features/pipelines/integrations?&category=security
  #       - pipe: atlassian/git-secrets-scan:0.5.1
  # - step:
  #     name: Publish
  #     script:
  #       - npm config ls
  #       - npm version -m "[skip ci] Releasing version , do not trigger new pipeline"  patch
  #       - git push
  #       - echo "Updated version number; publishing to repo."
  #       - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
  #       - npm publish

        # - pipe: atlassian/npm-publish:1.1.0
        #   variables:
        #     NPM_TOKEN: $NPM_TOKEN
        #     DEBUG: 'true'
        # - pipe: atlassian/bitbucket-upload-file:0.7.3
        #   variables:
        #     BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
        #     FILENAME: "analytics-bundle.js"
        #     TARGET: "https://cdn.jsdelivr.net/npm/@concord-consulting/concord-web-analytics/dist/analytics-bundle.js"

# image: node:14
# pipelines:
#  default:
#   - step:
#       name: Build and Deploy
#       caches:
#         - node
#       script:
#         - npm version -m "[skip ci] Releasing version , do not trigger new pipeline"  patch
#         - git push
#         - echo "Updated version number; publishing to repo."
#         - npm install
#         - npm run build
#         - echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
#         - npm publish
#         - pipe: atlassian/bitbucket-upload-file:0.7.3
#           variables:
#             BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD
#             FILENAME: "dist/analytics.js"
#             TARGET: "https://cdn.jsdelivr.net/npm/concord-web-analytics@latest/analytics.js"