From edf29168a185ed2a75dcbea642c6912d11e12d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Alvergnat?= Date: Thu, 14 Dec 2023 10:50:26 +0100 Subject: [PATCH] ci: use twine to upload packages on pypi --- .github/workflows/ci.yml | 10 +++++++--- pyproject.toml | 1 - setup.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bc0db28..a155a5e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -275,19 +275,23 @@ jobs: git config --global user.email "action@github.com" git config --global user.name "github-actions" - - name: Install python-semantic-release - run: pip install python-semantic-release + - name: Install python-semantic-release twine + run: pip install python-semantic-release twine - name: Bump version run: semantic-release version env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload to pypi + run: twine upload --username "__token__" --password "${PYPI_TOKEN}" dist/*.tar.gz dist/*.whl + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - name: Publish release run: semantic-release publish env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - name: Merge master to develop uses: robotology/gh-action-nightly-merge@v1.4.0 diff --git a/pyproject.toml b/pyproject.toml index 31b1a236..b9c3bcea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ version_variables = ["guessit/__version__.py:__version__"] commit_subject = "chore(release): release v{version}" commit_author = "github-actions " -upload_to_pypi_glob_patterns = "*.tar.gz,*.whl" build_command = "" [tool.check-manifest] diff --git a/setup.py b/setup.py index c0f701a2..a40797a2 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ install_requires = ['rebulk>=3.2.0', 'babelfish>=0.6.0', 'python-dateutil', 'importlib-resources;python_version<"3.9"'] -dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller', 'python-semantic-release', 'wheel'] +dev_require = ['tox', 'mkdocs', 'mkdocs-material', 'pyinstaller', 'wheel', 'python-semantic-release', 'twine'] tests_require = ['pytest', 'pytest-mock', 'pytest-benchmark', 'pytest-cov', 'pylint', 'PyYAML']