diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6611c212..1a332de9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,17 @@ name: Continuous Integration -on: [push, pull_request] +on: + push: + branches: + - "master" + - "develop" + tags: + - "*" + pull_request: + branches: + - "develop" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: env: # needed by coveralls @@ -10,15 +21,10 @@ env: CIBW_TEST_REQUIRES: "pytest" CIBW_TEST_COMMAND: "pytest -v {project}/tests" - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - jobs: build_wheels: name: wheels on ${{matrix.os}} runs-on: ${{matrix.os}} - # only run on internal push's or external PRs, not on internal PRs - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository strategy: fail-fast: false matrix: @@ -37,7 +43,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install cibuildwheel>=1.7.0 + pip install cibuildwheel==1.7.0 - name: Build wheels run: | python -m cibuildwheel --output-dir dist @@ -49,8 +55,6 @@ jobs: build_sdist: name: sdist on ${{matrix.os}} with py ${{ matrix.python-version }} runs-on: ${{matrix.os}} - # only run on internal push's or external PRs, not on internal PRs - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository strategy: fail-fast: false matrix: @@ -92,8 +96,6 @@ jobs: upload_to_pypi: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - # only run on internal push's or external PRs, not on internal PRs - if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository steps: - uses: actions/download-artifact@v2 @@ -103,7 +105,7 @@ jobs: - name: Publish to Test PyPI # only if working on develop - if: github.ref == 'refs/heads/develop' + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' uses: pypa/gh-action-pypi-publish@master with: user: __token__