/** * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途 */ export declare const APP_PLATFORMS: string[]; export declare const IOS_PROFILE_DIR = "miniapp/ios/.appleConnect/.profile"; export declare const IOS_CERT_DIR = "miniapp/ios/.appleConnect/.cert"; export declare const IOS_CLOUD_BUILD_MATERIAL_DIR = "miniapp/ios/iosCloudBuildMaterial"; export declare const ANDROID_KEYSTORE_DIR = "miniapp/android"; export declare type AppUploadResult = { version: string; pgyer?: Record; [key: string]: any; }; export declare function ensureDir(dir: string): string; export declare function resolveProjectPath(filePath?: string): string; /** 签名密码等敏感项仅从 process.env 读取,需在业务项目 CI 变量中配置 */ export declare function getCiEnv(name: string): string; export declare function createProject(ci: any, appId: string, compileType: string): any; /** * 从固定源目录拷贝 profile/p12 到 iosCloudBuildMaterial,返回构建可用路径 */ export declare function copyIosMaterialFile(fileName: string, sourceDir: string): string; export declare function pickIosCert(ios: any, isTestRobot: boolean): { isDistribute: boolean; certificateName: any; profilePath: string; p12Path: string; p12Password: string; }; /** * Android keyStore 只需文件名,固定目录 miniapp/android */ export declare function resolveAndroidKeyStore(fileName?: string): string; /** 解析 --appstore=TXYYB,huawei,保留渠道名大小写 */ export declare function toAppStoreList(appstore?: string | string[] | boolean): string[]; export declare function getPackageVersionLabel(versionKey?: string): "体验版(Beta)" | "候选版(Rc)" | "正式版(Release)"; /** 存在 appstore 时:【渠道】${desc} */ export declare function formatDescWithAppStore(desc: string, appstore?: string): string; /** * 从产物文件名反推 appstore(不依赖 stores 入参)。 * 命名约定(包名/前缀可变): * - 无渠道:`xxxxxx-7.0.4-Beta.apk` / `xxxxxx-7.0.4.apk` * - 有渠道:`xxxxxx-7.0.4-Beta-TXYYB.apk` / `xxxxxx-7.0.4-TXYYB.apk` * 版本号后的后缀与 formatChannelValue(versionKey, appstore) 一致: * Beta | Rc | Beta- | Rc- | | 空 */ export declare function resolveAppStoreFromFileName(fileName: string): string; /** * 产物目录:outputPath/ios、outputPath/android * 不再按 Beta/Release 分子目录(文件名已能区分版本) */ export declare function getPlatformOutputDir(outputPath: string, platform: string): string; /** * 批量构建前清空平台产物目录;不存在则创建。 * 同一平台在一次批量任务中只应调用一次。 */ export declare function preparePlatformOutputDir(outputPath: string, platform: string): string; /** 在构建输出目录中收集全部指定后缀产物(多渠道 apk 等) */ export declare function findAllPackages(dir: string, ext: string): string[]; /** 兼容旧调用:取目录中最新一个产物 */ export declare function findNewestPackage(dir: string, ext: string): string; /** * miniprogram-ci 多端构建/上传失败时通常不抛错,而是返回 { success: false, errmsg } */ export declare function assertCiSuccess(res: any, fallbackMsg: string): any; /** * channel.value: * - versionKey 有值:${versionKey} / ${versionKey}-${appstore} * - 正式版(versionKey 为空):空字符串 / ${appstore} */ export declare function formatChannelValue(versionKey: string, appstore?: string): string; /** * Android versionCode:每位补齐 2 位后拼接为整数。 * 例:1.0.1 → 010001 → 10001;1.2.3 → 10203 */ export declare function toAndroidVersionCode(version: string): number; /** * iOS versionCode:取 tag 编号 01/02 → 有效数字 1/2 */ export declare function toIosVersionCode(tagBuildNo?: number): number; /** * 构建前同步 project.miniapp.json: * 1. version = 纯版本号(不含 Beta 前缀) * 2. versionCode = Android/iOS 各自规则(顶层字段,按当前构建平台写入) * 3. mini-android.channel.value 按版本类型 + 单个 appstore 组合 */ export declare function syncMiniappProjectConfig(version: string, versionKey: string, appstore?: string, versionCode?: number): { version: string; versionCode: number; channelValue: string; }; /** * Android 构建任务列表: * - 仅 appsystem=android:通用包 * - 仅 appstore=A,B:渠道包 A、B * - 同时传入:通用包 + 各渠道包 */ export declare function getAndroidBuildJobs(options: { systems: string[]; stores: string[]; }): { store: string; label: string; }[]; /** * 释放 miniprogram-ci Summer 编译子进程,避免上传结束后进程挂起 */ export declare function cleanupMiniProgramCi(): Promise;