Skip to content

Commit 83284cb

Browse files
committed
Only run build and deploy if the source changed
1 parent 2c92b6d commit 83284cb

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,25 @@ jobs:
1818
uses: nxt-dev/nxt/.github/workflows/unittests.yml@release
1919
with:
2020
QT_DEPENDENCIES: ${{ inputs.QT_DEPENDENCIES }}
21+
changed-files:
22+
runs-on: ubuntu-latest
23+
name: Check if source actually changed
24+
outputs:
25+
any_changed: ${{ steps.changed-files.outputs.any_changed }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
- name: Get changed files
31+
id: changed-files
32+
uses: tj-actions/changed-files@v46.0.5
33+
with:
34+
files: |
35+
nxt/**
36+
nxt_editor/**
2137
build-and-deploy-pypi:
22-
needs: [run-tests]
38+
needs: [run-tests, changed-files]
39+
if: needs.changed-files.outputs.any_changed == 'true'
2340
runs-on: ubuntu-latest
2441
env:
2542
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
@@ -67,3 +84,11 @@ jobs:
6784
- name: Build package and upload
6885
run: |
6986
python -m nxt.cli -vv exec build/packaging.nxt -s /make_and_upload
87+
88+
skip-build:
89+
name: Skipped build because source did not change
90+
needs: [changed-files]
91+
runs-on: ubuntu-latest
92+
if: needs.changed-files.outputs.any_changed != 'true'
93+
steps:
94+
- run: echo "No changes in nxt or nxt_editor, skipping build and upload to PyPI."

0 commit comments

Comments
 (0)