diff --git a/README.md b/README.md index d91eb5a..48194e3 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,14 @@ Adds possibility to pass options to "poetry install" command. Examples: Check the full list [here](https://python-poetry.org/docs/cli/#options-2). +### `poetry_publish_options` + +Adds possibility to pass options to "poetry publish" command. Examples: + - `--dry-run` + - `--build` + +Check the full list [here](https://python-poetry.org/docs/cli/#options-8). + ### `allow_poetry_pre_release` Allow poetry pre-release versions to be installed. diff --git a/action.yml b/action.yml index b7e3bc9..fe48246 100644 --- a/action.yml +++ b/action.yml @@ -47,6 +47,9 @@ inputs: description: "An optional subdirectory path if poetry package doesn't reside in the main workflow directory" required: false default: "." + poetry_publish_options: + description: 'Adds possibility to pass options to "poetry publish" command' + required: false runs: using: "docker" image: "docker://jrubics/poetry-publish:v2.0-rc.1" @@ -64,3 +67,4 @@ runs: - ${{ inputs.extra_build_dependency_packages }} - ${{ inputs.plugins }} - ${{ inputs.package_directory }} + - ${{ inputs.poetry_publish_options }} diff --git a/entrypoint.sh b/entrypoint.sh index 25a0c7c..22a07b7 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,11 +32,7 @@ if [ -n "${12}" ]; then poetry self add ${12} fi -if [ -n "${7}" ]; then - poetry install -else - poetry install ${7} -fi +poetry install ${7} if [ -z $6 ]; then poetry build @@ -46,14 +42,14 @@ fi if [ -z $4 ] || [ -z $5 ]; then poetry config pypi-token.pypi $3 - poetry publish + poetry publish ${14} else if [ -z $9 ] || [ -z ${10} ]; then poetry config pypi-token.$4 $3 poetry config repositories.$4 $5 - poetry publish --repository $4 + poetry publish --repository $4 ${14} else poetry config repositories.$4 $5 - poetry publish --repository $4 --username $9 --password ${10} + poetry publish --repository $4 --username $9 --password ${10} ${14} fi fi