Skip to content

Commit 3051bc6

Browse files
committed
Improved upload command, with output
1 parent 52ec2a4 commit 3051bc6

1 file changed

Lines changed: 23 additions & 18 deletions

File tree

.appveyor.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,26 @@ artifacts:
8484
- path: 'conda-bld\win-*\*.tar.bz2'
8585

8686
on_success:
87-
# This is virtually impossible with a normal dos batch script...
88-
# Upload to anaconda, with the correct label derived from the version tag.
89-
- ps:
90-
if (($Env:APPVEYOR_REPO_TAG -eq "true") -and
91-
($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) {
92-
$tar_glob = ".\conda-bld\win-*\${Env:PROJECT_NAME}-${Env:APPVEYOR_REPO_TAG_NAME}-*.tar.bz2";
93-
Write-Host $tar_glob;
94-
if ($Env:APPVEYOR_REPO_TAG_NAME -like "*a*") {
95-
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
96-
$tar_glob --no-progress -l alpha" -Wait -Passthru
97-
} elseif ($Env:APPVEYOR_REPO_TAG_NAME -like "*b*") {
98-
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
99-
$tar_glob --no-progress -l beta" -Wait -Passthru
100-
} else {
101-
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
102-
$tar_glob --no-progress" -Wait -Passthru
103-
}
104-
}
87+
# Upload to anaconda, with the correct label derived from the version tag.
88+
# This is virtually impossible with a normal dos batch script...
89+
# It also contains an incredibly clunky way to avoid build failure when anaconda writes
90+
# something harmless to stderr. The normal way does not work!
91+
# & anaconda $parameters 2>&1
92+
# Powershell should be called Powerhell!
93+
- ps:
94+
if (($Env:APPVEYOR_REPO_TAG -eq "true") -and
95+
($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) {
96+
$tar_glob = ".\conda-bld\win-*\${Env:PYPKG}-${Env:APPVEYOR_REPO_TAG_NAME}-*.tar.bz2";
97+
Write-Host "tar_glob $tar_glob";
98+
if ($Env:APPVEYOR_REPO_TAG_NAME -like "*a*") {
99+
$anaconda_label = "alpha"
100+
} elseif ($Env:APPVEYOR_REPO_TAG_NAME -like "*b*") {
101+
$anaconda_label = "beta"
102+
} else {
103+
$anaconda_label = "main"
104+
};
105+
Write-Host "anaconda_label $anaconda_label";
106+
$parameters = '-t', "$Env:ANACONDA_TOKEN", 'upload', "$tar_glob", '-l',
107+
"$anaconda_label", '--force', '--no-progress';
108+
& cmd /c 'anaconda 2>&1' $parameters;
109+
}

0 commit comments

Comments
 (0)