abichinger / semantic-release-pypi

semantic-release plugin to publish a python package to PyPI
MIT License
26 stars 11 forks source link

feat: add extended env var support #7

Closed AlexanderBabel closed 3 years ago

AlexanderBabel commented 3 years ago

Hey,

I use GitLab for my PyPi packages and therefore I needed to customise the TWINE_USERNAME and repoUrl. I prefer to use environment variables for this use case because I then can do something like this:

variables:
  PYPI_TOKEN: ${CI_JOB_TOKEN}
  PYPI_USERNAME: gitlab-ci-token
  PYPI_REPO_URL: $CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/pypi

To achieve this behavior, I added support for two new environment variables:

In addition, I also updated the README file and mentioned the new configuration options.

IMPORTANT: To use GitLab as my PyPi Repo, I disabled the prefix check. Additionally, I think this check is also for the main PyPi repo not necessary because the verify function checks if login to the repo succeeds.

abichinger commented 3 years ago

Hello @AlexanderBabel!

Thanks for your contribution. :+1:

I agree with you, that the prefix check has become unnecessary. I will remove this check soon.

Can you please add the username argument __token__ in the test case for verifyAuth.

abichinger commented 3 years ago

:tada: This PR is included in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: