From 1d358c651f34652e33c304526634c50cfae47f55 Mon Sep 17 00:00:00 2001 From: denis0001-dev Date: Sat, 31 Oct 2026 03:56:59 +0300 Subject: [PATCH] Fix release iOS CI hang and JVM artifact uploads. Build the KMP framework with plain Gradle logs before xcodebuild, skip the Xcode Gradle script phase, and include gitignored build outputs in jvm-compile-outputs artifacts. Co-authored-by: Cursor --- .github/workflows/release.yml | 4 ++++ scripts/package-ios-ipa.sh | 38 ++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 888f29d..1bf97a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -188,6 +188,7 @@ jobs: app/shared/build app/desktop/build/classes app/desktop/build/libs + include-hidden-files: true if-no-files-found: error retention-days: 3 @@ -620,6 +621,9 @@ jobs: if: needs.resolve-version.outputs.should_build == 'true' runs-on: macos-latest timeout-minutes: 120 + env: + GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.vfs.watch=false + ORG_GRADLE_PROJECT_org.gradle.workers.max: "4" steps: - uses: actions/checkout@v5 - uses: ./.github/actions/restore-git-mtimes diff --git a/scripts/package-ios-ipa.sh b/scripts/package-ios-ipa.sh index 1b36853..1da0797 100755 --- a/scripts/package-ios-ipa.sh +++ b/scripts/package-ios-ipa.sh @@ -29,6 +29,41 @@ fi rm -rf "$BUILD_DIR" mkdir -p "$BUILD_DIR" "$OUT_DIR" +# xcodebuild hides Run Script output and starts Gradle without --no-daemon, which often looks +# "stuck" on CI (no log lines for many minutes). Build the KMP framework explicitly first. +echo "Building Kotlin framework for Release / iphoneos…" +PRODUCTS_DIR="$BUILD_DIR/Build/Products/Release-iphoneos" +mkdir -p "$PRODUCTS_DIR" + +export CONFIGURATION=Release +export SDK_NAME="$(xcrun --sdk iphoneos --show-sdk-name)" +export ARCHS=arm64 +export PLATFORM_NAME=iphoneos +export EFFECTIVE_PLATFORM_NAME=-iphoneos +export TARGET_BUILD_DIR="$PRODUCTS_DIR" +export FRAMEWORKS_FOLDER_PATH="iosApp.app/Frameworks" +export CODE_SIGNING_ALLOWED=NO +export CODE_SIGNING_REQUIRED=NO +export EXPANDED_CODE_SIGN_IDENTITY="-" +export OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED=YES + +echo "Using SDK_NAME=$SDK_NAME" + +cd "$ROOT" +./gradlew :app:shared:embedAndSignAppleFrameworkForXcode \ + --no-daemon \ + --console=plain \ + -Dorg.gradle.vfs.watch=false \ + -Djdk.lang.Process.launchMechanism=fork + +FRAMEWORK_DIR="$ROOT/app/shared/build/xcode-frameworks/Release/$SDK_NAME" +if [[ ! -d "$FRAMEWORK_DIR" ]]; then + echo "Kotlin framework missing under $FRAMEWORK_DIR" >&2 + exit 1 +fi +echo "Kotlin framework ready at $FRAMEWORK_DIR" + +echo "Running xcodebuild (Kotlin build phase skipped)…" xcodebuild \ -project "$IOS_PROJECT_DIR/iosApp.xcodeproj" \ -scheme iosApp \ @@ -44,7 +79,8 @@ xcodebuild \ CODE_SIGN_STYLE=Manual \ DEVELOPMENT_TEAM="" \ PROVISIONING_PROFILE_SPECIFIER="" \ - clean build + OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED=YES \ + build APP_BUNDLE_PATH="$(find "$BUILD_DIR/Build/Products/Release-iphoneos" -name '*.app' -type d | head -n 1)" if [[ -z "$APP_BUNDLE_PATH" ]]; then