Pipeline Config

image: node:14.20.0

pipelines:
  default:
    - step:
        name: Install
        caches:
          - node
        script:
          - unset NPM_CONFIG_USER
          - npm install
          - npm install -g @angular/cli
        artifacts:
          - node_modules/**
    - parallel:
        - step:
            name: Code sniff
            script:
              - npm run lint
        - step:
            name: Build check
            script:
              - npm run build
        - step:
            name: Execute unit tests
            script:
              - npm run test
  branches:
    release:
      - step:
          name: Release Build
          script:
            - echo "registry=https://registry.npmjs.org/" >> /.npmrc
            - echo "@jax-compsci:registry=https://${REG_LOC}-npm.pkg.dev/${REG_PROJ}/${REG_NAME}/" >> /.npmrc
            - echo "//${REG_LOC}-npm.pkg.dev/${REG_PROJ}/${REG_NAME}/:always-auth=true"  >> /.npmrc
            - echo "//${REG_LOC}-npm.pkg.dev/${REG_PROJ}/${REG_NAME}/:_password=\"${REG_PASSWORD}\"" >> /.npmrc
            - echo "//${REG_LOC}-npm.pkg.dev/${REG_PROJ}/${REG_NAME}/:username=_json_key_base64" >> /.npmrc
            - echo "//${REG_LOC}-npm.pkg.dev/${REG_PROJ}/${REG_NAME}/:email=not.valid@email.com" >> /.npmrc
            - cat .npmrc
            - unset NPM_CONFIG_USER
            - npm install
            - npm install -g @angular/cli
            - npm run build:prod
            - npm run publish:ci
            - rm .npmrc
            # bump patch version in main branch
            - git remote update
            - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
            - git fetch origin
            - git checkout main
            - npm version patch
            - cd libs/[library-folder-name]
            - npm version patch
            - git status
            - cd ../..
            - git add libs/[library-folder-name]/package.json
            - git commit -m "[library-folder-name] version update"
            - git status
            - git push