version: 0.2

phases:
  install:
    commands:
      # Temporarily - install yarn if it's not there already
      - yarn --version || npm install --global yarn
      - yarn install --frozen-lockfile
  build:
    commands:
      - yarn build && yarn test
      - yarn dist-clean
      - /bin/bash ./scripts/align-version.sh
      - yarn build
  post_build:
    commands:
      - '[ ${CODEBUILD_BUILD_SUCCEEDING} = 1 ] && yarn package'
artifacts:
  files:
    - "**/*"
  base-directory: dist
