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 <noreply@anthropic.com>
This commit is contained in:
@@ -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:"
|
||||
|
||||
Reference in New Issue
Block a user