Skip to content

Commit

Permalink
publish options
Browse files Browse the repository at this point in the history
  • Loading branch information
JRubics committed Feb 4, 2024
1 parent 3529264 commit b0c6fa1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -64,3 +67,4 @@ runs:
- ${{ inputs.extra_build_dependency_packages }}
- ${{ inputs.plugins }}
- ${{ inputs.package_directory }}
- ${{ inputs.poetry_publish_options }}
12 changes: 4 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit b0c6fa1

Please sign in to comment.