From 31ce0f46e02cc3e1b7d7b1748472dba4cb180e89 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sun, 7 Nov 2021 11:55:34 +0000 Subject: [PATCH] Tools: Show more info in IOS release script --- packages/tools/release-ios.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/tools/release-ios.ts b/packages/tools/release-ios.ts index 2cb590ac1c2..b4f2e15c012 100644 --- a/packages/tools/release-ios.ts +++ b/packages/tools/release-ios.ts @@ -11,6 +11,7 @@ async function updateCodeProjVersions(filePath: string) { const originalContent = await fs.readFile(filePath, 'utf8'); let newContent = originalContent; let newVersion = ''; + let newVersionId = 0; // MARKETING_VERSION = 10.1.0; newContent = newContent.replace(/(MARKETING_VERSION = )(\d+\.\d+)\.(\d+)(.*)/g, function(_match, prefix, majorMinorVersion, buildNum, suffix) { @@ -24,7 +25,8 @@ async function updateCodeProjVersions(filePath: string) { newContent = newContent.replace(/(CURRENT_PROJECT_VERSION = )(\d+)(.*)/g, function(_match, prefix, projectVersion, suffix) { const n = Number(projectVersion); if (isNaN(n)) throw new Error(`Invalid version code: ${projectVersion}`); - return `${prefix}${n + 1}${suffix}`; + newVersionId = n + 1; + return `${prefix}${newVersionId}${suffix}`; }); if (!newVersion) throw new Error('Could not determine new version'); @@ -32,7 +34,7 @@ async function updateCodeProjVersions(filePath: string) { await fs.writeFile(filePath, newContent, 'utf8'); - return newVersion; + return { newVersion, newVersionId }; } async function main() { @@ -40,10 +42,12 @@ async function main() { console.info('Updating version numbers...'); - const newVersion = await updateCodeProjVersions(`${mobileDir}/ios/Joplin.xcodeproj/project.pbxproj`); - console.info(`New version: ${newVersion}`); + const { newVersion, newVersionId } = await updateCodeProjVersions(`${mobileDir}/ios/Joplin.xcodeproj/project.pbxproj`); + console.info(`New version: ${newVersion} (${newVersionId})`); const tagName = `ios-v${newVersion}`; + console.info(`Tag name: ${tagName}`); + await execCommand2('git add -A'); await execCommand2(`git commit -m "${tagName}"`); await execCommand2(`git tag ${tagName}`);