Skip to content

Commit

Permalink
Support for Test Conda Token
Browse files Browse the repository at this point in the history
  • Loading branch information
osalpekar committed Aug 30, 2023
1 parent 609c174 commit 84d6614
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build_conda_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ on:
type: string
secrets:
CONDA_PYTORCHBOT_TOKEN:
description: "Access Token needed to upload binaries to anaconda"
description: "Access Token needed to upload binaries to anaconda nightly channel"
required: false
CONDA_PYTORCHBOT_TOKEN_TEST:
description: "Access Token needed to upload binaries to anaconda test channel"
required: false

jobs:
Expand Down Expand Up @@ -194,12 +197,19 @@ jobs:
working-directory: ${{ inputs.repository }}
env:
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
run: |
if [[ "${CHANNEL}" = "nightly" ]]; then
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN}"
else
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN_TEST}"
fi
set -euxo pipefail
source "${BUILD_ENV_FILE}"
${CONDA_RUN} conda install --yes --quiet anaconda-client
${CONDA_RUN} anaconda \
-t "${CONDA_PYTORCHBOT_TOKEN}" \
-t "${CONDA_TOKEN}" \
upload distr/linux-64/*.tar.bz2 \
-u "pytorch-${CHANNEL}" \
--label main \
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/build_conda_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ on:
type: string
secrets:
CONDA_PYTORCHBOT_TOKEN:
description: "Access Token needed to upload binaries to anaconda"
description: "Access Token needed to upload binaries to anaconda nightly channel"
required: false
CONDA_PYTORCHBOT_TOKEN_TEST:
description: "Access Token needed to upload binaries to anaconda test channel"
required: false

jobs:
Expand Down Expand Up @@ -202,7 +205,14 @@ jobs:
working-directory: ${{ inputs.repository }}
env:
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
run: |
if [[ "${CHANNEL}" = "nightly" ]]; then
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN}"
else
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN_TEST}"
fi
set -euxo pipefail
source "${BUILD_ENV_FILE}"
Expand All @@ -214,7 +224,7 @@ jobs:
export ARCH_NAME="osx-64"
fi
${CONDA_RUN} anaconda \
-t "${CONDA_PYTORCHBOT_TOKEN}" \
-t "${CONDA_TOKEN}" \
upload "distr/${ARCH_NAME}"/*.tar.bz2 \
-u "pytorch-${CHANNEL}" \
--label main \
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/build_conda_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ on:
type: string
secrets:
CONDA_PYTORCHBOT_TOKEN:
description: "Access Token needed to upload binaries to anaconda"
description: "Access Token needed to upload binaries to anaconda nightly channel"
required: false
CONDA_PYTORCHBOT_TOKEN_TEST:
description: "Access Token needed to upload binaries to anaconda test channel"
required: false

jobs:
Expand Down Expand Up @@ -225,12 +228,19 @@ jobs:
env:
PACKAGE_NAME: ${{ inputs.package-name }}
CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }}
CONDA_PYTORCHBOT_TOKEN_TEST: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }}
run: |
if [[ "${CHANNEL}" = "nightly" ]]; then
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN}"
else
export CONDA_TOKEN="${CONDA_PYTORCHBOT_TOKEN_TEST}"
fi
set -euxo pipefail
source "${BUILD_ENV_FILE}"
${CONDA_RUN} conda install --yes --quiet anaconda-client
${CONDA_RUN} anaconda \
-t "${CONDA_PYTORCHBOT_TOKEN}" \
-t "${CONDA_TOKEN}" \
upload "distr/win-64/${PACKAGE_NAME}*.tar.bz2" \
-u "pytorch-${CHANNEL}" \
--label main \
Expand Down

0 comments on commit 84d6614

Please sign in to comment.