<commit_before># Check https://circleci.com/docs/2.0/language-javascript/ for more details

cache_key: &cache_key
  v2-dependencies-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "esy.lock.json" }}

steps: &steps
- checkout
- run:
    name: Setup environment variables
    command: |
      echo 'export NPM_CONFIG_PREFIX="$HOME/.npm-global"' >> $BASH_ENV
      echo 'export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"' >> $BASH_ENV

# Download and cache dependencies
- restore_cache:
    keys:
    - *cache_key

- run: npm install -g esy@0.1.32
- run: esy install
- run: esy build

- save_cache:
    paths:
      - ~/.esy
    key: *cache_key

- run:
    name: Producing release
    command: make build-release
- run:
    name: Preparing release tarball
    command: mv "_release/$(cd _release && npm pack 2>/dev/null)" _release/reason-cli.tgz
- run:
    name: Installing release<commit_msg>Install rsync (needed for old esy)<commit_after># Check https://circleci.com/docs/2.0/language-javascript/ for more details

cache_key: &cache_key
  v2-dependencies-{{ arch }}-{{ checksum "package.json" }}-{{ checksum "esy.lock.json" }}

steps: &steps
- checkout

- run:
    name: Setup environment variables
    command: |
      echo 'export NPM_CONFIG_PREFIX="$HOME/.npm-global"' >> $BASH_ENV
      echo 'export PATH="$NPM_CONFIG_PREFIX/bin:$PATH"' >> $BASH_ENV
      echo "export RELEASE_OS=$(uname | tr '[A-Z]' '[a-z]')" >> $BASH_ENV

- run:
    name: Ensure rsync is installed
    command: |
      if [ "$RELEASE_OS" = "linux" ]; then
        sudo apt-get install -qy rsync;
      fi

# Download and cache dependencies
- restore_cache:
    keys:
    - *cache_key

- run: npm install -g esy@0.1.32
- run: esy install
- run: esy build

- save_cache:
    paths:
      - ~/.esy
    key: *cache_key

- run:
    name: Producing release
    command: make build-release
- run:
    name: Preparing release tarball
    command: mv "_release/$(cd _release && npm pack 2>/dev/null)" _release/reason-cli.tgz
- run:
    name: Installing release
{'fraction_non_alphanumeric': 0.1398912506178942, 'fraction_numerical': 0.007909045971329708, 'mean_word_length': 3.048, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6395921', 'n_tokens_mistral': 725, 'n_tokens_neox': 690, 'n_words': 184}