|
1 | 1 | name: gh |
2 | 2 |
|
3 | 3 | on: |
| 4 | + create: # is used for publishing to PyPI and TestPyPI |
| 5 | + tags: # any tag regardless of its name, no branches |
| 6 | + - "**" |
4 | 7 | push: # only publishes pushes to the main branch to TestPyPI |
5 | 8 | branches: # any integration branch but not tag |
6 | 9 | - "master" |
7 | | - tags: |
8 | | - - "**" |
9 | 10 | pull_request: |
| 11 | + release: |
| 12 | + types: |
| 13 | + - published # It seems that you can publish directly without creating |
| 14 | + - prereleased |
10 | 15 | schedule: |
11 | 16 | - cron: 1 0 * * * # Run daily at 0:01 UTC |
12 | 17 | # Run every Friday at 18:02 UTC |
@@ -234,17 +239,15 @@ jobs: |
234 | 239 | - name: Build dists |
235 | 240 | run: python -m tox -p auto --parallel-live -vvvv |
236 | 241 | - name: Publish to test.pypi.org |
237 | | - if: >- |
238 | | - github.event_name == 'push' && |
239 | | - startsWith(github.ref, 'refs/tags/') |
| 242 | + if: >- # "create" workflows run separately from "push" & "pull_request" |
| 243 | + github.event_name == 'release' |
240 | 244 | uses: pypa/gh-action-pypi-publish@master |
241 | 245 | with: |
242 | 246 | password: ${{ secrets.testpypi_password }} |
243 | 247 | repository_url: https://test.pypi.org/legacy/ |
244 | 248 | - name: Publish to pypi.org |
245 | | - if: >- |
246 | | - github.event_name == 'push' && |
247 | | - startsWith(github.ref, 'refs/tags/') |
| 249 | + if: >- # "create" workflows run separately from "push" & "pull_request" |
| 250 | + github.event_name == 'release' |
248 | 251 | uses: pypa/gh-action-pypi-publish@master |
249 | 252 | with: |
250 | 253 | password: ${{ secrets.pypi_password }} |
0 commit comments