diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index 0491f9d..f15c12b 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -1,16 +1,8 @@ name: Ubuntu and Mac builds -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +on: [push, pull_request, workflow_dispatch] jobs: - build_and_publish: strategy: matrix: @@ -46,15 +38,16 @@ jobs: path: wheelhouse/ - name: Publish to Pypi - if: github.event_name == 'release' && github.event.action == 'created' + if: startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | + python3 -m pip install --upgrade twine python3 -m twine upload wheelhouse/*.whl - name: Publish Source to Pypi - if: matrix.os == 'macos-latest' && github.event_name == 'release' && github.event.action == 'created' + if: matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/win-build-publish.yml b/.github/workflows/win-build-publish.yml index 16a8a30..3a82008 100644 --- a/.github/workflows/win-build-publish.yml +++ b/.github/workflows/win-build-publish.yml @@ -2,16 +2,7 @@ name: Windows builds -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +on: [push, pull_request, workflow_dispatch] jobs: windows_build: @@ -87,9 +78,10 @@ jobs: path: wheelhouse/ - name: Publish to Pypi - if: github.event_name == 'release' && github.event.action == 'created' + if: startsWith(github.ref, 'refs/tags/v') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | + python -m pip install --upgrade twine python -m twine upload wheelhouse/*.whl