All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 name: Publish executables
8 contents: write # actions/upload-release-asset needs this.
12 runs-on: ${{ matrix.os }}
16 os: [windows-2019, ubuntu-20.04, macos-latest]
20 asset_name: black_windows.exe
21 executable_mime: "application/vnd.microsoft.portable-executable"
24 asset_name: black_linux
25 executable_mime: "application/x-executable"
28 asset_name: black_macos
29 executable_mime: "application/x-mach-binary"
32 - uses: actions/checkout@v4
34 - name: Set up latest Python
35 uses: actions/setup-python@v4
39 - name: Install Black and PyInstaller
41 python -m pip install --upgrade pip wheel
42 python -m pip install .[colorama]
43 python -m pip install pyinstaller
45 - name: Build executable with PyInstaller
47 python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data
48 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
50 - name: Quickly test executable
52 ./dist/${{ matrix.asset_name }} --version
53 ./dist/${{ matrix.asset_name }} src --verbose
55 - name: Upload binary as release asset
56 uses: actions/upload-release-asset@v1
58 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 upload_url: ${{ github.event.release.upload_url }}
61 asset_path: dist/${{ matrix.asset_name }}
62 asset_name: ${{ matrix.asset_name }}
63 asset_content_type: ${{ matrix.executable_mime }}