From 6529c3090b02d83bb38345fd12871d34903c9d71 Mon Sep 17 00:00:00 2001 From: Shirona1337 Date: Mon, 25 May 2026 00:52:16 +0800 Subject: [PATCH] ci(loader): widen build-trigger paths + [SKIP CI] gate + case-insensitive [Release] Three workflow ergonomics tweaks: - Path filter now also includes build.gradle / settings.gradle / gradle.properties / gradle/wrapper/** / gradlew(.bat) and the workflow file itself, so a wrapper bump or build-script change still triggers CI even though only src/ and native/ files compile into the final artifact. - Job-level if: skips the entire build when the push commit message contains [SKIP CI] (Actions' contains() is case-insensitive for string operands, so [skip ci] and [SKIP CI] both qualify). workflow_dispatch is unaffected because head_commit is null there. - [Release] marker detection in the PowerShell publish step now uses StringComparison.OrdinalIgnoreCase so [release], [Release] and [RELEASE] all cut a release; .NET's default .Contains is case- sensitive which made the existing rule too brittle. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/build-loader.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-loader.yml b/.github/workflows/build-loader.yml index 95d2f34..85f65ce 100644 --- a/.github/workflows/build-loader.yml +++ b/.github/workflows/build-loader.yml @@ -3,6 +3,19 @@ name: Build Loader on: push: branches: [master] + # Only build when something that actually affects the output changed. + # README / docs / issue templates / .gitignore / .claude/ get to skip. + # Use workflow_dispatch (below) to force a run for anything else. + paths: + - 'src/**' + - 'native/**' + - 'build.gradle' + - 'settings.gradle' + - 'gradle.properties' + - 'gradle/wrapper/**' + - 'gradlew' + - 'gradlew.bat' + - '.github/workflows/build-loader.yml' workflow_dispatch: {} # contents: write so the [Release] commit-marker path can create a @@ -17,6 +30,12 @@ jobs: runs-on: windows-2022 timeout-minutes: 180 + # Honour a [SKIP CI] marker (case-insensitive — GitHub's contains() is + # case-insensitive for string operands) anywhere in the head commit + # message. workflow_dispatch always runs since head_commit is null + # there and the !contains() short-circuits to true. + if: ${{ github.event_name != 'push' || !contains(github.event.head_commit.message, '[SKIP CI]') }} + env: # NOTE: do not declare VCPKG_ROOT here. The windows-2022 runner # ships VS Enterprise which pre-sets a system-wide VCPKG_ROOT @@ -176,7 +195,9 @@ jobs: shell: pwsh run: | $msg = (git log -1 --pretty=%B HEAD | Out-String) - $isRelease = $msg.Contains("[Release]") + # Case-insensitive match so [release], [Release], [RELEASE] all + # qualify; .Contains in .NET is case-sensitive by default. + $isRelease = $msg.IndexOf("[Release]", [System.StringComparison]::OrdinalIgnoreCase) -ge 0 "is_release=$($isRelease.ToString().ToLower())" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append Write-Host "HEAD commit message:"