forked from pythonnet/pythonnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappveyor_build_recipe.ps1
More file actions
39 lines (32 loc) · 1.4 KB
/
appveyor_build_recipe.ps1
File metadata and controls
39 lines (32 loc) · 1.4 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
# Build `conda.recipe` only if this is a Pull_Request. Saves time for CI.
$env:CONDA_PY = "$env:PY_VER"
# Use pre-installed miniconda. Note that location differs if 64bit
$env:CONDA_BLD = "C:\miniconda36"
if ($env:PLATFORM -eq "x86"){
$env:CONDA_BLD_ARCH=32
} else {
$env:CONDA_BLD_ARCH=64
$env:CONDA_BLD = "$env:CONDA_BLD" + "-x64"
}
if ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_TAG_NAME -or $env:FORCE_CONDA_BUILD -eq "True") {
# Update PATH, and keep a copy to restore at end of this PowerShell script
$old_path = $env:path
$env:path = "$env:CONDA_BLD;$env:CONDA_BLD\Scripts;" + $env:path
Write-Host "Starting conda install" -ForegroundColor "Green"
conda config --set always_yes True
conda config --set changeps1 False
conda config --set auto_update_conda False
conda install conda-build jinja2 anaconda-client --quiet
conda info
# why `2>&1 | %{ "$_" }`? Redirect STDERR to STDOUT
# see: http://stackoverflow.com/a/20950421/5208670
Write-Host "Starting conda build recipe" -ForegroundColor "Green"
conda build conda.recipe --quiet 2>&1 | %{ "$_" }
$CONDA_PKG=(conda build conda.recipe --output)
Copy-Item $CONDA_PKG .\dist\
Write-Host "Completed conda build recipe" -ForegroundColor "Green"
# Restore PATH back to original
$env:path = $old_path
} else {
Write-Host "Skipping conda build recipe" -ForegroundColor "Green"
}