-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathrelease-pypi-windows.cmd
More file actions
41 lines (33 loc) · 1.32 KB
/
release-pypi-windows.cmd
File metadata and controls
41 lines (33 loc) · 1.32 KB
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
@echo off
setlocal EnableDelayedExpansion
SET VERSIONS=3.10 3.11 3.12 3.13 3.14
SET SOURCEDIR=%cd%
REM Accept conda Terms of Service for required channels
CALL C:\Miniconda/condabin/conda.bat tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main
CALL C:\Miniconda/condabin/conda.bat tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
REM Build packages
for %%v in (%VERSIONS%) do (
SET ENV_NAME=py%%v
REM Create and activate environment
cd %ROOT_DIR%
CALL C:\Miniconda/condabin/conda.bat config --add channels conda-forge
CALL C:\Miniconda/condabin/conda.bat config --set channel_priority strict
CALL C:\Miniconda/condabin/conda.bat create -y -n py%%v python=%%v
if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!)
CALL C:\Miniconda/condabin/conda.bat activate py%%v
if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!)
pip install --no-cache-dir build
if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!)
REM Build and package
python -m build --wheel
if !ERRORLEVEL! NEQ 0 (EXIT !ERRORLEVEL!)
REM Cleanup
CALL C:\Miniconda/condabin/conda.bat deactivate
rmdir /S /Q build OpenCC.egg-info
)
if NOT "%~1"=="testonly" (
REM Upload to PyPI
C:\Miniconda/condabin/conda.bat activate py3.10
python -m pip install twine
python -m twine upload dist/*
)