@@ -30,6 +30,18 @@ commands:
3030# git fetch --force origin ${CIRCLE_BRANCH}/merge:merged/${CIRCLE_BRANCH}
3131# git checkout "merged/$CIRCLE_BRANCH"
3232# fi
33+ designate_upload_channel :
34+ description : " inserts the correct upload channel into ${BASH_ENV}"
35+ steps :
36+ - run :
37+ name : adding UPLOAD_CHANNEL to BASH_ENV
38+ command : |
39+ our_upload_channel=nightly
40+ # On tags upload to test instead
41+ if [[ -n "${CIRCLE_TAG}" ]]; then
42+ our_upload_channel=test
43+ fi
44+ echo "export UPLOAD_CHANNEL=${our_upload_channel}" >> ${BASH_ENV}
3345
3446binary_common : &binary_common
3547 parameters :
@@ -59,7 +71,6 @@ binary_common: &binary_common
5971 default : " pytorch/manylinux-cuda101"
6072 environment :
6173 PYTHON_VERSION : << parameters.python_version >>
62- BUILD_VERSION : << parameters.build_version >>
6374 PYTORCH_VERSION : << parameters.pytorch_version >>
6475 UNICODE_ABI : << parameters.unicode_abi >>
6576 CU_VERSION : << parameters.cu_version >>
@@ -358,12 +369,13 @@ jobs:
358369 steps :
359370 - attach_workspace :
360371 at : ~/workspace
372+ - designate_upload_channel
361373 - run :
362374 command : |
363375 # Prevent credential from leaking
364376 conda install -yq anaconda-client
365377 set -x
366- anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ~/workspace/*.tar.bz2 -u pytorch-nightly --label main --no-progress --force
378+ anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ~/workspace/*.tar.bz2 -u " pytorch-${UPLOAD_CHANNEL}" --label main --no-progress --force
367379
368380 # Requires org-member context
369381 binary_wheel_upload :
@@ -376,6 +388,7 @@ jobs:
376388 steps :
377389 - attach_workspace :
378390 at : ~/workspace
391+ - designate_upload_channel
379392 - checkout
380393 - run :
381394 command : |
@@ -387,7 +400,7 @@ jobs:
387400 export AWS_SECRET_ACCESS_KEY="${PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY}"
388401 set -x
389402 for pkg in ~/workspace/*.whl; do
390- aws s3 cp "$pkg" "s3://pytorch/whl/nightly /<< parameters.subfolder >>" --acl public-read
403+ aws s3 cp "$pkg" "s3://pytorch/whl/${UPLOAD_CHANNEL} /<< parameters.subfolder >>" --acl public-read
391404 done
392405
393406
0 commit comments