Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: handling version of the iOS and

Ilian Sapundshiev275e6bae6c8a
diff --git a/capacitor/android/app/build.gradle b/capacitor/android/app/build.gradle
index b01269d12..f5e3eed27 100644
--- a/capacitor/android/app/build.gradle
+++ b/capacitor/android/app/build.gradle
@@ -7,8 +7,8 @@ android {
applicationId "org.tagspaces.mobileapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
+ versionCode 10248
+ versionName "6.13.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
diff --git a/capacitor/ios/App/App.xcodeproj/project.pbxproj b/capacitor/ios/App/App.xcodeproj/project.pbxproj
index d12f790be..2a2130a5e 100644
--- a/capacitor/ios/App/App.xcodeproj/project.pbxproj
+++ b/capacitor/ios/App/App.xcodeproj/project.pbxproj
@@ -319,7 +319,7 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 2;
+ CURRENT_PROJECT_VERSION = 10248;
DEVELOPMENT_TEAM = DLK22E2679;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
@@ -327,7 +327,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 1.0;
+ MARKETING_VERSION = 6.13.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
PRODUCT_NAME = TagSpaces;
@@ -345,7 +345,7 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 2;
+ CURRENT_PROJECT_VERSION = 10248;
DEVELOPMENT_TEAM = DLK22E2679;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
@@ -353,7 +353,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
- MARKETING_VERSION = 1.0;
+ MARKETING_VERSION = 6.13.1;
PRODUCT_BUNDLE_IDENTIFIER = org.tagspaces.mobileapp;
PRODUCT_NAME = TagSpaces;
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/package.json b/package.json
index c9870a1ba..c18d8170b 100644
--- a/package.json
+++ b/package.json
@@ -104,7 +104,7 @@
"prebuild": "rimraf release/app/dist && npm run prepare-node && npm run generate-extensions && npm run gen-licenses",
"prestart": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.main.dev.ts",
"prepare": "husky install",
- "prepare-capacitor": "npm run install-ext-web-check && rimraf capacitor/www/dist && rimraf capacitor/www/node_modules && shx cp -rL release/app/node_modules capacitor/www && node scripts/strip-capacitor-natives.js && shx cp LICENSE.txt capacitor/www",
+ "prepare-capacitor": "npm run install-ext-web-check && npm run version-meta && rimraf capacitor/www/dist && rimraf capacitor/www/node_modules && shx cp -rL release/app/node_modules capacitor/www && node scripts/strip-capacitor-natives.js && shx cp LICENSE.txt capacitor/www",
"prepare-cordova": "npm run install-ext-web-check && rimraf cordova/www/dist && rimraf cordova/www/node_modules && shx cp -rL release/app/node_modules cordova/www && shx cp LICENSE.txt cordova/www",
"prepare-cordova-pro": "npm run install-ext-web-check && rimraf cordova/www/dist && rimraf cordova/www/node_modules && shx cp -rL release/app/node_modules cordova/www && shx cp node_modules/@tagspacespro/tagspacespro/EULA.txt cordova/www",
"prepare-node": "npm run install-ext-node-check",
diff --git a/release/app/package-lock.json b/release/app/package-lock.json
index 3a55d3adb..4cef536b6 100644
--- a/release/app/package-lock.json
+++ b/release/app/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "tagspaces",
- "version": "6.13.0",
+ "version": "6.13.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "tagspaces",
- "version": "6.13.0",
+ "version": "6.13.1",
"hasInstallScript": true,
"license": "AGPL-3.0",
"dependencies": {
diff --git a/scripts/versionmeta.js b/scripts/versionmeta.js
index 2da6507f2..479d4a0a5 100644
--- a/scripts/versionmeta.js
+++ b/scripts/versionmeta.js
@@ -1,4 +1,6 @@
const sh = require('shelljs');
+const fs = require('fs');
+const path = require('path');
const { version, productName } = require('../release/app/package.json');
if (!sh.which('git')) {
@@ -6,25 +8,71 @@ if (!sh.which('git')) {
sh.exit(1);
}
+// CFBundleShortVersionString / Android versionName must be plain dot-separated
+// numeric. Strip "-beta", "-rc.1" or any other pre-release suffix.
+const cleanVersion = version.replace(/-.*$/, '');
+
+// Monotonic build number derived from git history. Same commit always yields
+// the same number; the count only goes up as you add commits, so CI reruns and
+// re-archives never drift. Apple/Play accept simple integers here.
+let buildNumber = sh
+ .exec('git rev-list --count HEAD', { silent: true })
+ .stdout.trim();
+if (!buildNumber) buildNumber = '1';
+
const buildTime = new Date().toISOString();
-sh.exec(
- 'git log --format="%H" -n 1',
- { silent: true },
- (code, lastCommitId) => {
- if (lastCommitId.length > 1) {
- lastCommitId = lastCommitId.slice(0, lastCommitId.length - 1);
- }
- sh.echo(
- '{"commitId": "' +
- lastCommitId +
- '", "buildTime": "' +
- buildTime +
- '", "version": "' +
- version +
- '", "name": "' +
- productName +
- '"}',
- ).to('src/renderer/version.json');
- // sh.sed('-i', 'BUILD_VERSION', 'v0.1.2', file);
- },
+const lastCommitId = sh
+ .exec('git log --format="%H" -n 1', { silent: true })
+ .stdout.trim();
+
+// --- renderer version.json ---
+const versionJsonPath = path.resolve(
+ __dirname,
+ '..',
+ 'src/renderer/version.json',
+);
+fs.writeFileSync(
+ versionJsonPath,
+ JSON.stringify(
+ {
+ commitId: lastCommitId,
+ buildTime,
+ version,
+ name: productName,
+ },
+ null,
+ 2,
+ ) + '\n',
);
+sh.echo(`versionmeta: wrote src/renderer/version.json → ${version}`);
+
+// --- Capacitor iOS Xcode project ---
+const pbxproj = path.resolve(
+ __dirname,
+ '..',
+ 'capacitor/ios/App/App.xcodeproj/project.pbxproj',
+);
+if (fs.existsSync(pbxproj)) {
+ let s = fs.readFileSync(pbxproj, 'utf8');
+ s = s.replace(
+ /MARKETING_VERSION\s*=\s*[^;]+;/g,
+ `MARKETING_VERSION = ${cleanVersion};`,
+ );
+ s = s.replace(
+ /CURRENT_PROJECT_VERSION\s*=\s*[^;]+;/g,
+ `CURRENT_PROJECT_VERSION = ${buildNumber};`,
+ );
+ fs.writeFileSync(pbxproj, s);
+ sh.echo(
+ `versionmeta: synced iOS Xcode project → ${cleanVersion} (${buildNumber})`,
+ );
+}
+
+// Android versionName / versionCode are intentionally NOT touched here.
+// The Play-Store-bound builds are produced by external script, which
+// owns a semver-derived versionCode scheme (major*10000+minor*100+patch) and
+// bumps Pro by +1 so it outranks the same-version Lite for in-place upgrades.
+// Overwriting from here would clobber both pieces and risk downgrading below
+// already-shipped versionCodes (which Play rejects). Dev `cap run android`
+// uses the build.gradle placeholders, which is fine — those builds don't go
+// to Play.