Skip to content

Commit

Permalink
Support to disable progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxianpeng authored and Xianpeng Shen committed Apr 25, 2024
1 parent 3fbcf7c commit fa90a32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -222,6 +222,15 @@ It will show SHA256, MD5, BLAKE2-256 values of files to be uploaded.
print-hash: true
```

### Disable the progress bar

You may want to disable the progress bar when `twine upload`.

```yml
with:
disable-progress-bar: true
```

### Specifying a different username

The default username value is `__token__`. If you publish to a custom
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Expand Up @@ -80,6 +80,10 @@ inputs:
Use `print-hash` instead.
required: false
default: 'false'
disable-progress-bar:
description: Disable the progress bar.
required: false
default: 'true'
branding:
color: yellow
icon: upload-cloud
Expand All @@ -95,3 +99,4 @@ runs:
- ${{ inputs.skip-existing }}
- ${{ inputs.verbose }}
- ${{ inputs.print-hash }}
- ${{ inputs.disable-progress-bar }}
5 changes: 5 additions & 0 deletions twine-upload.sh
Expand Up @@ -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 \
Expand Down Expand Up @@ -133,6 +134,10 @@ if [[ ${INPUT_PRINT_HASH,,} != "false" || ${INPUT_VERBOSE,,} != "false" ]] ; the
python /app/print-hash.py ${INPUT_PACKAGES_DIR%%/}
fi

if [[ ${INPUT_DISABLE_PROGRESS_BAR,,} != "false" ]]; then
TWINE_EXTRA_ARGS="--disable-progress-bar $TWINE_EXTRA_ARGS"
fi

TWINE_USERNAME="$INPUT_USER" \
TWINE_PASSWORD="$INPUT_PASSWORD" \
TWINE_REPOSITORY_URL="$INPUT_REPOSITORY_URL" \
Expand Down

0 comments on commit fa90a32

Please sign in to comment.