From 372fec338fa8917faa68692ebcf31339c025c5ba Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Fri, 15 Nov 2024 14:14:25 +0100 Subject: [PATCH] Update github-actions to publish package --- .github/workflows/publish-to-pypi.yml | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 0185186..20ec146 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -9,21 +9,27 @@ on: - '*' # Push events to every tag not containing / jobs: - build-n-publish: + build-and-publish: name: Build and Publish to PyPI runs-on: ubuntu-latest steps: + # https://github.com/marketplace/actions/checkout - name: Checkout git repository - uses: actions/checkout@v2 - - name: Setup Python3.8 - uses: actions/setup-python@v2 + uses: actions/checkout@v4 + # https://github.com/marketplace/actions/setup-python + - name: Setup Python + uses: actions/setup-python@v5 with: - python-version: 3.8 - - name: Build - run: python setup.py sdist + python-version: "3.x" + + # Build #################################################################### + + # https://github.com/marketplace/actions/publish-python-poetry-package - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + # https://github.com/JRubics/poetry-publish/issues/39 + uses: JRubics/poetry-publish@v2.0 with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + # https://pypi.org/manage/account/token/ + # https://github.com///settings/secrets/actions/new + pypi_token: ${{ secrets.PYPI_API_TOKEN }} + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')