From ca999b781d1d80206409b9445968d398ae881276 Mon Sep 17 00:00:00 2001 From: shimwell Date: Thu, 23 Feb 2023 22:41:39 +0000 Subject: [PATCH] update python publish --- .github/workflows/python-publish.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index c909e16..ac5bbec 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -25,27 +25,16 @@ jobs: with: python-version: '3.x' - - name: Autobump version - run: | - # from refs/tags/v1.2.3 get 1.2.3 - VERSION=$(echo $GITHUB_REF | sed 's#.*/v##') - PLACEHOLDER='version="develop"' - VERSION_FILE='setup.py' - # Grep checks that the placeholder is in the file. If grep doesn't find - # the placeholder then it exits with exit code 1 and github actions fails. - grep "$PLACEHOLDER" "$VERSION_FILE" - sed -i "s@$PLACEHOLDER@version=\"${VERSION}\"@g" "$VERSION_FILE" - shell: bash - - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools wheel build twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} run: | - python setup.py sdist bdist_wheel + python -m build + twine check dist/* twine upload dist/*