diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index a101466a61..f9355aacf6 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -1,6 +1,9 @@ name: Release binary to pypi on: + pull_request: + paths: + - .github/workflows/release-pypi.yml workflow_dispatch: inputs: dryrun: @@ -30,16 +33,10 @@ jobs: trigger: runs-on: ubuntu-latest timeout-minutes: 60 - environment: promote-env container: image: pytorch/almalinux-builder:cpu steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Configure aws credentials (pytorch account) - uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2 - with: - role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_promote_wheels - aws-region: us-east-1 - name: Copy staged binaries shell: bash env: @@ -51,13 +48,9 @@ jobs: pip install awscli==1.32.18 # Init release versions variables - source release/pypi/release_versions.sh + source ./release/release_versions.sh # shellcheck disable=SC2086 version="${PACKAGE^^}_VERSION" mkdir dist/ # shellcheck disable=SC2086 aws s3 sync "s3://pytorch-backup/${PACKAGE}-${!version}-pypi-staging/" dist/ --debug - - - name: Publish package to PyPI - if: ${{ inputs.dryrun == 'disabled' }} - uses: pypa/gh-action-pypi-publish@release/v1