From 9d6ba13d3444b3be8a7932045cf458db36721ec8 Mon Sep 17 00:00:00 2001 From: Benson Ma Date: Wed, 6 Sep 2023 18:19:27 -0700 Subject: [PATCH] =?UTF-8?q?Make=20publishing=20to=20PyPI=20optional=20in?= =?UTF-8?q?=20the=20OSS=20=E2=80=A6=20(#2003)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: …workflows - Include the option to disable publishing to PyPI when running the Release and Nightly OSS workflows Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/2003 Reviewed By: spcyppt Differential Revision: D49040359 Pulled By: q10 fbshipit-source-id: 8cede1906e3b827a22522305ce31e9505383c4fd --- .github/workflows/fbgemm_gpu_cpu_nightly.yml | 8 +++++++- .github/workflows/fbgemm_gpu_cpu_release.yml | 8 +++++++- .github/workflows/fbgemm_gpu_cuda_nightly.yml | 8 +++++++- .github/workflows/fbgemm_gpu_cuda_release.yml | 8 +++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fbgemm_gpu_cpu_nightly.yml b/.github/workflows/fbgemm_gpu_cpu_nightly.yml index 299f1c655..32c4efd7f 100644 --- a/.github/workflows/fbgemm_gpu_cpu_nightly.yml +++ b/.github/workflows/fbgemm_gpu_cpu_nightly.yml @@ -29,6 +29,12 @@ on: # Manual Trigger # workflow_dispatch: + inputs: + publish_to_pypi: + description: Publish Artifact to PyPI + type: boolean + required: false + default: false concurrency: # Cancel previous runs in the PR if a new commit is pushed @@ -172,7 +178,7 @@ jobs: run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV cpu - name: Push FBGEMM_GPU Nightly (CPU version) Binary to PYPI - if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} + if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && github.event.inputs.publish_to_pypi == 'true' }} env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: . $PRELUDE; publish_to_pypi $BUILD_ENV fbgemm_gpu_nightly_cpu-*.whl "$PYPI_TOKEN" diff --git a/.github/workflows/fbgemm_gpu_cpu_release.yml b/.github/workflows/fbgemm_gpu_cpu_release.yml index 95f18934c..ba65181d3 100644 --- a/.github/workflows/fbgemm_gpu_cpu_release.yml +++ b/.github/workflows/fbgemm_gpu_cpu_release.yml @@ -21,6 +21,12 @@ on: # Manual Trigger # workflow_dispatch: + inputs: + publish_to_pypi: + description: Publish Artifact to PyPI + type: boolean + required: false + default: false concurrency: # Cancel previous runs in the PR if a new commit is pushed @@ -159,7 +165,7 @@ jobs: run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV cpu - name: Push FBGEMM_GPU (CPU version) Binary to PYPI - if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' }} + if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && github.event.inputs.publish_to_pypi == 'true' }} env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: . $PRELUDE; publish_to_pypi $BUILD_ENV fbgemm_gpu_cpu-*.whl "$PYPI_TOKEN" diff --git a/.github/workflows/fbgemm_gpu_cuda_nightly.yml b/.github/workflows/fbgemm_gpu_cuda_nightly.yml index 29e89b4ff..f1c81ebfd 100644 --- a/.github/workflows/fbgemm_gpu_cuda_nightly.yml +++ b/.github/workflows/fbgemm_gpu_cuda_nightly.yml @@ -29,6 +29,12 @@ on: # Manual Trigger # workflow_dispatch: + inputs: + publish_to_pypi: + description: Publish Artifact to PyPI + type: boolean + required: false + default: false concurrency: # Cancel previous runs in the PR if a new commit is pushed @@ -178,7 +184,7 @@ jobs: run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV - name: Push FBGEMM_GPU Nightly Binary to PYPI - if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && matrix.cuda-version == matrix.cuda-version-publish }} + if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && github.event.inputs.publish_to_pypi == 'true' && matrix.cuda-version == matrix.cuda-version-publish }} env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: . $PRELUDE; publish_to_pypi $BUILD_ENV fbgemm_gpu_nightly-*.whl "$PYPI_TOKEN" diff --git a/.github/workflows/fbgemm_gpu_cuda_release.yml b/.github/workflows/fbgemm_gpu_cuda_release.yml index f5e3bdcb1..a273dae06 100644 --- a/.github/workflows/fbgemm_gpu_cuda_release.yml +++ b/.github/workflows/fbgemm_gpu_cuda_release.yml @@ -21,6 +21,12 @@ on: # Manual Trigger # workflow_dispatch: + inputs: + publish_to_pypi: + description: Publish Artifact to PyPI + type: boolean + required: false + default: false concurrency: # Cancel previous runs in the PR if a new commit is pushed @@ -165,7 +171,7 @@ jobs: run: . $PRELUDE; cd fbgemm_gpu/test; run_fbgemm_gpu_tests $BUILD_ENV - name: Push FBGEMM_GPU Binary to PYPI - if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && matrix.cuda-version == matrix.cuda-version-publish }} + if: ${{ github.event_name != 'pull_request' && github.event_name != 'push' && github.event.inputs.publish_to_pypi == 'true' && matrix.cuda-version == matrix.cuda-version-publish }} env: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} run: . $PRELUDE; publish_to_pypi $BUILD_ENV fbgemm_gpu-*.whl "$PYPI_TOKEN"