diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index da8ffefba3..93522c43e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -493,6 +493,24 @@ jobs: name: tarballs path: dist + # The action 'pypa/gh-action-pypi-publish' will try to upload all files in the + # dist/ folder. This folder also contains non-package files, and therefore the + # action fails. + # + # To prevent the action from failing all .whl files are copied into a new + # directory. + - run: | + mkdir -p tmp/whl + find dist/ -name '*.whl' -type f -exec cp '{}' tmp/whl -v \; + + - name: Publish Python wheels on Pypi + uses: pypa/gh-action-pypi-publish@v1.0.0a0 + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + with: + user: __token__ + password: ${{ secrets.pypi_password }} + packages_dir: tmp/whl + # ... and if this was an actual push (tag or `master`) then we publish a # new release. This'll automatically publish a tag release or update `dev` # with this `sha` @@ -503,3 +521,4 @@ jobs: files: "dist/*" name: ${{ steps.tagname.outputs.val }} token: ${{ secrets.GITHUB_TOKEN }} +