Skip to content

Commit 4989a3a

Browse files
committed
Working out how to trigger only one deployment on release.
1 parent 3674bd9 commit 4989a3a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/CI.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- "master"
1414
- "main"
1515
release:
16+
types: [published]
1617
branches:
1718
- "master"
1819
- "main"
@@ -128,7 +129,7 @@ jobs:
128129
deploy:
129130
name: PyPi ${{ matrix.os }} Py${{ matrix.python-version }}
130131
# Run only for tagged releases.
131-
if: github.event_name == 'release'
132+
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags')
132133
runs-on: ${{ matrix.os }}
133134
needs: [lint, test]
134135
strategy:
@@ -162,15 +163,13 @@ jobs:
162163
ls -l dist/
163164
164165
- name: Publish distribution 📦 to Test PyPI
165-
if: startsWith(github.ref, 'refs/tags')
166166
uses: pypa/gh-action-pypi-publish@master
167167
with:
168168
password: ${{ secrets.test_pypi_password }}
169169
repository_url: https://test.pypi.org/legacy/
170170
skip_existing: true
171171

172172
- name: Publish distribution 📦 to PyPI
173-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
174173
uses: pypa/gh-action-pypi-publish@master
175174
with:
176175
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)