@@ -107,14 +107,6 @@ jobs:
107
107
displayName : ' Publish Test Results'
108
108
condition : eq(variables['SKIP_BUILD'], 'false')
109
109
110
- - bash : echo "##vso[task.prependpath]$CONDA/Scripts"
111
- displayName : Add conda to PATH
112
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
113
-
114
- - bash : conda install -q -y anaconda-client
115
- displayName : Install anaconda-client
116
- condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
117
-
118
110
- bash : |
119
111
set -e
120
112
if [ "$BUILD_REASON" == "Schedule" ]; then
@@ -124,18 +116,23 @@ jobs:
124
116
ANACONDA_ORG="scikit-learn-wheels-staging"
125
117
TOKEN="$SCIKIT_LEARN_STAGING_UPLOAD_TOKEN"
126
118
fi
127
- if [ "$TOKEN" == "" ]; then
128
- echo "##[warning] Could not find anaconda.org upload token in secret variables"
129
- fi
130
119
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
131
120
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
132
121
displayName: Retrieve secret upload token
133
- condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
122
+ condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'), variables['SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN'], variables['SCIKIT_LEARN_STAGING_UPLOAD_TOKEN'] )
134
123
env:
135
124
# Secret variables need to mapped to env variables explicitly:
136
125
SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN: $(SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN)
137
126
SCIKIT_LEARN_STAGING_UPLOAD_TOKEN: $(SCIKIT_LEARN_STAGING_UPLOAD_TOKEN)
138
127
128
+ - bash : echo "##vso[task.prependpath]$CONDA/Scripts"
129
+ displayName : Add conda to PATH
130
+ condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'), variables['TOKEN'])
131
+
132
+ - bash : conda install -q -y anaconda-client
133
+ displayName : Install anaconda-client
134
+ condition : and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'), variables['TOKEN'])
135
+
139
136
- bash : |
140
137
set -e
141
138
# The --force option forces a replacement if the remote file already
@@ -144,4 +141,4 @@ jobs:
144
141
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG scikit-learn/dist/scikit_learn-*.whl
145
142
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
146
143
displayName: Upload to anaconda.org (only if secret token is retrieved)
147
- condition: ne( variables['TOKEN'], '')
144
+ condition: variables['TOKEN']
0 commit comments