summaryrefslogtreecommitdiff
path: root/tools/release_windows.bat
blob: 48f2548f823fc60d670effda837e951424dccd8d (plain)
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
49
50
51
@echo off
REM build a pyzmq release on Windows
REM 32+64b eggs on Python 27, and wheels on 27, 34
REM that's 6 bdists
REM requires Windows SDK 7.0 (for py2) and 7.1 (for py3)
REM and Python installed in the locations: C:\Python34 (32b) and C:\Python34_64 (64b)

REM run with cmd /k tools/release_windows.bat

setlocal EnableDelayedExpansion

set SDKS=C:\Program Files\Microsoft SDKs\Windows
set SDK7=%SDKS%\v7.0
set SDK71=%SDKS%\v7.1
set DISTUTILS_USE_SDK=1
set UPLOAD=%~1
set PYROOT=C:\

for %%p in (34, 27) do (
  if "%%p"=="27" (
    set SDK=%SDK7%
  ) else (
    set SDK=%SDK71%
  )
  
  if "%%p"=="34" (
    set cmd=build bdist_wheel --zmq=bundled %UPLOAD%
  ) else (
    set cmd=build bdist_egg bdist_wheel --zmq=bundled %UPLOAD%
  )
  for %%b in (64, 32) do (
    if "%%b"=="64" (
      set SUFFIX=_64
      set ARCH=/x64
    ) else (
      set SUFFIX=
      set ARCH=/x86
    )
    set PY=%PYROOT%\Python%%p!SUFFIX!\Python
    echo !PY! !SDK!
    !PY! -m pip install --upgrade setuptools pip wheel
    
    @call "!SDK!\Bin\SetEnv.cmd" /release !ARCH!
    if !errorlevel! neq 0 exit /b !errorlevel!
    @echo on
    !PY! setupegg.py !cmd!
    @echo off
    if !errorlevel! neq 0 exit !errorlevel!
  )
)
exit