From 26afaeedbcf0f7c396f5762cc78984d67f69bae3 Mon Sep 17 00:00:00 2001 From: Erjia Guan Date: Thu, 26 May 2022 08:43:23 -0700 Subject: [PATCH] Add conda token for test channel (#472) Summary: We have one missing token for conda RC channel. See: https://github.com/pytorch/data/actions/runs/2390820859 After devinfra team provides, we need to update the test_release workflow correspondingly. Pull Request resolved: https://github.com/pytorch/data/pull/472 Reviewed By: NivekT, atalman Differential Revision: D36703135 Pulled By: ejguan fbshipit-source-id: d63f73cb82e8db671567e050bef8a2c50ba9a69b --- .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 c822d4ff3..214ed5fc2 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 }}