From 176ae50c06cccd3d21d66552b5f5579591ebf170 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 2 Jun 2020 11:08:43 -0400 Subject: [PATCH 1/3] feat: Add twine check before upload #30 --- README.md | 9 +++++++++ action.yml | 5 +++++ twine-upload.sh | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/README.md b/README.md index 4701f78..ae5b713 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,15 @@ would now look like: packages_dir: custom-dir/ ``` +### Disabling twine check + +You can also disable the twine check with: + +```yml + with: + check: false +``` + ## License The Dockerfile and associated scripts and documentation in this project diff --git a/action.yml b/action.yml index 478f53f..546e2ec 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,10 @@ inputs: description: The target directory for distribution required: false default: dist + check: + description: Check before uploading + required: false + default: true branding: color: yellow icon: upload-cloud @@ -27,3 +31,4 @@ runs: - ${{ inputs.password }} - ${{ inputs.repository_url }} - ${{ inputs.packages_dir }} + - ${{ inputs.check }} diff --git a/twine-upload.sh b/twine-upload.sh index 5c3ca96..c1e88db 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -28,6 +28,10 @@ then are in place should you face this problem. fi +if [[ ${INPUT_CHECK,,} != "false" ]] ; then + exec twine check ${INPUT_PACKAGES_DIR%%/}/* +fi + TWINE_USERNAME="$INPUT_USER" \ TWINE_PASSWORD="$INPUT_PASSWORD" \ From ab50aa7f47c4f6bb28a4b145ab925f8739b25efa Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 3 Jun 2020 10:29:18 -0400 Subject: [PATCH 2/3] Update twine-upload.sh Co-authored-by: Sviatoslav Sydorenko --- twine-upload.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twine-upload.sh b/twine-upload.sh index c1e88db..4b4cde8 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -29,7 +29,7 @@ then fi if [[ ${INPUT_CHECK,,} != "false" ]] ; then - exec twine check ${INPUT_PACKAGES_DIR%%/}/* + twine check ${INPUT_PACKAGES_DIR%%/}/* fi From 9bda1cadd0a06047f870d77e02cb2ef1f97e5514 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 3 Jun 2020 11:04:52 -0400 Subject: [PATCH 3/3] Use metadata_verify instead of check --- README.md | 8 +++++--- action.yml | 6 +++--- twine-upload.sh | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ae5b713..ffab4f5 100644 --- a/README.md +++ b/README.md @@ -101,13 +101,15 @@ would now look like: packages_dir: custom-dir/ ``` -### Disabling twine check +### Disabling metadata verification -You can also disable the twine check with: +It is recommended that you run `twine check` just after producing your files, +but this also runs `twine check` before upload. You can also disable the twine +check with: ```yml with: - check: false + verify_metadata: false ``` ## License diff --git a/action.yml b/action.yml index 546e2ec..a5bcd55 100644 --- a/action.yml +++ b/action.yml @@ -16,8 +16,8 @@ inputs: description: The target directory for distribution required: false default: dist - check: - description: Check before uploading + verify_metadata: + description: Check metadata before uploading required: false default: true branding: @@ -31,4 +31,4 @@ runs: - ${{ inputs.password }} - ${{ inputs.repository_url }} - ${{ inputs.packages_dir }} - - ${{ inputs.check }} + - ${{ inputs.verify_metadata }} diff --git a/twine-upload.sh b/twine-upload.sh index 4b4cde8..ff92ae1 100755 --- a/twine-upload.sh +++ b/twine-upload.sh @@ -28,7 +28,7 @@ then are in place should you face this problem. fi -if [[ ${INPUT_CHECK,,} != "false" ]] ; then +if [[ ${INPUT_VERIFY_METADATA,,} != "false" ]] ; then twine check ${INPUT_PACKAGES_DIR%%/}/* fi