@invarn/cibuild 1.3.16 → 1.3.18
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.d.ts +3 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +987 -0
- package/dist/src/commands/android-scanner.d.ts +32 -0
- package/dist/src/commands/android-scanner.d.ts.map +1 -0
- package/dist/src/commands/android-scanner.js +667 -0
- package/dist/src/commands/build.d.ts +5 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +1096 -0
- package/dist/src/commands/edit.d.ts +3 -0
- package/dist/src/commands/edit.d.ts.map +1 -0
- package/dist/src/commands/edit.js +651 -0
- package/dist/src/commands/file-secret-collector.d.ts +37 -0
- package/dist/src/commands/file-secret-collector.d.ts.map +1 -0
- package/dist/src/commands/file-secret-collector.js +199 -0
- package/dist/src/commands/github-workflow.d.ts +5 -0
- package/dist/src/commands/github-workflow.d.ts.map +1 -0
- package/dist/src/commands/github-workflow.js +45 -0
- package/dist/src/commands/ios-scanner.d.ts +27 -0
- package/dist/src/commands/ios-scanner.d.ts.map +1 -0
- package/dist/src/commands/ios-scanner.js +337 -0
- package/dist/src/commands/reset.d.ts +7 -0
- package/dist/src/commands/reset.d.ts.map +1 -0
- package/dist/src/commands/reset.js +81 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts +15 -0
- package/dist/src/commands/secrets-sync-workflow.d.ts.map +1 -0
- package/dist/src/commands/secrets-sync-workflow.js +255 -0
- package/dist/src/commands/secrets-upload.d.ts +21 -0
- package/dist/src/commands/secrets-upload.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.js +177 -0
- package/dist/src/commands/secrets-upload.test.d.ts +5 -0
- package/dist/src/commands/secrets-upload.test.d.ts.map +1 -0
- package/dist/src/commands/secrets-upload.test.js +60 -0
- package/dist/src/config.d.ts +3 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/config.js +47 -0
- package/dist/src/envman/cli.d.ts +21 -0
- package/dist/src/envman/cli.d.ts.map +1 -0
- package/dist/src/envman/cli.js +240 -0
- package/dist/src/envman/envman.d.ts +83 -0
- package/dist/src/envman/envman.d.ts.map +1 -0
- package/dist/src/envman/envman.js +361 -0
- package/dist/src/envman/envman.test.d.ts +5 -0
- package/dist/src/envman/envman.test.d.ts.map +1 -0
- package/dist/src/envman/envman.test.js +236 -0
- package/dist/src/envman/index.d.ts +23 -0
- package/dist/src/envman/index.d.ts.map +1 -0
- package/dist/src/envman/index.js +23 -0
- package/dist/src/envman/types.d.ts +55 -0
- package/dist/src/envman/types.d.ts.map +1 -0
- package/dist/src/envman/types.js +12 -0
- package/dist/src/lib.d.ts +27 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +32 -0
- package/dist/src/pipeline.d.ts +3 -0
- package/dist/src/pipeline.d.ts.map +1 -0
- package/dist/src/pipeline.js +57 -0
- package/dist/src/runner.d.ts +17 -0
- package/dist/src/runner.d.ts.map +1 -0
- package/dist/src/runner.js +234 -0
- package/dist/src/types.d.ts +58 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/yaml/bitrise-compat.d.ts +65 -0
- package/dist/src/yaml/bitrise-compat.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.js +206 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts +5 -0
- package/dist/src/yaml/bitrise-compat.test.d.ts.map +1 -0
- package/dist/src/yaml/bitrise-compat.test.js +347 -0
- package/dist/src/yaml/converter.d.ts +33 -0
- package/dist/src/yaml/converter.d.ts.map +1 -0
- package/dist/src/yaml/converter.js +222 -0
- package/dist/src/yaml/converter.test.d.ts +5 -0
- package/dist/src/yaml/converter.test.d.ts.map +1 -0
- package/dist/src/yaml/converter.test.js +348 -0
- package/dist/src/yaml/e2e.test.d.ts +6 -0
- package/dist/src/yaml/e2e.test.d.ts.map +1 -0
- package/dist/src/yaml/e2e.test.js +446 -0
- package/dist/src/yaml/env-resolver.d.ts +120 -0
- package/dist/src/yaml/env-resolver.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.js +405 -0
- package/dist/src/yaml/env-resolver.test.d.ts +5 -0
- package/dist/src/yaml/env-resolver.test.d.ts.map +1 -0
- package/dist/src/yaml/env-resolver.test.js +502 -0
- package/dist/src/yaml/interactive-prompts.d.ts +71 -0
- package/dist/src/yaml/interactive-prompts.d.ts.map +1 -0
- package/dist/src/yaml/interactive-prompts.js +258 -0
- package/dist/src/yaml/missing-env-handler.d.ts +45 -0
- package/dist/src/yaml/missing-env-handler.d.ts.map +1 -0
- package/dist/src/yaml/missing-env-handler.js +64 -0
- package/dist/src/yaml/parser.d.ts +33 -0
- package/dist/src/yaml/parser.d.ts.map +1 -0
- package/dist/src/yaml/parser.js +145 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts +25 -0
- package/dist/src/yaml/pipeline-with-secrets.d.ts.map +1 -0
- package/dist/src/yaml/pipeline-with-secrets.js +76 -0
- package/dist/src/yaml/platform-detector.d.ts +83 -0
- package/dist/src/yaml/platform-detector.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.js +188 -0
- package/dist/src/yaml/platform-detector.test.d.ts +5 -0
- package/dist/src/yaml/platform-detector.test.d.ts.map +1 -0
- package/dist/src/yaml/platform-detector.test.js +414 -0
- package/dist/src/yaml/preflight-validation.d.ts +40 -0
- package/dist/src/yaml/preflight-validation.d.ts.map +1 -0
- package/dist/src/yaml/preflight-validation.js +152 -0
- package/dist/src/yaml/secrets-manager.d.ts +77 -0
- package/dist/src/yaml/secrets-manager.d.ts.map +1 -0
- package/dist/src/yaml/secrets-manager.js +219 -0
- package/dist/src/yaml/step-validator.d.ts +54 -0
- package/dist/src/yaml/step-validator.d.ts.map +1 -0
- package/dist/src/yaml/step-validator.js +403 -0
- package/dist/src/yaml/steps/android-sign.d.ts +35 -0
- package/dist/src/yaml/steps/android-sign.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-sign.js +147 -0
- package/dist/src/yaml/steps/android-version.d.ts +26 -0
- package/dist/src/yaml/steps/android-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.js +128 -0
- package/dist/src/yaml/steps/android-version.test.d.ts +5 -0
- package/dist/src/yaml/steps/android-version.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/android-version.test.js +196 -0
- package/dist/src/yaml/steps/android.d.ts +95 -0
- package/dist/src/yaml/steps/android.d.ts.map +1 -0
- package/dist/src/yaml/steps/android.js +916 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts +48 -0
- package/dist/src/yaml/steps/app-store-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/app-store-deploy.js +162 -0
- package/dist/src/yaml/steps/base.d.ts +238 -0
- package/dist/src/yaml/steps/base.d.ts.map +1 -0
- package/dist/src/yaml/steps/base.js +345 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts +26 -0
- package/dist/src/yaml/steps/bitrise-android-tools.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.js +198 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-android-tools.test.js +280 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts +22 -0
- package/dist/src/yaml/steps/bitrise-apk-info.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.js +144 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-apk-info.test.js +331 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts +49 -0
- package/dist/src/yaml/steps/bitrise-slack.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.js +280 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-slack.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-slack.test.js +484 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts +27 -0
- package/dist/src/yaml/steps/bitrise-ssh.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.js +134 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts +5 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/bitrise-ssh.test.js +205 -0
- package/dist/src/yaml/steps/cache.d.ts +52 -0
- package/dist/src/yaml/steps/cache.d.ts.map +1 -0
- package/dist/src/yaml/steps/cache.js +352 -0
- package/dist/src/yaml/steps/fastlane.d.ts +27 -0
- package/dist/src/yaml/steps/fastlane.d.ts.map +1 -0
- package/dist/src/yaml/steps/fastlane.js +79 -0
- package/dist/src/yaml/steps/file.d.ts +27 -0
- package/dist/src/yaml/steps/file.d.ts.map +1 -0
- package/dist/src/yaml/steps/file.js +35 -0
- package/dist/src/yaml/steps/flutter.d.ts +63 -0
- package/dist/src/yaml/steps/flutter.d.ts.map +1 -0
- package/dist/src/yaml/steps/flutter.js +215 -0
- package/dist/src/yaml/steps/git-clone.d.ts +26 -0
- package/dist/src/yaml/steps/git-clone.d.ts.map +1 -0
- package/dist/src/yaml/steps/git-clone.js +111 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts +37 -0
- package/dist/src/yaml/steps/google-play-deploy.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.js +193 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts +5 -0
- package/dist/src/yaml/steps/google-play-deploy.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/google-play-deploy.test.js +310 -0
- package/dist/src/yaml/steps/index.d.ts +10 -0
- package/dist/src/yaml/steps/index.d.ts.map +1 -0
- package/dist/src/yaml/steps/index.js +1361 -0
- package/dist/src/yaml/steps/ios-deps.d.ts +43 -0
- package/dist/src/yaml/steps/ios-deps.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.js +141 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts +5 -0
- package/dist/src/yaml/steps/ios-deps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-deps.test.js +90 -0
- package/dist/src/yaml/steps/ios-signing.d.ts +31 -0
- package/dist/src/yaml/steps/ios-signing.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-signing.js +144 -0
- package/dist/src/yaml/steps/ios-version.d.ts +47 -0
- package/dist/src/yaml/steps/ios-version.d.ts.map +1 -0
- package/dist/src/yaml/steps/ios-version.js +151 -0
- package/dist/src/yaml/steps/linting.d.ts +47 -0
- package/dist/src/yaml/steps/linting.d.ts.map +1 -0
- package/dist/src/yaml/steps/linting.js +148 -0
- package/dist/src/yaml/steps/phase2.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase2.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase2.test.js +197 -0
- package/dist/src/yaml/steps/phase3.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase3.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase3.test.js +144 -0
- package/dist/src/yaml/steps/phase4.test.d.ts +5 -0
- package/dist/src/yaml/steps/phase4.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase4.test.js +166 -0
- package/dist/src/yaml/steps/phase5.test.d.ts +6 -0
- package/dist/src/yaml/steps/phase5.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/phase5.test.js +263 -0
- package/dist/src/yaml/steps/registry.d.ts +88 -0
- package/dist/src/yaml/steps/registry.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.js +125 -0
- package/dist/src/yaml/steps/registry.test.d.ts +5 -0
- package/dist/src/yaml/steps/registry.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/registry.test.js +235 -0
- package/dist/src/yaml/steps/release.d.ts +50 -0
- package/dist/src/yaml/steps/release.d.ts.map +1 -0
- package/dist/src/yaml/steps/release.js +154 -0
- package/dist/src/yaml/steps/script.d.ts +23 -0
- package/dist/src/yaml/steps/script.d.ts.map +1 -0
- package/dist/src/yaml/steps/script.js +63 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts +6 -0
- package/dist/src/yaml/steps/spec-validation.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/spec-validation.test.js +130 -0
- package/dist/src/yaml/steps/steps.test.d.ts +6 -0
- package/dist/src/yaml/steps/steps.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/steps.test.js +505 -0
- package/dist/src/yaml/steps/test-config.d.ts +3 -0
- package/dist/src/yaml/steps/test-config.d.ts.map +1 -0
- package/dist/src/yaml/steps/test-config.js +17 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts +5 -0
- package/dist/src/yaml/steps/xcode-new.test.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode-new.test.js +211 -0
- package/dist/src/yaml/steps/xcode.d.ts +222 -0
- package/dist/src/yaml/steps/xcode.d.ts.map +1 -0
- package/dist/src/yaml/steps/xcode.js +999 -0
- package/dist/src/yaml/types.d.ts +68 -0
- package/dist/src/yaml/types.d.ts.map +1 -0
- package/dist/src/yaml/types.js +5 -0
- package/dist/src/yaml/validation-types.d.ts +96 -0
- package/dist/src/yaml/validation-types.d.ts.map +1 -0
- package/dist/src/yaml/validation-types.js +8 -0
- package/dist/src/yaml/yaml-updater.d.ts +24 -0
- package/dist/src/yaml/yaml-updater.d.ts.map +1 -0
- package/dist/src/yaml/yaml-updater.js +128 -0
- package/package.json +16 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fastlane step: run a fastlane lane
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Runs a fastlane lane with Gemfile detection and optional gem update.
|
|
7
|
+
*/
|
|
8
|
+
export class FastlaneStepExecutor extends BaseStepExecutor {
|
|
9
|
+
getValidationRequirements(_inputs, _env, _config) {
|
|
10
|
+
return [
|
|
11
|
+
this.requireCommand('fastlane', 'fastlane is required (install via gem install fastlane or Bundler)'),
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
getOutputs() {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
async execute(inputs, _env, _config) {
|
|
18
|
+
const stepName = 'fastlane';
|
|
19
|
+
const lane = this.getRequiredInput(inputs, 'lane', stepName);
|
|
20
|
+
const workDir = this.getInput(inputs, 'work_dir', '');
|
|
21
|
+
const updateFastlane = this.getInput(inputs, 'update_fastlane', 'true') === 'true';
|
|
22
|
+
const verboseLog = ['yes', 'true'].includes(this.getInput(inputs, 'verbose_log', 'no'));
|
|
23
|
+
const enableCache = ['yes', 'true'].includes(this.getInput(inputs, 'enable_cache', 'yes'));
|
|
24
|
+
const commands = [];
|
|
25
|
+
commands.push('# fastlane — run a fastlane lane');
|
|
26
|
+
commands.push('echo "🚀 Running fastlane..."');
|
|
27
|
+
commands.push('');
|
|
28
|
+
// Change to working directory if specified
|
|
29
|
+
if (workDir) {
|
|
30
|
+
commands.push(`cd '${this.escapeBash(workDir)}'`);
|
|
31
|
+
commands.push('');
|
|
32
|
+
}
|
|
33
|
+
// Detect Gemfile for bundle exec
|
|
34
|
+
commands.push('# Detect Gemfile for bundle exec');
|
|
35
|
+
commands.push('USE_BUNDLE_EXEC="false"');
|
|
36
|
+
commands.push('if [ -f "Gemfile" ] || [ -f "Gemfile.lock" ]; then');
|
|
37
|
+
commands.push(' if grep -q "fastlane" Gemfile.lock 2>/dev/null || grep -q "fastlane" Gemfile 2>/dev/null; then');
|
|
38
|
+
commands.push(' USE_BUNDLE_EXEC="true"');
|
|
39
|
+
commands.push(' echo "Gemfile detected with fastlane — using bundle exec"');
|
|
40
|
+
commands.push(' fi');
|
|
41
|
+
commands.push('fi');
|
|
42
|
+
commands.push('');
|
|
43
|
+
// Optionally update fastlane
|
|
44
|
+
if (updateFastlane) {
|
|
45
|
+
commands.push('# Update fastlane gem (skipped if Gemfile manages it)');
|
|
46
|
+
commands.push('if [ "$USE_BUNDLE_EXEC" = "true" ]; then');
|
|
47
|
+
commands.push(' echo "Gemfile present — running bundle install instead of gem update"');
|
|
48
|
+
commands.push(' bundle install');
|
|
49
|
+
commands.push('else');
|
|
50
|
+
commands.push(' echo "Updating fastlane gem..."');
|
|
51
|
+
commands.push(' gem install fastlane --no-document');
|
|
52
|
+
commands.push('fi');
|
|
53
|
+
commands.push('');
|
|
54
|
+
}
|
|
55
|
+
// Build the fastlane command
|
|
56
|
+
const verboseFlag = verboseLog ? ' --verbose' : '';
|
|
57
|
+
commands.push('# Run fastlane');
|
|
58
|
+
commands.push('if [ "$USE_BUNDLE_EXEC" = "true" ]; then');
|
|
59
|
+
commands.push(` bundle exec fastlane ${this.escapeBash(lane)}${verboseFlag}`);
|
|
60
|
+
commands.push('else');
|
|
61
|
+
commands.push(` fastlane ${this.escapeBash(lane)}${verboseFlag}`);
|
|
62
|
+
commands.push('fi');
|
|
63
|
+
commands.push('');
|
|
64
|
+
// Cache collection
|
|
65
|
+
if (enableCache) {
|
|
66
|
+
commands.push('# Collect cache paths');
|
|
67
|
+
commands.push('if [ -f "Podfile.lock" ]; then');
|
|
68
|
+
commands.push(' echo "Cache: Pods directory detected"');
|
|
69
|
+
commands.push('fi');
|
|
70
|
+
commands.push('if [ -f "Cartfile.resolved" ]; then');
|
|
71
|
+
commands.push(' echo "Cache: Carthage directory detected"');
|
|
72
|
+
commands.push('fi');
|
|
73
|
+
}
|
|
74
|
+
commands.push('echo "✅ fastlane lane complete"');
|
|
75
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
76
|
+
return this.createScriptStep(script, stepName);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=fastlane.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BaseStepExecutor } from './base.js';
|
|
2
|
+
import type { StepDef, CIConfig } from '../../types.js';
|
|
3
|
+
export interface FileInputs {
|
|
4
|
+
/** Path where the file should be written, relative to the project root. */
|
|
5
|
+
target_path: string;
|
|
6
|
+
/** Name of the env var that holds the file content (resolved from secrets). */
|
|
7
|
+
var_name: string;
|
|
8
|
+
/**
|
|
9
|
+
* When true, the secret value is already base64-encoded binary (e.g. KEYSTORE_BASE64).
|
|
10
|
+
* The content is embedded as-is without re-encoding, so the runtime script decodes
|
|
11
|
+
* it once with `base64 -d` to recover the original binary.
|
|
12
|
+
*/
|
|
13
|
+
base64_encoded?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Writes a file to a target path at runtime.
|
|
17
|
+
*
|
|
18
|
+
* The file content is stored in .cibuild-secrets.json and loaded by EnvResolver
|
|
19
|
+
* into the `env` map before execute() is called. We base64-encode the value
|
|
20
|
+
* and embed it into the generated script, then decode at runtime with `base64 -d`.
|
|
21
|
+
* Base64 output contains only [A-Za-z0-9+/=] so it is safe to embed in any shell
|
|
22
|
+
* quoting context regardless of the original content (JSON, certificates, etc.).
|
|
23
|
+
*/
|
|
24
|
+
export declare class FileStepExecutor extends BaseStepExecutor {
|
|
25
|
+
execute(inputs: FileInputs, env: Record<string, string>, _config: CIConfig): Promise<StepDef>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/file.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAExD,MAAM,WAAW,UAAU;IACzB,2EAA2E;IAC3E,WAAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,gBAAgB;IAC9C,OAAO,CACX,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,OAAO,EAAE,QAAQ,GAChB,OAAO,CAAC,OAAO,CAAC;CA4BpB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { BaseStepExecutor } from './base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Writes a file to a target path at runtime.
|
|
5
|
+
*
|
|
6
|
+
* The file content is stored in .cibuild-secrets.json and loaded by EnvResolver
|
|
7
|
+
* into the `env` map before execute() is called. We base64-encode the value
|
|
8
|
+
* and embed it into the generated script, then decode at runtime with `base64 -d`.
|
|
9
|
+
* Base64 output contains only [A-Za-z0-9+/=] so it is safe to embed in any shell
|
|
10
|
+
* quoting context regardless of the original content (JSON, certificates, etc.).
|
|
11
|
+
*/
|
|
12
|
+
export class FileStepExecutor extends BaseStepExecutor {
|
|
13
|
+
async execute(inputs, env, _config) {
|
|
14
|
+
const targetPath = this.getRequiredInput(inputs, 'target_path', 'file');
|
|
15
|
+
const varName = this.getRequiredInput(inputs, 'var_name', 'file');
|
|
16
|
+
const filename = basename(targetPath);
|
|
17
|
+
const content = env[varName];
|
|
18
|
+
if (!content) {
|
|
19
|
+
return this.createScriptStep(`echo "⚠️ ${varName} not set — skipping ${filename}"`, 'file');
|
|
20
|
+
}
|
|
21
|
+
// Base64-encode the content so it can be embedded safely in the script
|
|
22
|
+
// regardless of quotes, newlines, dollar signs, or any other special characters.
|
|
23
|
+
// base64 output contains only [A-Za-z0-9+/=] which is safe in any shell context.
|
|
24
|
+
// When base64_encoded is true the secret is already base64 binary — skip re-encoding.
|
|
25
|
+
const encoded = inputs.base64_encoded
|
|
26
|
+
? content
|
|
27
|
+
: Buffer.from(content).toString('base64');
|
|
28
|
+
const scriptContent = `\
|
|
29
|
+
mkdir -p "$(dirname "\${CIBUILD_SOURCE_DIR:-$PWD}/${targetPath}")"
|
|
30
|
+
printf '%s' '${encoded}' | base64 -d > "\${CIBUILD_SOURCE_DIR:-$PWD}/${targetPath}"
|
|
31
|
+
echo "✓ Written ${filename}"`;
|
|
32
|
+
return this.createScriptStep(this.createBashScript(scriptContent, 'file'), 'file');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flutter steps: flutter-installer, flutter-build, flutter-test
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
import type { StepDef, CIConfig } from '../../types.js';
|
|
6
|
+
import type { ValidationRequirement, StepOutput } from '../validation-types.js';
|
|
7
|
+
export interface FlutterInstallerInputs {
|
|
8
|
+
/** Flutter SDK version or channel (stable, beta, master, or specific version) */
|
|
9
|
+
version?: string;
|
|
10
|
+
/** Installation path for the Flutter SDK */
|
|
11
|
+
installation_path?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Installs or activates a specific Flutter SDK version.
|
|
15
|
+
*/
|
|
16
|
+
export declare class FlutterInstallerStepExecutor extends BaseStepExecutor {
|
|
17
|
+
getValidationRequirements(_inputs: FlutterInstallerInputs, _env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
18
|
+
getOutputs(): StepOutput[];
|
|
19
|
+
execute(inputs: FlutterInstallerInputs, _env: Record<string, string>, _config: CIConfig): Promise<StepDef>;
|
|
20
|
+
}
|
|
21
|
+
export interface FlutterBuildInputs {
|
|
22
|
+
/** Root directory of the Flutter project */
|
|
23
|
+
project_location?: string;
|
|
24
|
+
/** Platform to build: ios | android | both */
|
|
25
|
+
platform?: string;
|
|
26
|
+
/** Additional flutter build parameters */
|
|
27
|
+
additional_build_params?: string;
|
|
28
|
+
/** iOS output type: app | archive */
|
|
29
|
+
ios_output_type?: string;
|
|
30
|
+
/** Android output type: apk | appbundle */
|
|
31
|
+
android_output_type?: string;
|
|
32
|
+
/** Additional iOS build params */
|
|
33
|
+
ios_additional_params?: string;
|
|
34
|
+
/** Additional Android build params */
|
|
35
|
+
android_additional_params?: string;
|
|
36
|
+
/** Enable debug mode (true/false) */
|
|
37
|
+
is_debug_mode?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Builds a Flutter project for iOS and/or Android.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FlutterBuildStepExecutor extends BaseStepExecutor {
|
|
43
|
+
getValidationRequirements(_inputs: FlutterBuildInputs, _env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
44
|
+
getOutputs(): StepOutput[];
|
|
45
|
+
execute(inputs: FlutterBuildInputs, _env: Record<string, string>, _config: CIConfig): Promise<StepDef>;
|
|
46
|
+
}
|
|
47
|
+
export interface FlutterTestInputs {
|
|
48
|
+
/** Root directory of the Flutter project */
|
|
49
|
+
project_location?: string;
|
|
50
|
+
/** Additional flutter test parameters */
|
|
51
|
+
additional_params?: string;
|
|
52
|
+
/** Enable coverage collection (true/false) */
|
|
53
|
+
generate_code_coverage_files?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Runs flutter test with optional coverage.
|
|
57
|
+
*/
|
|
58
|
+
export declare class FlutterTestStepExecutor extends BaseStepExecutor {
|
|
59
|
+
getValidationRequirements(_inputs: FlutterTestInputs, _env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
60
|
+
getOutputs(): StepOutput[];
|
|
61
|
+
execute(inputs: FlutterTestInputs, _env: Record<string, string>, _config: CIConfig): Promise<StepDef>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=flutter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flutter.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/flutter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMhF,MAAM,WAAW,sBAAsB;IACrC,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4CAA4C;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,gBAAgB;IAChE,yBAAyB,CACvB,OAAO,EAAE,sBAAsB,EAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAI1B,UAAU,IAAI,UAAU,EAAE;IAMpB,OAAO,CAAC,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CA2DjH;AAMD,MAAM,WAAW,kBAAkB;IACjC,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,qCAAqC;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,sCAAsC;IACtC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,gBAAgB;IAC5D,yBAAyB,CACvB,OAAO,EAAE,kBAAkB,EAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAM1B,UAAU,IAAI,UAAU,EAAE;IAQpB,OAAO,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAyF7G;AAMD,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8CAA8C;IAC9C,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,gBAAgB;IAC3D,yBAAyB,CACvB,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAM1B,UAAU,IAAI,UAAU,EAAE;IAMpB,OAAO,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAgD5G"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flutter steps: flutter-installer, flutter-build, flutter-test
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Installs or activates a specific Flutter SDK version.
|
|
7
|
+
*/
|
|
8
|
+
export class FlutterInstallerStepExecutor extends BaseStepExecutor {
|
|
9
|
+
getValidationRequirements(_inputs, _env, _config) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
getOutputs() {
|
|
13
|
+
return [
|
|
14
|
+
{ name: 'CIBUILD_FLUTTER_SDK_PATH', type: 'environment', description: 'Path to the installed Flutter SDK' },
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
async execute(inputs, _env, _config) {
|
|
18
|
+
const stepName = 'flutter-installer';
|
|
19
|
+
const version = this.getInput(inputs, 'version', 'stable');
|
|
20
|
+
const installPath = this.getInput(inputs, 'installation_path', '$HOME/flutter');
|
|
21
|
+
const commands = [];
|
|
22
|
+
commands.push('# flutter-installer — install or activate Flutter SDK');
|
|
23
|
+
commands.push('echo "🐦 Installing Flutter SDK..."');
|
|
24
|
+
commands.push('');
|
|
25
|
+
commands.push(`FLUTTER_VERSION='${this.escapeBash(version)}'`);
|
|
26
|
+
commands.push(`INSTALL_PATH='${this.escapeBash(installPath)}'`);
|
|
27
|
+
commands.push('');
|
|
28
|
+
// Check if Flutter is already installed at the path
|
|
29
|
+
commands.push('if [ -d "$INSTALL_PATH" ] && [ -x "$INSTALL_PATH/bin/flutter" ]; then');
|
|
30
|
+
commands.push(' echo "Flutter SDK found at $INSTALL_PATH"');
|
|
31
|
+
commands.push(' CURRENT_VERSION=$("$INSTALL_PATH/bin/flutter" --version 2>/dev/null | head -1 || echo "unknown")');
|
|
32
|
+
commands.push(' echo "Current version: $CURRENT_VERSION"');
|
|
33
|
+
commands.push('else');
|
|
34
|
+
commands.push(' echo "Installing Flutter SDK to $INSTALL_PATH..."');
|
|
35
|
+
commands.push(' git clone https://github.com/flutter/flutter.git -b "$FLUTTER_VERSION" "$INSTALL_PATH" 2>/dev/null || {');
|
|
36
|
+
commands.push(' echo "Channel clone failed, trying as version tag..."');
|
|
37
|
+
commands.push(' git clone https://github.com/flutter/flutter.git "$INSTALL_PATH"');
|
|
38
|
+
commands.push(' cd "$INSTALL_PATH" && git checkout "$FLUTTER_VERSION" && cd -');
|
|
39
|
+
commands.push(' }');
|
|
40
|
+
commands.push('fi');
|
|
41
|
+
commands.push('');
|
|
42
|
+
// Add to PATH
|
|
43
|
+
commands.push('# Add Flutter to PATH');
|
|
44
|
+
commands.push('export PATH="$INSTALL_PATH/bin:$INSTALL_PATH/bin/cache/dart-sdk/bin:$PATH"');
|
|
45
|
+
commands.push('envman add --key PATH --value "$INSTALL_PATH/bin:$INSTALL_PATH/bin/cache/dart-sdk/bin:$PATH"');
|
|
46
|
+
commands.push('');
|
|
47
|
+
// Switch channel/version if needed
|
|
48
|
+
commands.push('# Switch to requested version/channel');
|
|
49
|
+
commands.push('case "$FLUTTER_VERSION" in');
|
|
50
|
+
commands.push(' stable|beta|master|dev)');
|
|
51
|
+
commands.push(' flutter channel "$FLUTTER_VERSION"');
|
|
52
|
+
commands.push(' flutter upgrade');
|
|
53
|
+
commands.push(' ;;');
|
|
54
|
+
commands.push('esac');
|
|
55
|
+
commands.push('');
|
|
56
|
+
// Pre-cache and doctor
|
|
57
|
+
commands.push('flutter precache');
|
|
58
|
+
commands.push('flutter doctor -v');
|
|
59
|
+
commands.push('');
|
|
60
|
+
// Export SDK path
|
|
61
|
+
commands.push('envman add --key CIBUILD_FLUTTER_SDK_PATH --value "$INSTALL_PATH"');
|
|
62
|
+
commands.push('echo "✅ Flutter SDK ready: $(flutter --version | head -1)"');
|
|
63
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
64
|
+
return this.createScriptStep(script, stepName);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Builds a Flutter project for iOS and/or Android.
|
|
69
|
+
*/
|
|
70
|
+
export class FlutterBuildStepExecutor extends BaseStepExecutor {
|
|
71
|
+
getValidationRequirements(_inputs, _env, _config) {
|
|
72
|
+
return [
|
|
73
|
+
this.requireCommand('flutter', 'Flutter SDK is required (use flutter-installer step)'),
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
getOutputs() {
|
|
77
|
+
return [
|
|
78
|
+
{ name: 'CIBUILD_APK_PATH', type: 'environment', description: 'Path to the built APK' },
|
|
79
|
+
{ name: 'CIBUILD_AAB_PATH', type: 'environment', description: 'Path to the built AAB' },
|
|
80
|
+
{ name: 'CIBUILD_APP_DIR_PATH', type: 'environment', description: 'Path to the built .app directory' },
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
async execute(inputs, _env, _config) {
|
|
84
|
+
const stepName = 'flutter-build';
|
|
85
|
+
const projectLocation = this.getInput(inputs, 'project_location', '.');
|
|
86
|
+
const platform = this.getInput(inputs, 'platform', 'both');
|
|
87
|
+
const additionalParams = this.getInput(inputs, 'additional_build_params', '');
|
|
88
|
+
const iosOutputType = this.getInput(inputs, 'ios_output_type', 'app');
|
|
89
|
+
const androidOutputType = this.getInput(inputs, 'android_output_type', 'apk');
|
|
90
|
+
const iosParams = this.getInput(inputs, 'ios_additional_params', '--release');
|
|
91
|
+
const androidParams = this.getInput(inputs, 'android_additional_params', '--release');
|
|
92
|
+
const debug = this.getInput(inputs, 'is_debug_mode', 'false') === 'true';
|
|
93
|
+
const commands = [];
|
|
94
|
+
commands.push('# flutter-build — build Flutter project');
|
|
95
|
+
commands.push('echo "🔨 Building Flutter project..."');
|
|
96
|
+
commands.push('');
|
|
97
|
+
commands.push(`cd '${this.escapeBash(projectLocation)}'`);
|
|
98
|
+
commands.push('');
|
|
99
|
+
// Fetch dependencies
|
|
100
|
+
commands.push('flutter pub get');
|
|
101
|
+
commands.push('');
|
|
102
|
+
if (debug) {
|
|
103
|
+
commands.push('set -x');
|
|
104
|
+
commands.push('');
|
|
105
|
+
}
|
|
106
|
+
const commonParams = additionalParams ? ` ${additionalParams}` : '';
|
|
107
|
+
// iOS build
|
|
108
|
+
if (platform === 'ios' || platform === 'both') {
|
|
109
|
+
commands.push('# Build iOS');
|
|
110
|
+
const iosCmd = iosOutputType === 'archive' ? 'ipa' : 'ios';
|
|
111
|
+
const iosFlags = iosParams ? ` ${iosParams}` : '';
|
|
112
|
+
commands.push(`echo "Building iOS (${iosCmd})..."`);
|
|
113
|
+
commands.push(`flutter build ${iosCmd}${iosFlags}${commonParams} --no-codesign`);
|
|
114
|
+
commands.push('');
|
|
115
|
+
// Find output
|
|
116
|
+
if (iosOutputType === 'archive') {
|
|
117
|
+
commands.push('XCARCHIVE=$(find build/ios/archive -name "*.xcarchive" 2>/dev/null | head -1)');
|
|
118
|
+
commands.push('if [ -n "$XCARCHIVE" ]; then');
|
|
119
|
+
commands.push(' envman add --key CIBUILD_XCARCHIVE_PATH --value "$XCARCHIVE"');
|
|
120
|
+
commands.push(' echo "iOS archive: $XCARCHIVE"');
|
|
121
|
+
commands.push('fi');
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
commands.push('APP_DIR=$(find build/ios/iphoneos -name "*.app" 2>/dev/null | head -1)');
|
|
125
|
+
commands.push('if [ -n "$APP_DIR" ]; then');
|
|
126
|
+
commands.push(' envman add --key CIBUILD_APP_DIR_PATH --value "$APP_DIR"');
|
|
127
|
+
commands.push(' echo "iOS app: $APP_DIR"');
|
|
128
|
+
commands.push('fi');
|
|
129
|
+
}
|
|
130
|
+
commands.push('');
|
|
131
|
+
}
|
|
132
|
+
// Android build
|
|
133
|
+
if (platform === 'android' || platform === 'both') {
|
|
134
|
+
commands.push('# Build Android');
|
|
135
|
+
const androidCmd = androidOutputType === 'appbundle' ? 'appbundle' : 'apk';
|
|
136
|
+
const androidFlags = androidParams ? ` ${androidParams}` : '';
|
|
137
|
+
commands.push(`echo "Building Android (${androidCmd})..."`);
|
|
138
|
+
commands.push(`flutter build ${androidCmd}${androidFlags}${commonParams}`);
|
|
139
|
+
commands.push('');
|
|
140
|
+
// Find output
|
|
141
|
+
if (androidOutputType === 'appbundle') {
|
|
142
|
+
commands.push('AAB_PATH=$(find build/app/outputs/bundle -name "*.aab" 2>/dev/null | head -1)');
|
|
143
|
+
commands.push('if [ -n "$AAB_PATH" ]; then');
|
|
144
|
+
commands.push(' envman add --key CIBUILD_AAB_PATH --value "$AAB_PATH"');
|
|
145
|
+
commands.push(' echo "Android AAB: $AAB_PATH"');
|
|
146
|
+
commands.push('fi');
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
commands.push('APK_PATH=$(find build/app/outputs/apk -name "*.apk" 2>/dev/null | head -1)');
|
|
150
|
+
commands.push('if [ -n "$APK_PATH" ]; then');
|
|
151
|
+
commands.push(' envman add --key CIBUILD_APK_PATH --value "$APK_PATH"');
|
|
152
|
+
commands.push(' echo "Android APK: $APK_PATH"');
|
|
153
|
+
commands.push('fi');
|
|
154
|
+
}
|
|
155
|
+
commands.push('');
|
|
156
|
+
}
|
|
157
|
+
commands.push('echo "✅ Flutter build complete"');
|
|
158
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
159
|
+
return this.createScriptStep(script, stepName);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Runs flutter test with optional coverage.
|
|
164
|
+
*/
|
|
165
|
+
export class FlutterTestStepExecutor extends BaseStepExecutor {
|
|
166
|
+
getValidationRequirements(_inputs, _env, _config) {
|
|
167
|
+
return [
|
|
168
|
+
this.requireCommand('flutter', 'Flutter SDK is required (use flutter-installer step)'),
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
getOutputs() {
|
|
172
|
+
return [
|
|
173
|
+
{ name: 'CIBUILD_FLUTTER_COVERAGE_PATH', type: 'environment', description: 'Path to lcov.info coverage file' },
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
async execute(inputs, _env, _config) {
|
|
177
|
+
const stepName = 'flutter-test';
|
|
178
|
+
const projectLocation = this.getInput(inputs, 'project_location', '.');
|
|
179
|
+
const additionalParams = this.getInput(inputs, 'additional_params', '');
|
|
180
|
+
const coverage = this.getInput(inputs, 'generate_code_coverage_files', 'false') === 'true';
|
|
181
|
+
const commands = [];
|
|
182
|
+
commands.push('# flutter-test — run Flutter tests');
|
|
183
|
+
commands.push('echo "🧪 Running Flutter tests..."');
|
|
184
|
+
commands.push('');
|
|
185
|
+
commands.push(`cd '${this.escapeBash(projectLocation)}'`);
|
|
186
|
+
commands.push('');
|
|
187
|
+
commands.push('flutter pub get');
|
|
188
|
+
commands.push('');
|
|
189
|
+
// Build test command
|
|
190
|
+
const flags = [];
|
|
191
|
+
if (coverage) {
|
|
192
|
+
flags.push('--coverage');
|
|
193
|
+
}
|
|
194
|
+
if (additionalParams) {
|
|
195
|
+
flags.push(additionalParams);
|
|
196
|
+
}
|
|
197
|
+
const flagStr = flags.length > 0 ? ` ${flags.join(' ')}` : '';
|
|
198
|
+
commands.push(`flutter test${flagStr}`);
|
|
199
|
+
commands.push('');
|
|
200
|
+
// Export coverage path if generated
|
|
201
|
+
if (coverage) {
|
|
202
|
+
commands.push('# Export coverage file path');
|
|
203
|
+
commands.push('COVERAGE_FILE="coverage/lcov.info"');
|
|
204
|
+
commands.push('if [ -f "$COVERAGE_FILE" ]; then');
|
|
205
|
+
commands.push(' envman add --key CIBUILD_FLUTTER_COVERAGE_PATH --value "$(pwd)/$COVERAGE_FILE"');
|
|
206
|
+
commands.push(' echo "Coverage report: $COVERAGE_FILE"');
|
|
207
|
+
commands.push('fi');
|
|
208
|
+
commands.push('');
|
|
209
|
+
}
|
|
210
|
+
commands.push('echo "✅ Flutter tests passed"');
|
|
211
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
212
|
+
return this.createScriptStep(script, stepName);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=flutter.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git clone step implementation
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
import type { StepDef, CIConfig } from '../../types.js';
|
|
6
|
+
import type { ValidationRequirement, StepOutput } from '../validation-types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Inputs for git-clone step
|
|
9
|
+
*/
|
|
10
|
+
export interface GitCloneInputs {
|
|
11
|
+
repository?: string;
|
|
12
|
+
clone_url?: string;
|
|
13
|
+
branch?: string;
|
|
14
|
+
clone_depth?: number;
|
|
15
|
+
clone_into_dir?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Git clone step executor
|
|
19
|
+
* Clones a git repository with optional branch and depth settings
|
|
20
|
+
*/
|
|
21
|
+
export declare class GitCloneStepExecutor extends BaseStepExecutor {
|
|
22
|
+
getValidationRequirements(_inputs: GitCloneInputs, _env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
23
|
+
getOutputs(): StepOutput[];
|
|
24
|
+
execute(_inputs: GitCloneInputs, _env: Record<string, string>, _config: CIConfig): Promise<StepDef>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=git-clone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-clone.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/git-clone.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,yBAAyB,CACvB,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAU1B,UAAU,IAAI,UAAU,EAAE;IAkDpB,OAAO,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAqD1G"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git clone step implementation
|
|
3
|
+
*/
|
|
4
|
+
import { BaseStepExecutor } from './base.js';
|
|
5
|
+
/**
|
|
6
|
+
* Git clone step executor
|
|
7
|
+
* Clones a git repository with optional branch and depth settings
|
|
8
|
+
*/
|
|
9
|
+
export class GitCloneStepExecutor extends BaseStepExecutor {
|
|
10
|
+
getValidationRequirements(_inputs, _env, _config) {
|
|
11
|
+
return [
|
|
12
|
+
this.requireCommand('git', 'Git is required', 'Install git: brew install git (macOS) or apt install git (Linux)'),
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
getOutputs() {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'CIBUILD_SOURCE_DIR',
|
|
19
|
+
type: 'environment',
|
|
20
|
+
description: 'Path to cloned repository',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'GIT_CLONE_COMMIT_HASH',
|
|
24
|
+
type: 'environment',
|
|
25
|
+
description: 'Commit hash of the cloned repository',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'CIBUILD_GIT_COMMIT',
|
|
29
|
+
type: 'environment',
|
|
30
|
+
description: 'Commit hash of the cloned repository',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'GIT_CLONE_COMMIT_AUTHOR_NAME',
|
|
34
|
+
type: 'environment',
|
|
35
|
+
description: 'Author name of the cloned commit',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'GIT_CLONE_COMMIT_AUTHOR_EMAIL',
|
|
39
|
+
type: 'environment',
|
|
40
|
+
description: 'Author email of the cloned commit',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'GIT_CLONE_COMMIT_COMMITER_NAME',
|
|
44
|
+
type: 'environment',
|
|
45
|
+
description: 'Committer name of the cloned commit',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'GIT_CLONE_COMMIT_COMMITER_EMAIL',
|
|
49
|
+
type: 'environment',
|
|
50
|
+
description: 'Committer email of the cloned commit',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'GIT_CLONE_COMMIT_MESSAGE_SUBJECT',
|
|
54
|
+
type: 'environment',
|
|
55
|
+
description: 'First line of the commit message',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'GIT_CLONE_COMMIT_MESSAGE_BODY',
|
|
59
|
+
type: 'environment',
|
|
60
|
+
description: 'Body of the commit message (everything after first line)',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
}
|
|
64
|
+
async execute(_inputs, _env, _config) {
|
|
65
|
+
const stepName = 'git-clone';
|
|
66
|
+
// The project is already present on the local machine — no cloning needed.
|
|
67
|
+
// Detect the git root of the current project and export it as CIBUILD_SOURCE_DIR
|
|
68
|
+
// so subsequent build steps (gradle, xcodebuild, etc.) can cd into it.
|
|
69
|
+
const commands = [];
|
|
70
|
+
commands.push('# git-clone → using existing local project checkout');
|
|
71
|
+
commands.push('echo "📁 Locating local project..."');
|
|
72
|
+
commands.push('');
|
|
73
|
+
commands.push('GIT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "")"');
|
|
74
|
+
commands.push('if [ -z "$GIT_ROOT" ]; then');
|
|
75
|
+
commands.push(' echo "❌ Error: Not inside a git repository"');
|
|
76
|
+
commands.push(' exit 1');
|
|
77
|
+
commands.push('fi');
|
|
78
|
+
commands.push('');
|
|
79
|
+
commands.push('cd "$GIT_ROOT"');
|
|
80
|
+
commands.push('echo "Project root: $GIT_ROOT"');
|
|
81
|
+
commands.push('');
|
|
82
|
+
commands.push('# Read current commit metadata from the existing checkout');
|
|
83
|
+
commands.push('COMMIT_HASH="$(git rev-parse HEAD)"');
|
|
84
|
+
commands.push('COMMIT_AUTHOR_NAME="$(git log -1 --format="%an")"');
|
|
85
|
+
commands.push('COMMIT_AUTHOR_EMAIL="$(git log -1 --format="%ae")"');
|
|
86
|
+
commands.push('COMMIT_COMMITTER_NAME="$(git log -1 --format="%cn")"');
|
|
87
|
+
commands.push('COMMIT_COMMITTER_EMAIL="$(git log -1 --format="%ce")"');
|
|
88
|
+
commands.push('COMMIT_MESSAGE_SUBJECT="$(git log -1 --format="%s")"');
|
|
89
|
+
commands.push('COMMIT_MESSAGE_BODY="$(git log -1 --format="%b")"');
|
|
90
|
+
commands.push('');
|
|
91
|
+
commands.push('echo "Branch: $(git branch --show-current)"');
|
|
92
|
+
commands.push('echo "Commit: $COMMIT_HASH"');
|
|
93
|
+
commands.push('echo "Author: $COMMIT_AUTHOR_NAME <$COMMIT_AUTHOR_EMAIL>"');
|
|
94
|
+
commands.push('echo "Message: $COMMIT_MESSAGE_SUBJECT"');
|
|
95
|
+
commands.push('');
|
|
96
|
+
commands.push('# Export source directory and commit metadata for subsequent steps');
|
|
97
|
+
commands.push('envman add --key CIBUILD_SOURCE_DIR --value "$GIT_ROOT"');
|
|
98
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_HASH --value "$COMMIT_HASH"');
|
|
99
|
+
commands.push('envman add --key CIBUILD_GIT_COMMIT --value "$COMMIT_HASH"');
|
|
100
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_AUTHOR_NAME --value "$COMMIT_AUTHOR_NAME"');
|
|
101
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_AUTHOR_EMAIL --value "$COMMIT_AUTHOR_EMAIL"');
|
|
102
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_COMMITER_NAME --value "$COMMIT_COMMITTER_NAME"');
|
|
103
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_COMMITER_EMAIL --value "$COMMIT_COMMITTER_EMAIL"');
|
|
104
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_MESSAGE_SUBJECT --value "$COMMIT_MESSAGE_SUBJECT"');
|
|
105
|
+
commands.push('envman add --key GIT_CLONE_COMMIT_MESSAGE_BODY --value "$COMMIT_MESSAGE_BODY"');
|
|
106
|
+
commands.push('echo "✅ Source directory: $GIT_ROOT"');
|
|
107
|
+
const script = this.createBashScriptFromCommands(commands, stepName);
|
|
108
|
+
return this.createScriptStep(script, stepName);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=git-clone.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Play deploy step implementation
|
|
3
|
+
* Uploads APK/AAB to Google Play using fastlane supply
|
|
4
|
+
*/
|
|
5
|
+
import { BaseStepExecutor } from './base.js';
|
|
6
|
+
import type { StepDef, CIConfig } from '../../types.js';
|
|
7
|
+
import type { ValidationRequirement } from '../validation-types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Inputs for google-play-deploy step
|
|
10
|
+
*/
|
|
11
|
+
export interface GooglePlayDeployInputs {
|
|
12
|
+
artifact_type?: string;
|
|
13
|
+
service_account_json_key_path?: string;
|
|
14
|
+
service_account_json_var?: string;
|
|
15
|
+
package_name?: string;
|
|
16
|
+
app_path?: string;
|
|
17
|
+
track?: string;
|
|
18
|
+
user_fraction?: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
update_priority?: string;
|
|
21
|
+
whatsnews_dir?: string;
|
|
22
|
+
mapping_file?: string;
|
|
23
|
+
retry_without_sending_to_review?: string;
|
|
24
|
+
ack_bundle_installation_warning?: string;
|
|
25
|
+
dry_run?: string;
|
|
26
|
+
verbose_log?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Google Play deploy step executor
|
|
30
|
+
* Maps google-play-deploy to fastlane supply
|
|
31
|
+
*/
|
|
32
|
+
export declare class GooglePlayDeployStepExecutor extends BaseStepExecutor {
|
|
33
|
+
isSkippedInLocalMode(): boolean;
|
|
34
|
+
getValidationRequirements(inputs: GooglePlayDeployInputs, env: Record<string, string>, _config: CIConfig): ValidationRequirement[];
|
|
35
|
+
execute(inputs: GooglePlayDeployInputs, env: Record<string, string>, config: CIConfig): Promise<StepDef>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=google-play-deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-play-deploy.d.ts","sourceRoot":"","sources":["../../../../src/yaml/steps/google-play-deploy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,+BAA+B,CAAC,EAAE,MAAM,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,gBAAgB;IAChE,oBAAoB,IAAI,OAAO;IAI/B,yBAAyB,CACvB,MAAM,EAAE,sBAAsB,EAC9B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,OAAO,EAAE,QAAQ,GAChB,qBAAqB,EAAE;IAoBpB,OAAO,CAAC,MAAM,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAsL/G"}
|