From 6013b721b829c612d93d907c284c82505208b7c2 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sun, 21 Apr 2024 23:52:03 +0800 Subject: [PATCH 1/4] Disable the progress bar when exec twine upload --- twine-upload.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twine-upload.sh b/twine-upload.sh index 62de5d5..e265633 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -39,6 +39,7 @@ INPUT_PACKAGES_DIR="$(get-normalized-input 'packages-dir')" INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')" INPUT_SKIP_EXISTING="$(get-normalized-input 'skip-existing')" INPUT_PRINT_HASH="$(get-normalized-input 'print-hash')" +INPUT_DISABLE_PROGRESS_BAR="$(get-normalized-input 'disable-progress-bar')" PASSWORD_DEPRECATION_NUDGE="::error title=Password-based uploads deprecated::\ Starting in 2024, PyPI will require all users to enable Two-Factor \ @@ -133,6 +134,8 @@ if [[ ${INPUT_PRINT_HASH,,} != "false" || ${INPUT_VERBOSE,,} != "false" ]] ; the python /app/print-hash.py ${INPUT_PACKAGES_DIR%%/} fi +TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS" + TWINE_USERNAME="$INPUT_USER" \ TWINE_PASSWORD="$INPUT_PASSWORD" \ TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \ From 7ac947279f5a7ff98ac42a4d7fcc5b08a60092cb Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 27 Apr 2024 00:48:16 +0800 Subject: [PATCH 2/4] Update based on review --- twine-upload.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/twine-upload.sh b/twine-upload.sh index e265633..67c4404 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -39,7 +39,6 @@ INPUT_PACKAGES_DIR="$(get-normalized-input 'packages-dir')" INPUT_VERIFY_METADATA="$(get-normalized-input 'verify-metadata')" INPUT_SKIP_EXISTING="$(get-normalized-input 'skip-existing')" INPUT_PRINT_HASH="$(get-normalized-input 'print-hash')" -INPUT_DISABLE_PROGRESS_BAR="$(get-normalized-input 'disable-progress-bar')" PASSWORD_DEPRECATION_NUDGE="::error title=Password-based uploads deprecated::\ Starting in 2024, PyPI will require all users to enable Two-Factor \ @@ -121,7 +120,7 @@ if [[ ${INPUT_VERIFY_METADATA,,} != "false" ]] ; then twine check ${INPUT_PACKAGES_DIR%%/}/* fi -TWINE_EXTRA_ARGS= +TWINE_EXTRA_ARGS="--disable-progress-bar" if [[ ${INPUT_SKIP_EXISTING,,} != "false" ]] ; then TWINE_EXTRA_ARGS=--skip-existing fi @@ -134,8 +133,6 @@ if [[ ${INPUT_PRINT_HASH,,} != "false" || ${INPUT_VERBOSE,,} != "false" ]] ; the python /app/print-hash.py ${INPUT_PACKAGES_DIR%%/} fi -TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS" - TWINE_USERNAME="$INPUT_USER" \ TWINE_PASSWORD="$INPUT_PASSWORD" \ TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \ From fda43ae86a378e4741db19a17dbc4ec47488cdd8 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Sat, 27 Apr 2024 23:02:41 +0800 Subject: [PATCH 3/4] Append --disable-progress-bar to TWINE_EXTRA_ARGS --- twine-upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twine-upload.sh b/twine-upload.sh index 67c4404..c94fa9d 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -120,7 +120,7 @@ if [[ ${INPUT_VERIFY_METADATA,,} != "false" ]] ; then twine check ${INPUT_PACKAGES_DIR%%/}/* fi -TWINE_EXTRA_ARGS="--disable-progress-bar" +TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS" if [[ ${INPUT_SKIP_EXISTING,,} != "false" ]] ; then TWINE_EXTRA_ARGS=--skip-existing fi From c6ec210c79f2590a0ba8c2d14667b8e3abf8cc7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sviatoslav=20Sydorenko=20=28=D0=A1=D0=B2=D1=8F=D1=82=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1=D0=B8=D0=B4=D0=BE=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE=29?= Date: Thu, 16 May 2024 17:11:32 +0200 Subject: [PATCH 4/4] Ensure default twine args don't get overridden in "skip-existing" branch --- twine-upload.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twine-upload.sh b/twine-upload.sh index c94fa9d..f5b52dd 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -120,9 +120,9 @@ if [[ ${INPUT_VERIFY_METADATA,,} != "false" ]] ; then twine check ${INPUT_PACKAGES_DIR%%/}/* fi -TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS" +TWINE_EXTRA_ARGS=--disable-progress-bar if [[ ${INPUT_SKIP_EXISTING,,} != "false" ]] ; then - TWINE_EXTRA_ARGS=--skip-existing + TWINE_EXTRA_ARGS="${TWINE_EXTRA_ARGS} --skip-existing" fi if [[ ${INPUT_VERBOSE,,} != "false" ]] ; then