ci: fix ios release signing patch

This commit is contained in:
Bohdan Triapitsyn
2026-07-07 11:51:25 +03:00
parent 1db8f5cc80
commit ab3ce3354f
+7 -9
View File
@@ -218,24 +218,22 @@ jobs:
for (const { bundle, profile } of replacements) {
if (!profile) throw new Error(`Missing provisioning profile name for ${bundle}`);
const marker = `PRODUCT_BUNDLE_IDENTIFIER = ${bundle};`;
let markerIndex = -1;
let blockStart = -1;
let blockEnd = -1;
let searchFrom = 0;
while (true) {
const candidate = project.indexOf(marker, searchFrom);
if (candidate === -1) break;
const candidateEnd = project.indexOf('\n\t\t\t\t};', candidate);
const configEnd = project.indexOf('\n\t\t};', candidateEnd);
const config = project.slice(candidateEnd, configEnd);
const candidateStart = project.lastIndexOf('\n\t\t', candidate);
const candidateEnd = project.indexOf('\n\t\t};', candidate);
const config = project.slice(candidateStart, candidateEnd);
if (config.includes('name = Release;')) {
markerIndex = candidate;
blockStart = project.indexOf('buildSettings = {', candidateStart);
blockEnd = project.indexOf('\n\t\t\t\t};', candidate);
break;
}
searchFrom = candidate + marker.length;
}
if (markerIndex === -1) throw new Error(`Could not find ${bundle} Release build settings`);
const blockStart = project.lastIndexOf('buildSettings = {', markerIndex);
const blockEnd = project.indexOf('\n\t\t\t\t};', markerIndex);
if (blockStart === -1 || blockEnd === -1) throw new Error(`Could not find ${bundle} build settings block`);
const before = project.slice(0, blockStart);