Skip to content

Commit 4a07469

Browse files
committed
Modify deploy job
1 parent 7c27f22 commit 4a07469

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/deploy-job.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,31 @@ jobs:
5454
python3 -m pytest -sr tests/test_c*.py
5555
deploy:
5656
runs-on: ubuntu-latest
57+
if: github.ref == 'refs/heads/main'
5758
needs: test
5859
steps:
5960
- uses: actions/checkout@v3
61+
- name: Verify Changed files
62+
uses: tj-actions/verify-changed-files@v16
63+
id: verify-changed-files
64+
with:
65+
files: |
66+
src/**/*.py
67+
setup.cfg
6068
- name: Download artifacts
69+
if: steps.verify-changed-files.outputs.files_changed == 'true'
6170
uses: actions/download-artifact@v3
6271
with:
6372
name: built-artifacts
6473
path: dist
6574
- name: Publish package to Test PyPI
66-
if: github.ref == 'refs/heads/main'
75+
if: steps.verify-changed-files.outputs.files_changed == 'true'
6776
uses: pypa/gh-action-pypi-publish@release/v1
6877
with:
6978
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
7079
repository-url: https://test.pypi.org/legacy/
7180
- name: Publish package to PyPI
72-
if: github.ref == 'refs/heads/main'
81+
if: steps.verify-changed-files.outputs.files_changed == 'true'
7382
uses: pypa/gh-action-pypi-publish@release/v1
7483
with:
7584
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)