diff --git a/scripts/ci/build_matrix_artifacts.sh b/scripts/ci/build_matrix_artifacts.sh index 6826f7f8..b078ffdf 100755 --- a/scripts/ci/build_matrix_artifacts.sh +++ b/scripts/ci/build_matrix_artifacts.sh @@ -26,10 +26,30 @@ case "$platform" in pwsh -File ./scripts/package-windows-msi.ps1 -Arch "$arch" ;; ios) - if [[ "$should_release" == "true" ]]; then - bash ./scripts/package-ios-ipa.sh + ios_signing_secrets=( + APPLE_CERT_P12_BASE64 + APPLE_CERT_PASSWORD + APPLE_PROVISION_PROFILE_BASE64 + APPLE_KEYCHAIN_PASSWORD + ) + ios_missing=() + for var_name in "${ios_signing_secrets[@]}"; do + if [[ -z "${!var_name:-}" ]]; then + ios_missing+=("$var_name") + fi + done + + if [[ "${#ios_missing[@]}" -gt 0 ]]; then + echo "Apple signing secrets unavailable (missing: ${ios_missing[*]}); building unsigned iOS app bundle." + build_unsigned_ios_bundle=1 + elif [[ "$should_release" == "true" ]]; then + build_unsigned_ios_bundle=0 else - echo "Release secrets not required for non-release runs; building unsigned iOS app bundle." + echo "Release not requested; building unsigned iOS app bundle." + build_unsigned_ios_bundle=1 + fi + + if [[ "$build_unsigned_ios_bundle" -eq 1 ]]; then flutter build ios --release --no-codesign \ --build-name="$PLATFORM_RELEASE_VERSION" \ --build-number="$BUILD_NUMBER" \ @@ -42,6 +62,8 @@ case "$platform" in zip -qry XWorkmate.app.zip Runner.app mv XWorkmate.app.zip ../../../dist/ios/ ) + else + bash ./scripts/package-ios-ipa.sh fi ;; android) diff --git a/scripts/ci/platform_preflight.sh b/scripts/ci/platform_preflight.sh index ff78dc27..c0f65ce5 100644 --- a/scripts/ci/platform_preflight.sh +++ b/scripts/ci/platform_preflight.sh @@ -24,12 +24,22 @@ set_build_state() { emit_output "skip_reason" "$reason" if [[ "$should_build" == "true" ]]; then - echo "Preflight passed for $platform." + if [[ -n "$reason" ]]; then + echo "Preflight passed for $platform with warning: $reason" + else + echo "Preflight passed for $platform." + fi else echo "Skipping $platform lane: $reason" fi } +warn_unsigned_build() { + local missing="$1" + echo "::warning::$platform build will run without Apple signing secrets (missing: $missing)." \ + "Output artifacts will be unsigned/ad-hoc. Configure the Apple signing secrets to enable signed packaging." +} + case "$platform" in linux) set_build_state "true" "" @@ -52,18 +62,14 @@ case "$platform" in done if [[ "${#missing[@]}" -gt 0 ]]; then - set_build_state "false" "missing macOS signing secrets: ${missing[*]}" + warn_unsigned_build "${missing[*]}" + set_build_state "true" "missing macOS signing secrets: ${missing[*]}; will produce unsigned DMG" exit 0 fi set_build_state "true" "" ;; ios) - if [[ "$should_release" != "true" ]]; then - set_build_state "true" "" - exit 0 - fi - required_vars=( APPLE_CERT_P12_BASE64 APPLE_CERT_PASSWORD @@ -79,7 +85,8 @@ case "$platform" in done if [[ "${#missing[@]}" -gt 0 ]]; then - set_build_state "false" "missing iOS signing secrets: ${missing[*]}" + warn_unsigned_build "${missing[*]}" + set_build_state "true" "missing iOS signing secrets: ${missing[*]}; will produce unsigned app bundle" exit 0 fi