@invarn/cibuild 1.3.19 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/src/cli.js +10 -3
- package/dist/src/commands/build.d.ts.map +1 -1
- package/dist/src/commands/build.js +4 -2
- package/dist/src/commands/edit.js +2 -2
- package/dist/src/yaml/parser.js +3 -3
- package/dist/src/yaml/platform-detector.d.ts +1 -1
- package/dist/src/yaml/platform-detector.js +2 -2
- package/dist/src/yaml/platform-detector.test.js +0 -19
- package/dist/src/yaml/types.d.ts +2 -2
- package/dist/src/yaml/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -180,7 +180,7 @@ async function handleInitCommand(opts = {}) {
|
|
|
180
180
|
];
|
|
181
181
|
const dependencies = [
|
|
182
182
|
...commonDependencies,
|
|
183
|
-
...(projectType === "android" ? androidDependencies : iosDependencies),
|
|
183
|
+
...(projectType === "android" ? androidDependencies : projectType === "kmm" ? [...androidDependencies, ...iosDependencies] : iosDependencies),
|
|
184
184
|
];
|
|
185
185
|
let allRequired = true;
|
|
186
186
|
let missingOptional = false;
|
|
@@ -318,8 +318,8 @@ async function handleInitCommand(opts = {}) {
|
|
|
318
318
|
try {
|
|
319
319
|
const yamlPipeline = loadYAMLPipeline(destPath);
|
|
320
320
|
const meta = yamlPipeline.meta?.["cibuild.io"];
|
|
321
|
-
if (meta?.platform === "ios" || meta?.platform === "android") {
|
|
322
|
-
importedPlatform = meta.platform;
|
|
321
|
+
if (meta?.platform === "ios" || meta?.platform === "android" || meta?.platform === "kmm") {
|
|
322
|
+
importedPlatform = meta.platform === "kmm" ? "ios" : meta.platform;
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
catch { /* ignore parse errors — default to macos-latest */ }
|
|
@@ -455,6 +455,7 @@ Usage:
|
|
|
455
455
|
ci run <path> [-w <name>] --skip-validation Skip validation, run with interactive prompts
|
|
456
456
|
ci validate <path> [-w <name>] Validate pipeline (alias for --validate-only)
|
|
457
457
|
ci detect-platform <path> [-w <name>] Detect platform from YAML pipeline
|
|
458
|
+
ci detect-project Detect project type (android, ios, kmm)
|
|
458
459
|
ci reset [--force] Remove all cibuild files and folders
|
|
459
460
|
ci edit <path> [-w <name>] View pipeline and edit step inputs
|
|
460
461
|
ci secrets add <var_name> <path> [-w <name>] Add a secret (prompted interactively)
|
|
@@ -502,6 +503,12 @@ Examples:
|
|
|
502
503
|
await import("./envman/cli.js");
|
|
503
504
|
return;
|
|
504
505
|
}
|
|
506
|
+
// Handle detect-project command
|
|
507
|
+
if (args[0] === "detect-project") {
|
|
508
|
+
const projectType = detectMobileProjectRoot(process.cwd());
|
|
509
|
+
console.log(projectType ?? "unknown");
|
|
510
|
+
process.exit(projectType ? 0 : 1);
|
|
511
|
+
}
|
|
505
512
|
// Handle init command
|
|
506
513
|
if (args[0] === "init") {
|
|
507
514
|
const importIdx = args.indexOf("--import");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/commands/build.ts"],"names":[],"mappings":"AAk8BA,wBAAsB,kBAAkB,CACtC,uBAAuB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,EAC1E,OAAO,GAAE;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAO,GACvE,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -199,13 +199,15 @@ function generateAndroidPipeline(javaVersion = 17, setup = { keystore: false, ke
|
|
|
199
199
|
const releaseGradleTask = isAab ? `bundle${rv.buildType}` : rv.gradleTask;
|
|
200
200
|
const releaseArtifactLabel = isAab ? 'AAB' : 'APK';
|
|
201
201
|
const releaseArtifactExt = isAab ? '*.aab' : '*.apk';
|
|
202
|
+
const stack = cacheTechnology === "kmm" ? "macos-xcode-26.4" : "linux-docker-android-22.04";
|
|
203
|
+
const platformMeta = cacheTechnology === "kmm" ? "kmm" : "android";
|
|
202
204
|
return `format_version: '1'
|
|
203
205
|
|
|
204
206
|
meta:
|
|
205
207
|
cibuild.io:
|
|
206
|
-
stack:
|
|
208
|
+
stack: ${stack}
|
|
207
209
|
machine_type: standard
|
|
208
|
-
platform:
|
|
210
|
+
platform: ${platformMeta}
|
|
209
211
|
|
|
210
212
|
app:
|
|
211
213
|
envs:
|
|
@@ -293,8 +293,8 @@ async function handleAddRegisteredStep(pipelinePath, workflowName, _pipeline, st
|
|
|
293
293
|
function detectWorkflowPlatform(pipeline, workflowName) {
|
|
294
294
|
// 1. Explicit platform declaration in meta
|
|
295
295
|
const metaPlatform = pipeline.meta?.['cibuild.io']?.platform;
|
|
296
|
-
if (metaPlatform === 'ios' || metaPlatform === 'android')
|
|
297
|
-
return metaPlatform;
|
|
296
|
+
if (metaPlatform === 'ios' || metaPlatform === 'android' || metaPlatform === 'kmm')
|
|
297
|
+
return metaPlatform === 'kmm' ? 'ios' : metaPlatform;
|
|
298
298
|
// 2. Scan existing steps as fallback
|
|
299
299
|
const workflow = pipeline.workflows[workflowName];
|
|
300
300
|
if (!workflow)
|
package/dist/src/yaml/parser.js
CHANGED
|
@@ -97,7 +97,7 @@ function validateYAMLPipeline(parsed, filePath) {
|
|
|
97
97
|
}
|
|
98
98
|
// Validate platform if specified
|
|
99
99
|
if (parsed.meta.platform) {
|
|
100
|
-
const validPlatforms = ['macos', 'linux'
|
|
100
|
+
const validPlatforms = ['macos', 'linux'];
|
|
101
101
|
if (!validPlatforms.includes(parsed.meta.platform)) {
|
|
102
102
|
throw new YAMLValidationError(`Invalid platform '${parsed.meta.platform}' in ${filePath}. Must be one of: ${validPlatforms.join(', ')}`);
|
|
103
103
|
}
|
|
@@ -110,9 +110,9 @@ function validateYAMLPipeline(parsed, filePath) {
|
|
|
110
110
|
}
|
|
111
111
|
// Validate stack pattern if specified
|
|
112
112
|
if (cibuildMeta.stack && typeof cibuildMeta.stack === 'string') {
|
|
113
|
-
const stackPattern = /^(macos|linux
|
|
113
|
+
const stackPattern = /^(macos|linux)-/;
|
|
114
114
|
if (cibuildMeta.stack !== 'local' && !stackPattern.test(cibuildMeta.stack)) {
|
|
115
|
-
throw new YAMLValidationError(`Invalid stack '${cibuildMeta.stack}' in ${filePath}. Stack must be 'local' or start with 'macos-'
|
|
115
|
+
throw new YAMLValidationError(`Invalid stack '${cibuildMeta.stack}' in ${filePath}. Stack must be 'local' or start with 'macos-' or 'linux-'`);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
// Validate machine_type if specified
|
|
@@ -20,7 +20,7 @@ export declare class PlatformDetector {
|
|
|
20
20
|
* Priority 2: meta.platform
|
|
21
21
|
* Priority 3: auto-detect from workflow steps
|
|
22
22
|
*
|
|
23
|
-
* @returns Detected platform ('macos'
|
|
23
|
+
* @returns Detected platform ('macos' or 'linux')
|
|
24
24
|
* @throws PlatformDetectionError if detection fails or mixed platforms detected
|
|
25
25
|
*/
|
|
26
26
|
getPlatform(): Platform;
|
|
@@ -29,7 +29,7 @@ export class PlatformDetector {
|
|
|
29
29
|
* Priority 2: meta.platform
|
|
30
30
|
* Priority 3: auto-detect from workflow steps
|
|
31
31
|
*
|
|
32
|
-
* @returns Detected platform ('macos'
|
|
32
|
+
* @returns Detected platform ('macos' or 'linux')
|
|
33
33
|
* @throws PlatformDetectionError if detection fails or mixed platforms detected
|
|
34
34
|
*/
|
|
35
35
|
getPlatform() {
|
|
@@ -84,7 +84,7 @@ export class PlatformDetector {
|
|
|
84
84
|
return null;
|
|
85
85
|
}
|
|
86
86
|
const platformPrefix = parts[0];
|
|
87
|
-
if (platformPrefix === 'macos' || platformPrefix === 'linux'
|
|
87
|
+
if (platformPrefix === 'macos' || platformPrefix === 'linux') {
|
|
88
88
|
return platformPrefix;
|
|
89
89
|
}
|
|
90
90
|
return null;
|
|
@@ -45,25 +45,6 @@ describe('PlatformDetector', () => {
|
|
|
45
45
|
expect(detector.getStack()).toBe('linux-docker-android-22.04');
|
|
46
46
|
expect(detector.getMachineType()).toBe('standard');
|
|
47
47
|
});
|
|
48
|
-
test('should detect windows from stack', () => {
|
|
49
|
-
const pipeline = {
|
|
50
|
-
format_version: '4',
|
|
51
|
-
meta: {
|
|
52
|
-
'cibuild.io': {
|
|
53
|
-
stack: 'windows-server-2022',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
workflows: {
|
|
57
|
-
primary: {
|
|
58
|
-
steps: [{ 'script@1.0.0': { inputs: { content: 'echo "test"' } } }],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
const detector = new PlatformDetector(pipeline, pipeline.workflows.primary, 'primary');
|
|
63
|
-
expect(detector.getPlatform()).toBe('windows');
|
|
64
|
-
expect(detector.getStack()).toBe('windows-server-2022');
|
|
65
|
-
expect(detector.getMachineType()).toBeNull();
|
|
66
|
-
});
|
|
67
48
|
});
|
|
68
49
|
describe('Priority 2: Use meta.platform field', () => {
|
|
69
50
|
test('should use meta.platform when stack not specified', () => {
|
package/dist/src/yaml/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TypeScript interfaces for Bitrise-compatible YAML pipeline structure
|
|
3
3
|
*/
|
|
4
|
-
export type Platform = 'macos' | 'linux'
|
|
4
|
+
export type Platform = 'macos' | 'linux';
|
|
5
5
|
export type MachineType = 'standard' | 'performance';
|
|
6
6
|
export interface YAMLEnvVar {
|
|
7
7
|
[key: string]: string;
|
|
@@ -10,7 +10,7 @@ export interface YAMLCIBuildMeta {
|
|
|
10
10
|
stack?: string;
|
|
11
11
|
machine_type?: MachineType;
|
|
12
12
|
machine_type_id?: string;
|
|
13
|
-
platform?: 'ios' | 'android';
|
|
13
|
+
platform?: 'ios' | 'android' | 'kmm';
|
|
14
14
|
}
|
|
15
15
|
export interface YAMLMeta {
|
|
16
16
|
'cibuild.io'?: YAMLCIBuildMeta;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/yaml/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/yaml/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AACzC,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,aAAa,CAAC;AAGrD,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;CACtC;AAED,MAAM,WAAW,QAAQ;IACvB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAGD,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAGD,MAAM,WAAW,QAAQ;IACvB,CAAC,mBAAmB,EAAE,MAAM,GAAG;QAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,cAAc,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,OAAO,CAAC;QACxB,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;CACH;AAGD,M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