Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
6921329
Unify model delete dialog controls
vladelaina Aug 12, 2026
46b6663
Refine model deletion prompt
vladelaina Aug 12, 2026
066d9cc
Include model name in deletion notice
vladelaina Aug 12, 2026
52a1bdc
Harden model switching state restoration
vladelaina Aug 12, 2026
1fc078a
Include SDL logging declarations
vladelaina Aug 12, 2026
34c13d1
Fix behavior controls and reusable editors
vladelaina Aug 13, 2026
7d8b141
Refactor reusable UI and runtime components
vladelaina Aug 13, 2026
2d0bb96
Improve capture diagnostics and OBS background fallback
vladelaina Aug 14, 2026
00f883c
Extend capture diagnostics and fallback guidance
vladelaina Aug 14, 2026
1d3ecde
feat: unify extensible model packages and runtime compatibility
vladelaina Aug 15, 2026
a2bdfb3
refactor: establish clean settings and storage architecture
vladelaina Aug 15, 2026
b249716
refactor: replace registry autostart with startup shortcut
vladelaina Aug 15, 2026
61d7aaf
refactor: support nearby Tauri and filter Mver placeholders
vladelaina Aug 15, 2026
5c3eb63
fix: resolve model import build errors
vladelaina Aug 15, 2026
1508f55
ui: separate nearby models in preferences
vladelaina Aug 15, 2026
0c0168a
ui: show smooth model loading progress
vladelaina Aug 15, 2026
0890ff3
ui: soften model selection completion
vladelaina Aug 15, 2026
aeff5d1
runtime: harden model switching flow
vladelaina Aug 16, 2026
e584ebe
Centralize application version in CMake
vladelaina Aug 16, 2026
a8c14ae
ui: order preset models in preferences
vladelaina Aug 16, 2026
953fda4
refactor: organize native sources and fix validation issues
vladelaina Aug 16, 2026
ed1d9f4
fix: keep current model active during switching
vladelaina Aug 16, 2026
9118d8e
build: exclude unused GLEW shared target
vladelaina Aug 16, 2026
b831050
build: run Windows app without elevation
vladelaina Aug 16, 2026
754d9a6
fix: keep current model animated while switching
vladelaina Aug 16, 2026
3229b4e
fix: avoid driver hangs during model texture upload
vladelaina Aug 16, 2026
05fd745
refactor: keep runtime logs focused
vladelaina Aug 16, 2026
c6f9d6a
fix: harden runtime crash diagnostics
vladelaina Aug 16, 2026
f0661e5
Fix expression behavior toggling
vladelaina Aug 16, 2026
e71be80
Persist model behavior state across restarts
vladelaina Aug 16, 2026
85e0c03
Optimize preferences memory usage
vladelaina Aug 16, 2026
b6f41db
fix: avoid first-hover window flicker
vladelaina Aug 17, 2026
e3b39a1
fix: preserve model behavior lifecycle
vladelaina Aug 17, 2026
7c7f1a1
perf: smooth model loading and batch imports
vladelaina Aug 17, 2026
9450582
fix(ui): smooth preferences scrolling
vladelaina Aug 18, 2026
c959107
Improve desktop pet anti-aliasing
vladelaina Aug 18, 2026
5413704
fix: improve centered mouse tracking
vladelaina Aug 18, 2026
b0c6cfb
feat: add multi-pet display support
vladelaina Aug 18, 2026
514e316
fix: coordinate multi-pet menu actions
vladelaina Aug 18, 2026
8428315
feat(i18n): complete localized error handling
vladelaina Aug 18, 2026
2fd82bc
refactor(input): internalize key release recovery
vladelaina Aug 19, 2026
9cb2a9e
feat: refresh nearby models from preferences
vladelaina Aug 19, 2026
d4ecac5
fix: stabilize model import and preferences
vladelaina Aug 19, 2026
ce1616b
fix: smooth centered window dragging
vladelaina Aug 19, 2026
122ff7c
fix: guard pet wheel and preferences lifecycle
vladelaina Aug 20, 2026
9e2ae8d
fix(ui): correct support page text layout
vladelaina Aug 20, 2026
b6cee6f
feat: add per-user packaging and multi-platform artifacts
vladelaina Aug 20, 2026
8b0e8fe
fix(ci): clarify live2d audit control flow
vladelaina Aug 20, 2026
7443721
fix(ci): guard Cubism-only receipt cleanup
vladelaina Aug 20, 2026
acc573d
fix(ci): type background color cache correctly
vladelaina Aug 20, 2026
1772b06
fix(ci): compare background color enum safely
vladelaina Aug 20, 2026
01ddf23
ci: separate portable and installer artifacts
vladelaina Aug 20, 2026
c239566
fix(windows): recover incomplete installed UI assets
vladelaina Aug 20, 2026
6311aea
fix(windows): preserve nearby models across installer updates
vladelaina Aug 20, 2026
495dcb4
fix(windows): close legacy app during installer update
vladelaina Aug 20, 2026
f963d25
fix(windows): avoid blocking legacy installer updates
vladelaina Aug 20, 2026
c059c37
chore(i18n): refresh support page copy
vladelaina Aug 20, 2026
604beb8
fix(windows): use modern folder picker for model imports
vladelaina Aug 20, 2026
5090571
Fix Tauri model input and Live2D parity
vladelaina Aug 21, 2026
6289733
Fix Live2D source line limit
vladelaina Aug 21, 2026
78ee128
Add more models link to preferences
vladelaina Aug 21, 2026
3598168
Use double chevron for more models link
vladelaina Aug 21, 2026
5ffc10d
Match more models hover animation
vladelaina Aug 21, 2026
a8c6d85
Harden platform input safety boundaries
vladelaina Aug 21, 2026
beb8d95
Add Microsoft Store MSIX packaging
vladelaina Aug 21, 2026
ff475c5
fix: unify preferences window title
vladelaina Aug 21, 2026
5c8b156
fix(i18n): detect system language on first launch
vladelaina Aug 22, 2026
cbf7662
chore: update version and support information
vladelaina Aug 22, 2026
5cd7fde
fix: update feedback repository link
vladelaina Aug 22, 2026
e18ef46
chore: keep project docs local
vladelaina Aug 22, 2026
8341f28
fix: prevent Live2D expressions from being clipped
vladelaina Aug 22, 2026
df92962
feat: update license and project links
vladelaina Aug 22, 2026
589ada2
Update README.md
vladelaina Aug 23, 2026
5088034
Update README.md
vladelaina Aug 23, 2026
f3688f5
fix: update developer support link
vladelaina Aug 23, 2026
a5885fb
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 23, 2026
e7c8f35
fix: restore vlaina project link
vladelaina Aug 23, 2026
0df3e76
fix: remove developer description from support page
vladelaina Aug 23, 2026
953263b
Update README.md
vladelaina Aug 23, 2026
38c0af4
feat: adapt preferences chrome for macOS
vladelaina Aug 23, 2026
379f099
feat: clarify licenses and harden locale encoding
vladelaina Aug 23, 2026
b39c0b7
fix: make localized links and keys reusable
vladelaina Aug 23, 2026
0ac8446
Update LICENSE
vladelaina Aug 24, 2026
eb99c18
Create CODE_OF_CONDUCT.md
vladelaina Aug 24, 2026
5fe0832
Create PULL_REQUEST_TEMPLATE.md
vladelaina Aug 24, 2026
e47ecd2
Create SECURITY.md
vladelaina Aug 24, 2026
c3b6493
Update README.md
vladelaina Aug 24, 2026
f1433a4
Add files via upload
vladelaina Aug 24, 2026
cc17afd
Update 2_bug_report.yml
vladelaina Aug 24, 2026
d8e34c4
Improve model import and cover capture
vladelaina Aug 24, 2026
4bbd692
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 24, 2026
5bb4409
refactor: split oversized source files
vladelaina Aug 24, 2026
e3419ac
fix: restore viewer audit allocation declarations
vladelaina Aug 24, 2026
c405dc9
fix: guard i18n test path construction
vladelaina Aug 24, 2026
4fb4d5c
fix: run store packaging on canonical repository
vladelaina Aug 24, 2026
ccf8fac
fix: restore production Cubism builds in Actions
vladelaina Aug 24, 2026
fa631d8
feat: add log access and unify runtime logging
vladelaina Aug 24, 2026
20b8b5a
fix: pin Cubism builds to Visual Studio 2022
vladelaina Aug 24, 2026
ae256ed
fix: set policies for line check script
vladelaina Aug 24, 2026
89ea1eb
fix: publish Cubism-enabled Windows artifacts
vladelaina Aug 24, 2026
5985bb6
fix: prohibit SDK-free workflow artifacts
vladelaina Aug 24, 2026
efa129a
feat: publish Cubism builds for desktop platforms
vladelaina Aug 24, 2026
e37dfee
fix: compile Cubism on Unix runners
vladelaina Aug 24, 2026
059f851
fix: complete cross-platform release artifacts
vladelaina Aug 24, 2026
8115924
feat: add 32-bit and macOS architecture builds
vladelaina Aug 24, 2026
e702ee5
Update tray tooltip branding
vladelaina Aug 24, 2026
4143932
fix: publish only x64 Store package
vladelaina Aug 24, 2026
7b3f3b3
Update README with OpenGL vs Vulkan discussion
vladelaina Aug 26, 2026
d765e8f
refactor: unify built-in and imported model storage
vladelaina Aug 26, 2026
158306b
refactor: use portable Mver model storage
vladelaina Aug 26, 2026
dd6e7c9
fix: complete portable Mver model assets
vladelaina Aug 26, 2026
8d8fe30
fix: restore clean model import builds
vladelaina Aug 26, 2026
ea544bf
fix: omit Mver runtime resources on import
vladelaina Aug 26, 2026
6b12ad6
chore: update developer coffee translations
vladelaina Aug 26, 2026
5649f16
fix: omit nested Mver runtime resources
vladelaina Aug 26, 2026
d8f6e05
refactor: isolate Mver package copying
vladelaina Aug 26, 2026
12b31bb
feat: add Windows update and release automation
vladelaina Aug 27, 2026
47ee0e9
fix: use SDL time API for update checks
vladelaina Aug 27, 2026
36c0eb7
ci: pause macOS jobs
vladelaina Aug 27, 2026
d8097f6
ci: scan all release artifacts with VirusTotal
vladelaina Aug 27, 2026
f75792a
fix(windows): isolate MSIX application storage
vladelaina Aug 27, 2026
9cf082d
ci: limit VirusTotal scans to key artifacts
vladelaina Aug 27, 2026
7c435b8
fix(ci): download exact VirusTotal artifacts
vladelaina Aug 27, 2026
2d02241
fix(ci): match raw VirusTotal artifact names
vladelaina Aug 27, 2026
da9bca3
fix(store): update Microsoft Store package identity
vladelaina Aug 27, 2026
11e9025
fix(ci): scan intact VirusTotal artifacts
vladelaina Aug 27, 2026
f49c6d8
fix(windows): reduce installer antivirus false positives
vladelaina Aug 27, 2026
7d055c1
fix: streamline Windows packaging
vladelaina Aug 28, 2026
abb11ab
fix(ci): stabilize Windows installer packaging
vladelaina Aug 28, 2026
7900c4a
fix(ci): restore proven NSIS packaging path
vladelaina Aug 28, 2026
a1802cc
feat(windows): simplify installer and portable release
vladelaina Aug 28, 2026
4e7752a
feat(windows): preserve user data on uninstall
vladelaina Aug 28, 2026
b67ffe1
chore(release): centralize version at 1.1.0
vladelaina Aug 28, 2026
f161e3d
fix(store): align MSIX version with app version
vladelaina Aug 28, 2026
88d826b
docs: add privacy policy
vladelaina Aug 28, 2026
a732d2c
fix: unify displayed application version
vladelaina Aug 28, 2026
172594b
Update README.md
vladelaina Aug 28, 2026
e3ae66a
Unify application branding on bongocat logo
vladelaina Aug 28, 2026
0ba108a
Embed bongocat logo in runtime asset pack
vladelaina Aug 28, 2026
6486e90
Restore Windows icon from bongocat logo
vladelaina Aug 28, 2026
6b40212
Polish preferences branding and unify bongocat naming
vladelaina Aug 28, 2026
58823b9
t Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 28, 2026
1fb7cb3
fix: add Store desktop shortcut and right-click handling
vladelaina Aug 29, 2026
42a5c8c
Update settings logo hover styling
vladelaina Aug 29, 2026
9dbfa0d
Update model library link styling
vladelaina Aug 29, 2026
1599abf
Rename support section to about
vladelaina Aug 29, 2026
decc3f3
Refine preferences layout and icons
vladelaina Aug 29, 2026
b41788f
Clarify supported model import formats
vladelaina Aug 29, 2026
78aead5
Polish model import and about page copy
vladelaina Aug 29, 2026
1966f76
Fix Mver model candidate filtering
vladelaina Aug 29, 2026
a0c6045
Stabilize model switching and GL lifecycle
vladelaina Aug 29, 2026
16fa8e9
feat(models): improve progressive import and catalog refresh
vladelaina Aug 29, 2026
6c55586
fix githbu action
vladelaina Aug 29, 2026
d21cdb9
Update README.md
vladelaina Aug 29, 2026
e73a541
Update README.md
vladelaina Aug 29, 2026
fd1e7de
Update README.md
vladelaina Aug 29, 2026
e16de1a
Update README.md
vladelaina Aug 29, 2026
c744a6f
Update README.md
vladelaina Aug 29, 2026
41b9396
Update README.md
vladelaina Aug 29, 2026
63bdee9
Improve batch model import failure reporting
vladelaina Aug 30, 2026
266f7f2
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 30, 2026
31e99f7
Fix Mver model import compatibility regressions
vladelaina Aug 30, 2026
9269e46
Update README.md
vladelaina Aug 30, 2026
735224b
Refactor model import format handling
vladelaina Aug 30, 2026
d3e4066
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 30, 2026
da76482
fix: harden progressive model imports
vladelaina Aug 30, 2026
99b8d0f
Update README.md
vladelaina Aug 30, 2026
940e40e
fix: correct legacy Tauri model projection fallback
vladelaina Aug 30, 2026
d55fe59
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Aug 30, 2026
3bb67b7
chore: bump version to 1.3.0
vladelaina Aug 30, 2026
4970896
refactor: split oversized source files
vladelaina Aug 30, 2026
0967ac8
refactor: organize model cover capture workflow
vladelaina Aug 31, 2026
0ff6d10
🌟 chore: adjust project components
vladelaina Aug 31, 2026
122d8f6
添加中文版README
Fid-falling Aug 31, 2026
7844604
🌟 chore: improve project setup
vladelaina Sep 1, 2026
c7aa9c6
🌟 chore: maintain project code
vladelaina Sep 1, 2026
4f92e95
🌟 chore: clean up project details
vladelaina Sep 1, 2026
b8b858f
🌟 chore: clean up project details
vladelaina Sep 1, 2026
cc9493c
chore: update publisher metadata
vladelaina Sep 1, 2026
640626e
fix: refresh model covers from restored state
vladelaina Sep 1, 2026
411e5da
Update README.md
vladelaina Sep 1, 2026
0a2e30f
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Sep 1, 2026
708ab53
Update README.md
vladelaina Sep 1, 2026
083ce09
Fix duplicate language selection links in README
vladelaina Sep 1, 2026
7c12958
🌟 chore: streamline project updates
vladelaina Sep 1, 2026
85546b5
Merge pull request #3 from Fid-falling/feature/中文readme
vladelaina Sep 1, 2026
aa6b8f8
🌟 chore: clean up project details
vladelaina Sep 1, 2026
80e5e51
release: add download links to GitHub releases
vladelaina Sep 1, 2026
8dac08e
Merge branch 'main' of github.com:vladelaina/BongoCat
vladelaina Sep 1, 2026
10994e8
Update README.md
vladelaina Sep 1, 2026
d7a0f6c
🌟 chore: adjust project components
vladelaina Sep 1, 2026
7fb927c
Update README.md
vladelaina Sep 1, 2026
3f39cf8
Update README.md
vladelaina Oct 1, 2026
6669996
ci: disable automatic builds and releases on tag pushes
vladelaina Oct 3, 2026
7d77803
perf: skip hashes for ineligible configuration stores
yeahjack Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true

