1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-24 20:19:10 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Laurent Cozic
c3854ec350 ios-v10.6.1 2021-01-02 14:54:31 +00:00
Laurent Cozic
c2c737541d ios release script 2021-01-02 14:53:30 +00:00
2 changed files with 58 additions and 4 deletions

View File

@@ -338,13 +338,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 59;
DEVELOPMENT_TEAM = A9BXAFS6CT;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 10.6.0;
MARKETING_VERSION = 10.6.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -365,12 +365,12 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 58;
CURRENT_PROJECT_VERSION = 59;
DEVELOPMENT_TEAM = A9BXAFS6CT;
INFOPLIST_FILE = Joplin/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 10.6.0;
MARKETING_VERSION = 10.6.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",

View File

@@ -0,0 +1,54 @@
const fs = require('fs-extra');
const { execCommandVerbose, rootDir, gitPullTry } = require('./tool-utils.js');
const mobileDir = `${rootDir}/packages/app-mobile`;
async function updateCodeProjVersions(filePath) {
const originalContent = await fs.readFile(filePath, 'utf8');
let newContent = originalContent;
let newVersion = '';
// MARKETING_VERSION = 10.1.0;
newContent = newContent.replace(/(MARKETING_VERSION = )(\d+\.\d+)\.(\d+)(.*)/g, function(_match, prefix, majorMinorVersion, buildNum, suffix) {
const n = Number(buildNum);
if (isNaN(n)) throw new Error(`Invalid version code: ${buildNum}`);
newVersion = `${majorMinorVersion}.${n + 1}`;
return `${prefix}${newVersion}${suffix}`;
});
// CURRENT_PROJECT_VERSION = 58;
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}`;
});
if (!newVersion) throw new Error('Could not determine new version');
if (newContent === originalContent) throw new Error('No change was made to project file');
await fs.writeFile(filePath, newContent, 'utf8');
return newVersion;
}
async function main() {
await gitPullTry();
console.info('Updating version numbers...');
const newVersion = await updateCodeProjVersions(`${mobileDir}/ios/Joplin.xcodeproj/project.pbxproj`);
console.info(`New version: ${newVersion}`);
const tagName = `ios-v${newVersion}`;
await execCommandVerbose('git', ['add', '-A']);
await execCommandVerbose('git', ['commit', '-m', tagName]);
await execCommandVerbose('git', ['tag', tagName]);
await execCommandVerbose('git', ['push']);
await execCommandVerbose('git', ['push', '--tags']);
}
main().catch((error) => {
console.error('Fatal error');
console.error(error);
process.exit(1);
});