@snippetify/book-reader
Version:
Book reader utilities
88 lines (82 loc) • 2.86 kB
YAML
# Template npm-publish
# This template allows you to publish your npm package, as defined in package.json, to npmjs.com or any other npm-like registry.
# The workflow allows running tests, code linting and security scans on feature branches (as well as master).
# The npm package will be validated and published after the code is merged to master.
# Prerequisites: $NPM_TOKEN setup in the Deployment variables.
# For advanced cases, please, follow examples from the pipe's README https://bitbucket.org/atlassian/npm-publish/src/master/README.md
image: node:16
pipelines:
pull-requests:
'**': #this runs as default for any branch not elsewhere defined
- step:
name: Install esLint
script:
- yarn add eslint
#- npx eslint .
caches:
- node
- step:
name: Install dependencies, lint code and Test
caches:
- node
script:
- yarn install
- yarn lint
- yarn test
branches:
main: #Production
- step:
name: Install esLint
script:
- yarn add eslint
#- npx eslint .
caches:
- node
- parallel:
- step:
name: Install dependencies, build and Test
caches:
- node
script:
- yarn install
- yarn build
- yarn test
- 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: Deploy to Production
deployment: Production
script:
# Bump versions before publishing
- npm --no-git-tag-version version "1.0.$BITBUCKET_BUILD_NUMBER" -m "Upgrade to new version"
# Publish package
- pipe: atlassian/npm-publish:0.3.2
variables:
NPM_TOKEN: $NPM_TOKEN
dev: #Development
- step:
name: Install esLint
script:
- yarn add eslint
#- npx eslint .
caches:
- node
- parallel:
- step:
name: Install dependencies, lint and Test
caches:
- node
script:
- yarn install
- yarn lint
- yarn test
- 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