From edc3cfddeef6c78dcafe738b970408aa48b35fe9 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Tue, 3 Nov 2020 07:55:45 +0100 Subject: [PATCH] Run Python package builds always, but only upload on release --- .github/workflows/pypi-release.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml index e1eedfb4f..b12b8cb1d 100644 --- a/.github/workflows/pypi-release.yml +++ b/.github/workflows/pypi-release.yml @@ -1,9 +1,6 @@ -name: Publish to PyPI +name: Package for PyPI -on: - push: - tags: - - 'release-*' +on: [push] jobs: pypi-sdist: @@ -24,6 +21,11 @@ jobs: - name: Build Python source distribution run: | python setup.py clean sdist + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: picard-sdist + path: dist/* - name: Prepare GPG signing key run: | if [ -n "$CODESIGN_PGP_URL" ] && [ -n "$AWS_ACCESS_KEY_ID" ]; then @@ -43,6 +45,7 @@ jobs: CODESIGN_PGP_URL: ${{ secrets.CODESIGN_PGP_URL }} CODESIGN_PGP_PASSWORD: ${{ secrets.CODESIGN_PGP_PASSWORD }} - name: Publish Python distribution to PyPI + if: startsWith(github.ref, 'refs/tags/') run: | pip install --upgrade twine if [ "$CODESIGN" = '1' ]; then @@ -89,7 +92,13 @@ jobs: - name: Build Python binary distribution run: | python setup.py clean bdist_wheel + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: picard-bdist-${{ runner.os }} + path: dist/*.whl - name: Publish Python distribution to PyPI + if: startsWith(github.ref, 'refs/tags/') run: | pip install --upgrade twine>=3.0 twine upload --non-interactive dist/*.whl