Skip to content

Commit

Permalink
Make publishing to PyPI optional in the OSS … (pytorch#2003)
Browse files Browse the repository at this point in the history
Summary:
…workflows

- Include the option to disable publishing to PyPI when running the Release and Nightly OSS workflows

Pull Request resolved: pytorch#2003

Reviewed By: spcyppt

Differential Revision: D49040359

Pulled By: q10

fbshipit-source-id: 8cede1906e3b827a22522305ce31e9505383c4fd
  • Loading branch information
q10 authored and facebook-github-bot committed Sep 7, 2023
1 parent a695e77 commit 9d6ba13
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/fbgemm_gpu_cpu_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
8 changes: 7 additions & 1 deletion .github/workflows/fbgemm_gpu_cpu_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
8 changes: 7 additions & 1 deletion .github/workflows/fbgemm_gpu_cuda_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
8 changes: 7 additions & 1 deletion .github/workflows/fbgemm_gpu_cuda_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

0 comments on commit 9d6ba13

Please sign in to comment.