Skip to content

Commit 388121f

Browse files
committed
Update to test with twine
Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
1 parent 63d52b0 commit 388121f

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/workflows/weekly-preview.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
cache: 'pip'
6868
- name: Install tools
6969
run: |
70-
python -m pip install -U pip build
70+
python -m pip install -U pip build twine
7171
- name: Build distribution
7272
run: |
7373
export HEAD_COMMIT_ID=$(git rev-parse HEAD)
@@ -94,14 +94,15 @@ jobs:
9494
pip list
9595
(cd "$(mktemp -d)" && python -c 'import monai; print(monai.__version__)')
9696
- name: Publish to Test PyPI
97-
if: github.event_name != 'schedule' # only test publish on PR
98-
uses: pypa/gh-action-pypi-publish@release/v1
99-
with:
100-
repository-url: https://test.pypi.org/legacy/
101-
user: __token__
102-
password: ${{ secrets.TEST_PYPI_TOKEN }}
97+
if: github.event_name == 'pull_request' # only test publish on PR
98+
run: |
99+
twine upload -r testpypi dist/*
100+
env:
101+
TWINE_USERNAME: __token__
102+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
103+
TWINE_NON_INTERACTIVE: true
103104
- name: Publish to PyPI
104-
if: github.event_name == 'schedule' # only publish on cron run
105+
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' # only publish on cron or manual run
105106
uses: pypa/gh-action-pypi-publish@release/v1
106107
with:
107108
user: __token__

0 commit comments

Comments
 (0)