From 3ebf07ae74324e25e3d2a17c55d01e450aec5905 Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Mon, 12 Apr 2021 20:56:51 -0700 Subject: [PATCH] Only run jobs when relevent --- .github/workflows/python-package.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ea34288..91db09d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -3,11 +3,7 @@ name: Python Package -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] +on: [push, pull_request] jobs: test: @@ -61,7 +57,12 @@ jobs: build: needs: test + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) + runs-on: ${{ matrix.os }} + env: + MACOSX_DEPLOYMENT_TARGET: 10_15 + strategy: matrix: python-version: [ 3.7, 3.8, 3.9 ] @@ -106,6 +107,7 @@ jobs: publish: needs: build + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest steps: