blob: ae88ca0fcdd1514453a8faf74d555e2e0d7e8fb5 [file]
name: publish binaries
on:
release:
types: [published]
permissions:
contents: write # actions/upload-release-asset needs this.
jobs:
publish:
name: publish (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
pathsep: ";"
asset_name: black_windows.exe
executable_mime: "application/vnd.microsoft.portable-executable"
- os: windows-11-arm
pathsep: ";"
asset_name: black_windows-arm.exe
executable_mime: "application/vnd.microsoft.portable-executable"
- os: ubuntu-latest
pathsep: ":"
asset_name: black_linux
executable_mime: "application/x-executable"
- os: ubuntu-24.04-arm
pathsep: ":"
asset_name: black_linux-arm
executable_mime: "application/x-executable"
- os: macos-latest
pathsep: ":"
asset_name: black_macos
executable_mime: "application/x-mach-binary"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up latest Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.13"
pip-version: "25.3"
pip-install: .[colorama] --group pyinstaller
- name: Build executable with PyInstaller
run:
python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data
'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
- name: Quickly test executable
run: |
./dist/${{ matrix.asset_name }} --version
./dist/${{ matrix.asset_name }} src --verbose
- name: Upload binary as release asset
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
files: dist/${{ matrix.asset_name }}