diff --git a/.github/actions/set-channel/action.yml b/.github/actions/set-channel/action.yml index 608f2cb16d..4870b8d7fd 100644 --- a/.github/actions/set-channel/action.yml +++ b/.github/actions/set-channel/action.yml @@ -2,12 +2,23 @@ name: Set Channel for Build Matrix Generation/Binary Build Step description: Add CHANNEL to GITHUB_ENV +inputs: + channel: + description: 'Channel to use (nightly or test). If not provided, will be auto-detected based on git ref' + required: false + default: '' runs: using: composite steps: + - name: Set CHANNEL from input + if: ${{ inputs.channel != '' }} + shell: bash + run: | + set -euxo pipefail + echo "CHANNEL=${{ inputs.channel }}" >> "${GITHUB_ENV}" - name: Set CHANNEL for tagged pushes - if: ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }} + if: ${{ inputs.channel == '' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') }} shell: bash run: | set -euxo pipefail @@ -16,7 +27,7 @@ runs: echo "CHANNEL=test" >> "${GITHUB_ENV}" fi - name: Set Release CHANNEL for release - if: ${{ (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release') }} + if: ${{ inputs.channel == '' && ((github.event_name == 'pull_request' && startsWith(github.base_ref, 'release')) || startsWith(github.ref, 'refs/heads/release')) }} shell: bash run: | set -euxo pipefail diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index f9b18db8a6..f4878d7c27 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -122,6 +122,10 @@ on: description: 'Timeout for the job (in minutes)' default: 120 type: number + channel: + description: 'Channel to use for pytorch package. Defaults to nightly, can be set to test for release candidates' + default: 'nightly' + type: string secrets: PYPI_API_TOKEN: description: An optional token to upload to pypi @@ -195,6 +199,8 @@ jobs: conda config --set ssl_verify False echo "/opt/conda/bin" >> $GITHUB_PATH - uses: ./test-infra/.github/actions/set-channel + with: + channel: ${{ inputs.channel }} - name: Set PYTORCH_VERSION if: ${{ env.CHANNEL == 'test' }} run: |