-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.bat
48 lines (41 loc) · 1.19 KB
/
publish.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@echo off
cls
:: if this fails, try : python -m pip install --user --upgrade setuptools wheel
set "cecho=powershell write-host -fore"
%cecho% Cyan CWD: %cd%
:: updating pip
python -m pip install pip==19.0.1
:: try catch block
python setup.py sdist bdist_wheel
if %ERRORLEVEL% neq 0 CALL:ProcessError1
:Wheel
%cecho% Cyan "Checking package wheel"
twine check dist/*
if %ERRORLEVEL% neq 0 CALL:ProcessError2
:Twine
python -m pip install -e .
%cecho% Cyan "The program will pause now. Please test the new package before publishing it."
@python test.py
set /p DUMMY=Press ENTER to continue...
%cecho% Cyan "please provide username and password for pypi"
twine upload dist/*
%cecho% Cyan "reinstalling from pypi"
python -m pip uninstall -y pconsole
python -m pip install pconsole
%cecho% Green "done"
%cecho% Cyan "showing info"
python -m pip show pconsole
pause
exit /b 0
:ProcessError1
%cecho% Red "Process failed. Redirecting..."
python -m pip install --user --upgrade setuptools wheel
goto:eof
:ProcessError2
%cecho% Red "Process failed. Redirecting..."
python -m pip install twine
goto:eof
:ECHORED
:: unused
%Windir%\System32\WindowsPowerShell\v1.0\Powershell.exe write-host -foregroundcolor Red %1
goto:eof