Skip to content

Commit dacc326

Browse files
authored
Add custom policy for publishing nightly wheels (#7308)
Allow to use gha_workflow_build_preview_wheels_policy for publishing forge wheels
1 parent 09967d3 commit dacc326

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.github/workflows/_binary_upload.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ on:
4141
required: false
4242
type: string
4343
default: ''
44+
wheel-nightly-policy:
45+
description: Custom wheel upload policy for nightly
46+
type: string
47+
default: ''
4448
secrets:
4549
PYPI_API_TOKEN:
4650
description: An optional token to upload to pypi
@@ -84,7 +88,7 @@ jobs:
8488
if: ${{ inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) }}
8589
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
8690
with:
87-
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels
91+
role-to-assume: arn:aws:iam::749337293305:role/${{ (inputs.wheel-nightly-policy != '' && inputs.wheel-nightly-policy) || 'gha_workflow_nightly_build_wheels'}}
8892
aws-region: us-east-1
8993

9094
- name: Configure aws credentials (pytorch account)

.github/workflows/build_wheels_linux.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ on:
9696
description: Custom wheel upload path
9797
required: false
9898
type: string
99+
wheel-nightly-policy:
100+
description: Custom wheel upload policy for nightly
101+
type: string
102+
default: ''
103+
run-smoke-test:
104+
description: Set to true if smoke test is needed
105+
required: false
106+
type: boolean
107+
default: true
99108
pip-install-torch-extra-args:
100109
# NOTE: Why does this exist?
101110
# Well setuptools / python packaging doesn't actually allow you to specify dependencies
@@ -278,6 +287,7 @@ jobs:
278287
repository: ${{ inputs.repository }}
279288
script: ${{ inputs.post-script }}
280289
- name: Smoke Test
290+
if: ${{ inputs.run-smoke-test }}
281291
shell: bash -l {0}
282292
env:
283293
PACKAGE_NAME: ${{ inputs.package-name }}
@@ -334,6 +344,7 @@ jobs:
334344
trigger-event: ${{ inputs.trigger-event }}
335345
upload-to-pypi: ${{ inputs.upload-to-pypi }}
336346
wheel-upload-path: ${{ inputs.wheel-upload-path }}
347+
wheel-nightly-policy: ${{ inputs.wheel-nightly-policy }}
337348
secrets:
338349
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
339350

0 commit comments

Comments
 (0)