<commit_before>name: Upload self-contained binaries

on:
  release:
    types: [published]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-2019, ubuntu-20.04, macos-latest]
        include:
          - os: windows-2019
            pathsep: ";"
            asset_name: black_windows.exe
            executable_mime: "application/vnd.microsoft.portable-executable"
            platform: windows
          - os: ubuntu-20.04
            pathsep: ":"
            asset_name: black_linux
            executable_mime: "application/x-executable"
            platform: unix
          - os: macos-latest
            pathsep: ":"
            asset_name: black_macos
            executable_mime: "application/x-mach-binary"
            platform: macos

    steps:
      - uses: actions/checkout@v2

      - name: Set up latest Python
        uses: actions/setup-python@v2
        with:
          python-version: "*"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip wheel setuptools
          python -m pip install .
          python -m pip install pyinstaller

      - name: Build binary
        run: >
          python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data
          'src/blib2to3${{ matrix.pathsep }}blib2to3' --hidden-import platformdirs.${{
          matrix.platform }} src/black/__main__.py

      - name: Upload binary as release asset<commit_msg>Remove hidden import from PyInstaller build (#2657)<commit_after>name: Upload self-contained binaries

on:
  release:
    types: [published]

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [windows-2019, ubuntu-20.04, macos-latest]
        include:
          - os: windows-2019
            pathsep: ";"
            asset_name: black_windows.exe
            executable_mime: "application/vnd.microsoft.portable-executable"
          - os: ubuntu-20.04
            pathsep: ":"
            asset_name: black_linux
            executable_mime: "application/x-executable"
          - os: macos-latest
            pathsep: ":"
            asset_name: black_macos
            executable_mime: "application/x-mach-binary"

    steps:
      - uses: actions/checkout@v2

      - name: Set up latest Python
        uses: actions/setup-python@v2
        with:
          python-version: "*"

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip wheel setuptools
          python -m pip install .
          python -m pip install pyinstaller

      - name: Build binary
        run: |
          python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py

      - name: Upload binary as release asset
{'fraction_non_alphanumeric': 0.101159114857745, 'fraction_numerical': 0.01685985247629083, 'mean_word_length': 1.786692759295499, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, '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': '4607135', 'n_tokens_mistral': 886, 'n_tokens_neox': 822, 'n_words': 206}