[*.{c,h,m,mm,cpp,hpp,json,cmake,md,ps1,js}]
trim_trailing_whitespace = true
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/1_feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ✨ Feature Request ✨
description: "💡 Got a great idea? Share your creativity with us!"
title: "[✨Feature Request]: "
labels: ['enhancement']
body:
- type: input
id: problem
attributes:
label: 🌈 Feature You'd Like
description: "Briefly describe the feature you'd like to add or improve. Let's make the software even better together!"
validations:
required: false
- type: textarea
id: way-to-solve
attributes:
label: 🚀 Ideal Solution
description: "What does your perfect solution look like? Feel free to use your imagination - don't worry about technical details!"
validations:
required: true
- type: textarea
id: instead
attributes:
label: 🤔 Alternative Solutions (Optional)
description: "If you have other ideas, please share them here. The more, the merrier!"
validations:
required: false
- type: checkboxes
id: "latest-version"
attributes:
label: "✅ Final Step"
description: "Before submitting your brilliant idea, please confirm the following:"
options:
- label: "🌟 I've checked the latest version and confirmed my requested feature isn't already implemented."
required: true
- label: "📋 I've reviewed existing feature requests to make sure this isn't a duplicate."
required: true
- label: "🌍 I've written this request in English so it can be understood by the wider community."
required: true
57 changes: 57 additions & 0 deletions .github/ISSUE_TEMPLATE/2_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 🐛 Bug Report 🐛
description: "🛠️ Found a problem? Let us know here!"
title: "[🐛Bug]: "
labels: ["bug"]
body:
- type: input
id: "expectation"
attributes:
label: "✨ What You Expected"
description: "How should the software work? Describe what you expected to happen."
validations:
required: false
- type: textarea
id: "describe-the-bug"
attributes:
label: "❓ What Actually Happened"
description: "Oops! Something went wrong? Please tell us what you saw - the more details, the better!"
validations:
required: true
- type: textarea
id: "reproduction-method"
attributes:
label: "📝 Steps to Reproduce the Issue"
description: "Can you tell us how you encountered this bug? List the steps so we can find the problem faster."
placeholder: "For example:\n1. Used what feature\n2. Then this happened...\n3. Oops! Problem occurred!"
validations:
required: false
- type: dropdown
id: "platform"
attributes:
label: "📌 Platform"
description: "Which platform are you using? For Linux, please select your desktop environment."
options:
- "Windows"
- "macOS"
- "Linux - GNOME"
- "Linux - KDE Plasma"
- "Linux - Xfce"
- "Linux - Cinnamon"
- "Linux - MATE"
- "Linux - LXQt"
- "Linux - Niri"
- "Linux - Other desktop environment"
validations:
required: true
- type: checkboxes
id: "latest-version"
attributes:
label: "✅ Final Checklist"
description: "Before submitting your bug report, please confirm the following:"
options:
- label: "⚡ I've confirmed I'm using the latest version, not an older one."
required: true
- label: "📋 I've checked the FAQ and known issues list to confirm this is a new bug."
required: true
- label: "🌍 This report is written in English so that more members of the community can read and understand it."
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Questions & Discussions 💬
url: https://github.com/vladelaina/BongoCat/discussions
about: "🤝 Have a question or want to chat? Join our friendly community discussions!"
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Ciallo~(∠・ω<)⌒★

