From b9b380c61dd95aa0f6621b075942ba79b61ee308 Mon Sep 17 00:00:00 2001 From: "Dr. Johannes Pohl" Date: Tue, 1 Mar 2022 09:30:36 +0100 Subject: [PATCH] CI: fix twine upload (#961) --- .github/workflows/ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a321de2d1..fd1864e6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,14 +168,6 @@ jobs: if: ${{ !startsWith(matrix.os, 'ubuntu') || matrix.python-version != '3.9' }} run: pytest -s -v --junitxml=junit/test-results.xml tests - - name: Upload to PyPi - if: startsWith(github.ref, 'refs/tags/') - run: twine upload --skip-existing dist/* - env: - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/" - - uses: ncipollo/release-action@v1 if: startsWith(github.ref, 'refs/tags/') with: @@ -185,3 +177,17 @@ jobs: generateReleaseNotes: true omitBodyDuringUpdate: true omitNameDuringUpdate: true + + - name: Upload to PyPi + if: startsWith(github.ref, 'refs/tags/') + run: | + if [[ $OS == ubuntu* ]] + then + twine upload --skip-existing dist/* + else + twine upload --skip-existing dist/*.whl + fi + env: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"