From 6c9e86a37f05efaa0fe55ea7c3cd8c91ec87d642 Mon Sep 17 00:00:00 2001 From: erjia Date: Thu, 26 May 2022 14:40:23 +0000 Subject: [PATCH] Add conda token for test channel --- .github/workflows/_build_test_upload.yml | 13 ++++++++++--- .github/workflows/test_release.yml | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/_build_test_upload.yml b/.github/workflows/_build_test_upload.yml index af8e397e4..211e16f06 100644 --- a/.github/workflows/_build_test_upload.yml +++ b/.github/workflows/_build_test_upload.yml @@ -21,6 +21,8 @@ on: required: false CONDA_PYTORCHBOT_TOKEN: required: false + CONDA_TEST_PYTORCHBOT_TOKEN: + required: false CONDA_NIGHTLY_PYTORCHBOT_TOKEN: required: false @@ -298,8 +300,13 @@ jobs: if [[ ${{ needs.get_release_type.outputs.type }} == 'official' ]]; then CONDA_CHANNEL=pytorch + CONDA_TOKEN=${CONDA_PYTORCHBOT_TOKEN} + elif [[ ${{ needs.get_release_type.outputs.type }} == 'test' ]]; then + CONDA_CHANNEL=pytorch-${{ needs.get_release_type.outputs.type }} + CONDA_TOKEN=${CONDA_TEST_PYTORCHBOT_TOKEN} else CONDA_CHANNEL=pytorch-${{ needs.get_release_type.outputs.type }} + CONDA_TOKEN=${CONDA_NIGHTLY_PYTORCHBOT_TOKEN} fi if [[ ${{ needs.get_release_type.outputs.type }} == 'nightly' ]]; then @@ -316,7 +323,7 @@ jobs: for new_package in ./$subdir/torchdata-*-$build.tar.bz2; do if [[ -f "$new_package" ]]; then echo "Removing $CONDA_CHANNEL/torchdata/$version/$subdir/torchdata-$version-$build.tar.bz2" - anaconda -t "${CONDA_NIGHTLY_PYTORCHBOT_TOKEN}" remove -f "$CONDA_CHANNEL/torchdata/$version/$subdir/torchdata-$version-$build.tar.bz2" + anaconda -t "${CONDA_TOKEN}" remove -f "$CONDA_CHANNEL/torchdata/$version/$subdir/torchdata-$version-$build.tar.bz2" break fi done @@ -325,10 +332,10 @@ jobs: fi done # Upload new conda packages per subdir - anaconda -t "${CONDA_NIGHTLY_PYTORCHBOT_TOKEN}" upload ./$subdir/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force + anaconda -t "${CONDA_TOKEN}" upload ./$subdir/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force done else - anaconda -t "${CONDA_PYTORCHBOT_TOKEN}" upload ./*/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force + anaconda -t "${CONDA_TOKEN}" upload ./*/torchdata-*.tar.bz2 -u "$CONDA_CHANNEL" --label main --no-progress --force fi build_docs: diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index a18394eda..811118139 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -33,4 +33,4 @@ jobs: secrets: PYTORCH_BINARY_AWS_ACCESS_KEY_ID: ${{ secrets.PYTORCH_BINARY_AWS_ACCESS_KEY_ID }} PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY: ${{ secrets.PYTORCH_BINARY_AWS_SECRET_ACCESS_KEY }} - CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} + CONDA_TEST_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_TEST_PYTORCHBOT_TOKEN }}