From ab3ce3354f56a8e34fb5700e3fe7fe352dd95caf Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Tue, 7 Jul 2026 11:51:25 +0300 Subject: [PATCH] ci: fix ios release signing patch --- .github/workflows/mobile-release.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/mobile-release.yml b/.github/workflows/mobile-release.yml index 332310bd..4408ccf8 100644 --- a/.github/workflows/mobile-release.yml +++ b/.github/workflows/mobile-release.yml @@ -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);