Skip to content

Commit 2af1bc8

Browse files
committed
CI: Build & deploy only for tags
1 parent fecf68e commit 2af1bc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/test_and_distribute.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ jobs:
3434
run: |
3535
python -m unittest discover
3636
- name: Build package with Python ${{ env.PYTHON_BUILD_VERSION }}
37-
if: ${{ github.event_name == 'push' && matrix.python-version == env.PYTHON_BUILD_VERSION }}
37+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.python-version == env.PYTHON_BUILD_VERSION }}
3838
run: python -m build
3939
- name: Publish package relying on pypa/gh-action-pypi-publish with Python ${{ env.PYTHON_BUILD_VERSION }}
4040
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
41-
if: ${{ github.event_name == 'push' && matrix.python-version == env.PYTHON_BUILD_VERSION }}
41+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.python-version == env.PYTHON_BUILD_VERSION }}
4242
with:
4343
user: __token__
4444
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)