File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 11name : Build, Test, Deploy
22
3- on : [push]
3+ on :
4+ push :
5+ branches :
6+ - main
47
58jobs :
69 info :
@@ -54,22 +57,31 @@ jobs:
5457 python3 -m pytest -sr tests/test_c*.py
5558 deploy :
5659 runs-on : ubuntu-latest
60+ if : github.ref == 'refs/heads/main'
5761 needs : test
5862 steps :
5963 - uses : actions/checkout@v3
64+ - name : Verify Changed files
65+ uses : tj-actions/verify-changed-files@v16
66+ id : verify-changed-files
67+ with :
68+ files : |
69+ src/**/*.py
70+ setup.cfg
6071 - name : Download artifacts
72+ if : steps.verify-changed-files.outputs.files_changed == 'true'
6173 uses : actions/download-artifact@v3
6274 with :
6375 name : built-artifacts
6476 path : dist
6577 - name : Publish package to Test PyPI
66- if : github.ref == 'refs/heads/main '
78+ if : steps.verify-changed-files.outputs.files_changed == 'true '
6779 uses : pypa/gh-action-pypi-publish@release/v1
6880 with :
6981 password : ${{ secrets.TEST_PYPI_API_TOKEN }}
7082 repository-url : https://test.pypi.org/legacy/
7183 - name : Publish package to PyPI
72- if : github.ref == 'refs/heads/main '
84+ if : steps.verify-changed-files.outputs.files_changed == 'true '
7385 uses : pypa/gh-action-pypi-publish@release/v1
7486 with :
7587 password : ${{ secrets.PYPI_API_TOKEN }}
You can’t perform that action at this time.
0 commit comments