<commit_before>name: NPM

on: [push, pull_request]

jobs:
  build:
    name: Build
    strategy:
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
        node: [13]

    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install Dependencies
        run: npm install

      - name: Test
        run: npm test

  pack:
    name: Pack
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 13
      - run: npm install
      - run: ./scripts/generate-version.sh
      - run: ./scripts/npm-pack-testing.sh
        env:
          WECHATY_PUPPET_PADPLUS_TOKEN: ${{ secrets.WECHATY_PUPPET_PADPLUS_TOKEN }}

  publish:
    if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/v'))
    name: Publish
    needs: [build, pack]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 13
          registry-url: https://registry.npmjs.org/
      - run: npm install
      - run: ./scripts/generate-version.sh
      - run: ./scripts/package-publish-config-tag.sh
      - run: npm run dist

      - name: Check Branch
        id: check-branch
        run: |
          if [[ ${{ github.ref }} =~ ^refs/heads/(master|v[0-9]+\.[0-9]+.*)$ ]]; then
              echo ::set-output name=match::true
          fi  # See: https://stackoverflow.com/a/58869470/1123955
      - name: Is A Publish Branch
        if: steps.check-branch.outputs.match == 'true'
        run: |
          NAME=$(npx pkg-jq -r .name)
          VERSION=$(npx pkg-jq -r .version)
          if npx version-exists "$NAME" "$VERSION"
          then echo "$NAME@$VERSION exists on NPM, skipped."
          else npm publish
          fi
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
      - name: Is Not A Publish Branch
        if: steps.check-branch.outputs.match != 'true'
        run: echo 'Not A Publish Branch'
<commit_msg>Downgrade to node v10 (#https://github.com/wechaty/wechaty-puppet-padplus/pull/200)<commit_after>name: NPM

on: [push, pull_request]

jobs:
  build:
    name: Build
    strategy:
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
        node: [10]

    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install Dependencies
        run: npm install

      - name: Test
        run: npm test

  pack:
    name: Pack
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 10
      - run: npm install
      - run: ./scripts/generate-version.sh
      - run: ./scripts/npm-pack-testing.sh
        env:
          WECHATY_PUPPET_PADPLUS_TOKEN: ${{ secrets.WECHATY_PUPPET_PADPLUS_TOKEN }}

  publish:
    if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/v'))
    name: Publish
    needs: [build, pack]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 10
          registry-url: https://registry.npmjs.org/
      - run: npm install
      - run: ./scripts/generate-version.sh
      - run: ./scripts/package-publish-config-tag.sh
      - run: npm run dist

      - name: Check Branch
        id: check-branch
        run: |
          if [[ ${{ github.ref }} =~ ^refs/heads/(master|v[0-9]+\.[0-9]+.*)$ ]]; then
              echo ::set-output name=match::true
          fi  # See: https://stackoverflow.com/a/58869470/1123955
      - name: Is A Publish Branch
        if: steps.check-branch.outputs.match == 'true'
        run: |
          NAME=$(npx pkg-jq -r .name)
          VERSION=$(npx pkg-jq -r .version)
          if npx version-exists "$NAME" "$VERSION"
          then echo "$NAME@$VERSION exists on NPM, skipped."
          else npm publish
          fi
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
      - name: Is Not A Publish Branch
        if: steps.check-branch.outputs.match != 'true'
        run: echo 'Not A Publish Branch'

{'fraction_non_alphanumeric': 0.13511749347258487, 'fraction_numerical': 0.014577893820713663, 'mean_word_length': 1.8875628140703518, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7453938', 'n_tokens_mistral': 1590, 'n_tokens_neox': 1488, 'n_words': 344}