-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathrun_win_build.bat
More file actions
executable file
·125 lines (105 loc) · 3.5 KB
/
run_win_build.bat
File metadata and controls
executable file
·125 lines (105 loc) · 3.5 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here
:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent
:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also
:: benefit from the improvement.
:: Note: we assume a Miniforge installation is available
:: INPUTS (required environment variables)
:: CONFIG: name of the .ci_support/*.yaml file for this job
:: CI: azure, github_actions, or unset
:: UPLOAD_PACKAGES: true or false
:: UPLOAD_ON_BRANCH: true or false
setlocal enableextensions enabledelayedexpansion
call :start_group "Configuring conda"
:: Activate the base conda environment
call activate base
:: Configure the solver
set "CONDA_SOLVER=libmamba"
if !errorlevel! neq 0 exit /b !errorlevel!
set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1"
:: Provision the necessary dependencies to build the recipe later
echo Installing dependencies
mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes
if !errorlevel! neq 0 exit /b !errorlevel!
:: Set basic configuration
echo Setting up configuration
setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml
if !errorlevel! neq 0 exit /b !errorlevel!
echo Running build setup
CALL run_conda_forge_build_setup
if !errorlevel! neq 0 exit /b !errorlevel!
if EXIST LICENSE.txt (
echo Copying feedstock license
copy LICENSE.txt "recipe\\recipe-scripts-license.txt"
)
if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] (
if [%CROSSCOMPILING_EMULATOR%] == [] (
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test"
)
)
if NOT [%flow_run_id%] == [] (
set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%"
)
call :end_group
:: Build the recipe
echo Building recipe
conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS%
if !errorlevel! neq 0 exit /b !errorlevel!
:: Prepare some environment variables for the upload step
if /i "%CI%" == "github_actions" (
set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%"
set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%"
if /i "%GITHUB_EVENT_NAME%" == "pull_request" (
set "IS_PR_BUILD=True"
) else (
set "IS_PR_BUILD=False"
)
set "TEMP=%RUNNER_TEMP%"
)
if /i "%CI%" == "azure" (
set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%"
set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%"
if /i "%BUILD_REASON%" == "PullRequest" (
set "IS_PR_BUILD=True"
) else (
set "IS_PR_BUILD=False"
)
set "TEMP=%UPLOAD_TEMP%"
)
:: Validate
call :start_group "Validating outputs"
validate_recipe_outputs "%FEEDSTOCK_NAME%"
if !errorlevel! neq 0 exit /b !errorlevel!
call :end_group
if /i "%UPLOAD_PACKAGES%" == "true" (
if /i "%IS_PR_BUILD%" == "false" (
call :start_group "Uploading packages"
if not exist "%TEMP%\" md "%TEMP%"
set "TMP=%TEMP%"
upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml
if !errorlevel! neq 0 exit /b !errorlevel!
call :end_group
)
)
exit
:: Logging subroutines
:start_group
if /i "%CI%" == "github_actions" (
echo ::group::%~1
exit /b
)
if /i "%CI%" == "azure" (
echo ##[group]%~1
exit /b
)
echo %~1
exit /b
:end_group
if /i "%CI%" == "github_actions" (
echo ::endgroup::
exit /b
)
if /i "%CI%" == "azure" (
echo ##[endgroup]
exit /b
)
exit /b