diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1dbb4a..4f22a5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,19 @@ name: Release and publish on: - push: - branches: - - main - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + workflow_run: + workflows: [ "Tests" ] + branches: [ main ] + types: + - completed # only release when tests have passed + workflow_dispatch: jobs: release: runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') }} + # only run when tests have passed (or manually triggered) steps: - uses: actions/checkout@v1 @@ -22,12 +25,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip + pip install setuptools setuptools_scm wheel pip install -e .[tests] - - name: Test - run: | - pytest --mpl tests # test everything - - name: Build packages run: | python setup.py sdist bdist_wheel