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