|
3 | 3 | name: cicd |
4 | 4 | on: |
5 | 5 | push: |
6 | | - release: |
7 | | - types: [created] |
8 | 6 |
|
9 | 7 | env: |
10 | 8 | PYTHON_VERSION: "3.10" |
|
69 | 67 | # Run integration tests against the API (only on the main branch, though). The comprehensive |
70 | 68 | # version runs a matrix of python versions for better coverage. |
71 | 69 | test-comprehensive: |
72 | | - if: github.ref == 'refs/heads/main' || github.event_name == 'release' |
| 70 | + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') |
73 | 71 | needs: |
74 | 72 | - test-simple |
75 | 73 | runs-on: ubuntu-latest |
@@ -123,10 +121,10 @@ jobs: |
123 | 121 | # This is associated with the "sdk-test-prod" user, credentials on 1password |
124 | 122 | GROUNDLIGHT_API_TOKEN: ${{ secrets.GROUNDLIGHT_API_TOKEN_PROD }} |
125 | 123 |
|
126 | | - # Run the auto-formatter when we're not on the main branch. This will push a new commit to the PR |
127 | | - # branch if needed. |
| 124 | + # Run the auto-formatter when we're not on the main branch or creating a release. This will push a |
| 125 | + # new commit to the PR branch if needed. |
128 | 126 | format: |
129 | | - if: github.ref != 'refs/heads/main' && github.event_name != 'release' |
| 127 | + if: startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main' |
130 | 128 | runs-on: ubuntu-latest |
131 | 129 | steps: |
132 | 130 | - name: get code |
@@ -169,7 +167,7 @@ jobs: |
169 | 167 | # TODO: We'd like to build on pushes on any branch when docs/** changes. But then only deploy if |
170 | 168 | # we are on the `main` branch and docs/** has changes. |
171 | 169 | deploy-docs: |
172 | | - if: github.ref == 'refs/heads/main' || github.event_name == 'release' |
| 170 | + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') |
173 | 171 | needs: |
174 | 172 | - test-comprehensive |
175 | 173 | runs-on: ubuntu-latest |
@@ -207,7 +205,7 @@ jobs: |
207 | 205 | # When a release is created on github (and comprehensive tests passed), publish the groundlight |
208 | 206 | # package to public pypi. |
209 | 207 | publish-python-package: |
210 | | - if: github.event_name == 'release' |
| 208 | + if: startsWith(github.ref, 'refs/tags/v') |
211 | 209 | runs-on: ubuntu-latest |
212 | 210 | needs: |
213 | 211 | - test-comprehensive |
|
0 commit comments