8000 Add sanity check to executable CD + more (#3190) · IBMZ-Linux-OSS-Python/black@eaa0489 · GitHub
[go: up one dir, main page]

Skip to content

Commit eaa0489

Browse files< 10000 /span>
authored
Add sanity check to executable CD + more (psf#3190)
Building executables without any testing is quite sketchy, let's at least verify they won't crash on startup and format Black's own codebase. Also replaced "binaries" with "executables" since it's clearer and won't be confused with mypyc. Finally, I added colorama so all Windows users can get colour.
1 parent d85cf00 commit eaa0489

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

.github/workflows/upload_binary.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
name: Upload self-contained binaries
1+
name: Publish executables
22

33
on:
44
release:
55
types: [published]
66

77
permissions:
8-
contents: read
8+
contents: write # actions/upload-release-asset needs this.
99

1010
jobs:
1111
build:
12-
permissions:
13-
contents: write # for actions/upload-release-asset to upload release asset
1412
runs-on: ${{ matrix.os }}
1513
strategy:
1614
fail-fast: false
@@ -38,15 +36,21 @@ jobs:
3836
with:
3937
python-version: "*"
4038

41-
- name: Install dependencies
39+
- name: Install Black and PyInstaller
4240
run: |
43-
python -m pip install --upgrade pip wheel setuptools
44-
python -m pip install .
41+
python -m pip install --upgrade pip wheel
42+
python -m pip install .[colorama]
4543
python -m pip install pyinstaller
4644
47-
- name: Build binary
45+
- name: Build executable with PyInstaller
46+
run: >
47+
python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data
48+
'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
49+
50+
- name: Quickly test executable
4851
run: |
49-
python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
52+
./dist/${{ matrix.asset_name }} --version
53+
./dist/${{ matrix.asset_name }} src --verbose
5054
5155
- name: Upload binary as release asset
5256
uses: actions/upload-release-asset@v1

0 commit comments

Comments
 (0)
0