-
Notifications
You must be signed in to change notification settings - Fork 2
/
conda-build.ps1
35 lines (30 loc) · 987 Bytes
/
conda-build.ps1
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
Param(
$recipe = 'conda-recipe',
[switch] $upload = $false
)
$user = 'openhydrology'
$channel = 'main'
$pyversions = '3.3', '3.4'
$build_platform = 'win-64'
$other_platforms = 'osx-64', 'linux-64'
$build_folder = "$env:LOCALAPPDATA\Continuum\Miniconda3\conda-bld"
$built_pkgs = @()
foreach ($pyversion in $pyversions) {
conda build $recipe --python=$pyversion
if ($lastexitcode -ne 0) {
Throw "Conda build failed with exit code $lastexitcode"
}
$pkg = conda build $recipe --python=$pyversion --output
$built_pkgs += $pkg
$pkg_name = (Get-Item $pkg).Name
foreach ($platform in $other_platforms) {
conda convert --platform $platform --output-dir $build_folder $pkg
if ($lastexitcode -ne 0) {
Throw "Conda convert failed with exit code $lastexitcode"
}
$built_pkgs += "$build_folder\$platform\$pkg_name"
}
}
if ($upload) {
anaconda upload --user $user --channel $channel --force $built_pkgs
}