### 🎉 You are awesome!

Thank you for taking the time to make this project better! We truly value your contribution.💕

---

### 📝 What's changed?
*(Briefly describe what you did or what problem you fixed)*

>

---

### 🤝 Don't worry about perfection

**We value your ideas and participation more than perfect code!**

If there are any style, testing, or detail issues, **we will help fix and polish them**. Just submit it, and we'll handle the rest!

---

*Thanks again! Happy to build this with you! 🙌*
2 changes: 1 addition & 1 deletion .github/gcc-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"problemMatcher": [
{
"owner": "bongo-cat-gcc",
"owner": "bongocat-gcc",
"pattern": [
{
"regexp": "^(.+?):(\\d+):(\\d+):\\s+(warning|error|fatal error):\\s+(.*)$",
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/build-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -uo pipefail

log="${RUNNER_TEMP:-.}/bongo-cat-native-build.log"
log="${RUNNER_TEMP:-.}/bongocat-native-build.log"
set +e
"$@" 2>&1 | tee "$log"
status=${PIPESTATUS[0]}
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/build-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ param(
)

$tempRoot = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { '.' }
$log = Join-Path $tempRoot 'bongo-cat-native-build.log'
$log = Join-Path $tempRoot 'bongocat-native-build.log'
$executable = $BuildCommand[0]
$arguments = if ($BuildCommand.Count -gt 1) { $BuildCommand[1..($BuildCommand.Count - 1)] } else { @() }

Expand Down
136 changes: 136 additions & 0 deletions .github/scripts/check-publish-guards.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
[CmdletBinding()]
param([switch]$SelfTest)

$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

$upstreamGuards = @(
"github.repository == 'vladelaina/BongoCat'"
)
$workflowDirectory = Join-Path (Split-Path $PSScriptRoot -Parent) 'workflows'
$sensitiveMarkers = @(
'build-store-package.ps1',
'CUBISM_SDK_ARCHIVE_URL',
'VIRUSTOTAL_API_KEY',
'actions/upload-artifact',
'softprops/action-gh-release'
)
$runtimeArtifactMarkers = @(
'build-store-package.ps1',
'Upload desktop release',
'Upload Microsoft Store MSIX',
'Upload Windows desktop release',
'Upload Windows portable release',
'name: bongocat-release-',
'softprops/action-gh-release'
)

function Get-PublishingGuardFailures {
param(
[Parameter(Mandatory = $true)][string]$Text,
[Parameter(Mandatory = $true)][string]$Label
)

$jobsStart = $Text.IndexOf("jobs:", [StringComparison]::Ordinal)
if ($jobsStart -lt 0) { return @() }
$jobsText = $Text.Substring($jobsStart)
$jobPattern = '(?ms)^ ([A-Za-z0-9_-]+):\s*\r?\n' +
'(.*?)(?=^ [A-Za-z0-9_-]+:\s*\r?\n|\z)'
$failures = @()
$jobMatches = [regex]::Matches($jobsText, $jobPattern)
$buildJob = @($jobMatches | Where-Object {
$_.Groups[1].Value -eq 'build'
} | Select-Object -First 1)
$protectedBuild = $buildJob.Count -eq 1 -and
$buildJob[0].Value.Contains('-DBONGO_CAT_REQUIRE_CUBISM=ON')

foreach ($job in $jobMatches) {
$jobName = $job.Groups[1].Value
$jobText = $job.Value
$matched = @($sensitiveMarkers | Where-Object { $jobText.Contains($_) })
if ($matched.Count -eq 0) { continue }
$guarded = @($upstreamGuards | Where-Object {
$jobText.Contains($_)
}).Count -gt 0
if (-not $guarded) {
$failures += "$Label`: job '$jobName' lacks upstream guard; " +
"matched $($matched -join ', ')"
}
$publishesRuntimeArtifacts = @($runtimeArtifactMarkers | Where-Object {
$jobText.Contains($_)
}).Count -gt 0
$usesProtectedBuild = $protectedBuild -and $jobText -match
'(?m)^\s+needs:\s*(?:build|\[[^\]]*\bbuild\b[^\]]*\])\s*$'
if ($publishesRuntimeArtifacts -and
-not $jobText.Contains('-DBONGO_CAT_REQUIRE_CUBISM=ON') -and
-not $usesProtectedBuild) {
$failures += "$Label`: job '$jobName' publishes artifacts without " +
'requiring a Cubism SDK build'
}
}
return $failures
}

$workflowPaths = @(
Get-ChildItem -LiteralPath $workflowDirectory -File |
Where-Object { $_.Extension -in @('.yml', '.yaml') } |
Sort-Object FullName
)
$failures = @()
$checkedJobs = 0
$selfTestText = $null

foreach ($path in $workflowPaths) {
$text = Get-Content -LiteralPath $path.FullName -Raw
$pathFailures = @(Get-PublishingGuardFailures -Text $text -Label $path.Name)
$failures += $pathFailures
$jobsStart = $text.IndexOf("jobs:", [StringComparison]::Ordinal)
if ($jobsStart -ge 0) {
$jobsText = $text.Substring($jobsStart)
$checkedJobs += @([regex]::Matches($jobsText,
'(?ms)^ ([A-Za-z0-9_-]+):\s*\r?\n(.*?)(?=^ [A-Za-z0-9_-]+:\s*\r?\n|\z)') |
Where-Object {
$jobText = $_.Value
@($sensitiveMarkers | Where-Object {
$jobText.Contains($_)
}).Count -gt 0
}).Count
}
if (-not $selfTestText -and
($sensitiveMarkers | Where-Object { $text.Contains($_) })) {
$selfTestText = $text
}
}

if ($SelfTest) {
if (-not $selfTestText) {
$failures += 'Self-test could not find a sensitive workflow.'
}
else {
$mutated = $selfTestText
foreach ($guard in $upstreamGuards) {
$mutated = $mutated.Replace($guard, 'true')
}
$caught = @(Get-PublishingGuardFailures -Text $mutated -Label 'self-test')
if ($caught.Count -eq 0) {
$failures += 'Self-test did not reject a removed upstream guard.'
}
$withoutCubism = $selfTestText.Replace(
'-DBONGO_CAT_REQUIRE_CUBISM=ON',
'-DBONGO_CAT_REQUIRE_CUBISM=OFF')
$cubismFailures = @(Get-PublishingGuardFailures `
-Text $withoutCubism -Label 'self-test')
if (-not ($cubismFailures -match 'requiring a Cubism SDK build')) {
$failures += 'Self-test did not reject an SDK-free artifact job.'
}
}
}

if ($failures.Count -gt 0) {
Write-Error ("Publishing guard policy failed:`n- " +
($failures -join "`n- "))
exit 1
}

Write-Host "Publishing guard policy passed for $checkedJobs sensitive job(s)."
if ($SelfTest) { Write-Host 'Publishing guard negative self-tests passed.' }
Loading