JRubics / poetry-publish

An action to build and publish python package to pypi (https://pypi.org/) using poetry (https://github.com/sdispater/poetry)
BSD 3-Clause "New" or "Revised" License
129 stars 17 forks source link

Using https and username/password fails #16

Closed KristianTanggaard closed 2 years ago

KristianTanggaard commented 2 years ago

When creating an action and uploading to a private repo I get a warning:

Warning: Unexpected input(s) 'repository_username', 'repository_password', valid inputs are ['entryPoint', 'args', 'python_version', 'poetry_version', 'pypi_token', 'build_format', 'repository_name', 'repository_url', 'ignore_dev_requirements', 'allow_poetry_pre_release']

and an error:

ValueError

  There is no pypi-token.REPONAME setting.

  at /root/.pyenv/versions/3.9.6/lib/python3.9/site-packages/poetry/console/commands/config.py:153 in handle
      149│                 self.line(str(value))
      150│             else:
      151│                 values = self.unique_config_values
      152│                 if setting_key not in values:
    → 153│                     raise ValueError("There is no {} setting.".format(setting_key))
      154│ 
      155│                 value = config.get(setting_key)
      156│ 
      157│                 if not isinstance(value, str):

The action is defined as:

name: Python package
on:
  push:
jobs:
    build:
      runs-on: ubuntu-20.04
      steps:
         - uses: actions/checkout@v2
         - name: Build and publish to pypi
           uses: JRubics/poetry-publish@v1.8
           with:
             python_version: "3.9"
             build_format: "sdist"
             allow_poetry_pre_release: "yes"
             ignore_dev_requirements: "yes"
             repository_name: "REPONAME"
             repository_url: "REPOURL"
             repository_username: ${{ secrets.USER }}
             repository_password: ${{ secrets.PW }}

My best guess is that it has something to do with the if-statement in the .sh, that controls if a token should be used or the user/pw combo.

https://github.com/JRubics/poetry-publish/blob/01628671a54aebc4906c610823ed11cfd628a305/entrypoint.sh#L39

JRubics commented 2 years ago

Please try to use JRubics/poetry-publish@v1.9 instead of version 1.8 and check if this still happens :)

KristianTanggaard commented 2 years ago

Please try to use JRubics/poetry-publish@v1.9 instead of version 1.8 and check if this still happens :)

Thank you, that was an embarrassing mistake. On to my next error.