2626 - name : Setup CI environment
2727 uses : ./.github/actions/setup-ci-env
2828
29+ - name : Detect release artifact changes
30+ id : release_scope
31+ shell : bash
32+ run : |
33+ set -euo pipefail
34+ BEFORE_SHA='${{ github.event.before }}'
35+ AFTER_SHA='${{ github.sha }}'
36+ RANGE="${BEFORE_SHA}..${AFTER_SHA}"
37+ if [[ -z "${BEFORE_SHA}" || "${BEFORE_SHA}" =~ ^0+$ ]]; then
38+ RANGE="${AFTER_SHA}^..${AFTER_SHA}"
39+ fi
40+
41+ mapfile -t changed_files < <(git diff --name-only "${RANGE}" || true)
42+ should_publish=0
43+ for changed_file in "${changed_files[@]}"; do
44+ case "${changed_file}" in
45+ folderview.plus.plg|folderview.plus.xml|archive/*.txz|archive/*.sha256)
46+ should_publish=1
47+ break
48+ ;;
49+ esac
50+ done
51+
52+ {
53+ echo "range=${RANGE}"
54+ echo "should_publish=${should_publish}"
55+ } >> "${GITHUB_OUTPUT}"
56+
57+ - name : Skip release publish for non-release main pushes
58+ if : steps.release_scope.outputs.should_publish != '1'
59+ shell : bash
60+ run : |
61+ {
62+ echo "## Release publish skipped"
63+ echo
64+ echo "No release artifacts changed on this \`main\` push, so GitHub release publishing was intentionally skipped."
65+ echo "Workflow/process-only syncs can land on \`main\` without creating a new plugin release."
66+ } >> "${GITHUB_STEP_SUMMARY}"
67+
2968 - name : Resolve release version and archive
3069 id : release_meta
70+ if : steps.release_scope.outputs.should_publish == '1'
3171 run : |
3272 set -euo pipefail
3373 VERSION=$(grep -oP '<!ENTITY version "\K[^"]+' folderview.plus.plg)
4888 echo "tag=v${VERSION}" >> "$GITHUB_OUTPUT"
4989
5090 - name : Run release validation suite
91+ if : steps.release_scope.outputs.should_publish == '1'
5192 env :
5293 FVPLUS_UNRAID_MATRIX : ${{ secrets.FVPLUS_UNRAID_MATRIX }}
5394 FVPLUS_UNRAID_MATRIX_REQUIRED : ${{ secrets.FVPLUS_UNRAID_MATRIX != '' && '1' || '0' }}
@@ -80,13 +121,15 @@ jobs:
80121
81122 - name : Build release notes from current CHANGES block
82123 id : notes
124+ if : steps.release_scope.outputs.should_publish == '1'
83125 run : |
84126 set -euo pipefail
85127 VERSION="${{ steps.release_meta.outputs.version }}"
86128 chmod +x scripts/build_release_notes.sh
87129 bash scripts/build_release_notes.sh --version "${VERSION}" --output release_notes.md
88130
89131 - name : Validate remote raw publish artifacts
132+ if : steps.release_scope.outputs.should_publish == '1'
90133 env :
91134 FVPLUS_REMOTE_PUBLISH_ATTEMPTS : ' 30'
92135 FVPLUS_REMOTE_PUBLISH_DELAY_SEC : ' 10'
95138 bash scripts/remote_publish_guard.sh
96139
97140 - name : Ensure GitHub CLI
141+ if : steps.release_scope.outputs.should_publish == '1'
98142 run : |
99143 if command -v gh >/dev/null 2>&1; then
100144 gh --version
@@ -104,6 +148,7 @@ jobs:
104148 sudo apt-get install -y gh
105149
106150 - name : Create or update GitHub release
151+ if : steps.release_scope.outputs.should_publish == '1'
107152 env :
108153 GH_TOKEN : ${{ github.token }}
109154 run : |
0 commit comments