diff --git a/packages/app/eas.json b/packages/app/eas.json index 32cc8e130..d7d4c9e65 100644 --- a/packages/app/eas.json +++ b/packages/app/eas.json @@ -1,6 +1,7 @@ { "cli": { - "version": ">= 14.0.0" + "version": ">= 14.0.0", + "appVersionSource": "remote" }, "build": { "development": { @@ -18,6 +19,9 @@ "channel": "production", "env": { "APP_VARIANT": "production" + }, + "android": { + "autoIncrement": "versionCode" } }, "production-apk": { diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 44a0e5264..9adc5e137 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -1,4 +1,5 @@ import { Command } from 'commander' +import { createRequire } from 'node:module' import { createAgentCommand } from './commands/agent/index.js' import { createDaemonCommand } from './commands/daemon/index.js' import { createPermitCommand } from './commands/permit/index.js' @@ -20,7 +21,9 @@ import { runUpdateCommand } from './commands/agent/update.js' import { withOutput } from './output/index.js' import { onboardCommand } from './commands/onboard.js' -const VERSION = '0.1.0' +const require = createRequire(import.meta.url) +const packageJson = require('../package.json') as { version?: string } +const VERSION = typeof packageJson.version === 'string' ? packageJson.version : '0.0.0' // Helper function to collect multiple option values into an array function collectMultiple(value: string, previous: string[]): string[] {