codemagic.yaml
codemagic.yaml
1# Private submodules require the Codemagic variable group2# `private_git_credentials` with FORGEJO_USERNAME and a secret FORGEJO_TOKEN.3# Configure the HTTPS repository connection separately in Codemagic's UI.45workflows:6 ios-testflight:7 name: iOS TestFlight8 instance_type: mac_mini_m29 max_build_duration: 12010 integrations:11 # Team settings > Integrations > App Store Connect: use this exact key name.12 app_store_connect: yokan-testflight13 triggering:14 events:15 - push16 branch_patterns:17 - pattern: main18 include: true19 source: true20 environment:21 groups:22 - private_git_credentials23 # Set APP_STORE_APPLE_ID to Yokan's numeric App Store Connect Apple ID.24 - ios_testflight25 ios_signing:26 distribution_type: app_store27 bundle_identifier: eu.friedcutlet.yokan28 xcode: latest29 java: 2130 vars:31 CM_RECURSIVE_SUBMODULE_INIT: "false"32 cache:33 cache_paths:34 - $HOME/.gradle/caches35 - $HOME/.gradle/wrapper36 - $HOME/.konan37 scripts:38 - name: Initialize private submodules39 script: |40 set -eu41 bash "$CM_BUILD_DIR/scripts/init-private-submodules.sh"42 - name: Set release version and TestFlight build number43 script: |44 set -eu45 : "${APP_STORE_APPLE_ID:?Set APP_STORE_APPLE_ID in the ios_testflight variable group}"46 REPO_ROOT="$CM_BUILD_DIR"47 . "$REPO_ROOT/scripts/yokan-version.sh"48 LATEST_BUILD_NUMBER=$(app-store-connect get-latest-testflight-build-number "$APP_STORE_APPLE_ID" --platform IOS --all-versions)49 LATEST_BUILD_NUMBER=${LATEST_BUILD_NUMBER:-0}50 case "$LATEST_BUILD_NUMBER" in51 *[!0-9]*) echo "Expected an integer TestFlight build number, got: $LATEST_BUILD_NUMBER" >&2; exit 1 ;;52 esac53 NEXT_BUILD_NUMBER=$((LATEST_BUILD_NUMBER + 1))54 if [ "$NEXT_BUILD_NUMBER" -gt "$YOKAN_VERSION_CODE" ]; then55 YOKAN_VERSION_CODE=$NEXT_BUILD_NUMBER56 fi57 # Share the same override with Xcode and the Gradle build phase.58 echo "YOKAN_VERSION=$YOKAN_VERSION" >> "$CM_ENV"59 echo "YOKAN_VERSION_CODE=$YOKAN_VERSION_CODE" >> "$CM_ENV"60 - name: Apply App Store provisioning profiles61 script: |62 set -eu63 xcode-project use-profiles --project "$CM_BUILD_DIR/iosApp/iosApp.xcodeproj"64 - name: Build signed TestFlight IPA65 script: |66 set -eu67 xcode-project build-ipa \68 --project "$CM_BUILD_DIR/iosApp/iosApp.xcodeproj" \69 --scheme iosApp \70 --config Release \71 --archive-xcargs "COMPILER_INDEX_STORE_ENABLE=NO YOKAN_VERSION=$YOKAN_VERSION MARKETING_VERSION=$YOKAN_VERSION CURRENT_PROJECT_VERSION=$YOKAN_VERSION_CODE YOKAN_SIDELOAD_RUNTIME=NO YOKAN_SIDELOAD_RUNTIME_ENABLED=0"72 artifacts:73 - build/ios/ipa/*.ipa74 - build/ios/xcarchive/**/*.dSYM75 - /tmp/xcodebuild_logs/*.log76 publishing:77 app_store_connect:78 auth: integration79 submit_to_testflight: true80 # Create this group in App Store Connect > Yokan > TestFlight first.81 beta_groups:82 - Yokan Testers83 submit_to_app_store: false8485 ios-sideload:86 name: iOS sideload IPA (unsigned)87 instance_type: mac_mini_m288 max_build_duration: 6089 triggering:90 events:91 - push92 - pull_request93 branch_patterns:94 - pattern: main95 include: true96 source: true97 - pattern: develop98 include: true99 source: true100 environment:101 groups:102 - private_git_credentials103 java: 21104 vars:105 CM_RECURSIVE_SUBMODULE_INIT: "false"106 cache:107 cache_paths:108 - $HOME/.gradle/caches109 - $HOME/.gradle/wrapper110 - $HOME/.konan111 scripts:112 - name: Initialize private submodules113 script: |114 bash "$CM_BUILD_DIR/scripts/init-private-submodules.sh"115 - name: Build unsigned sideload IPA116 script: |117 set -o pipefail118 mkdir -p build/ios-ipa/logs119 scripts/build-ios-unsigned-ipa.sh 2>&1 | tee build/ios-ipa/logs/xcodebuild.log120 artifacts:121 - build/ios-ipa/dist/*.ipa122 - build/ios-ipa/**/*.log123 - build/ios-ipa/DerivedData/Logs/**124125 macos-dmg:126 name: macOS DMG127 instance_type: mac_mini_m2128 max_build_duration: 60129 triggering:130 events:131 - push132 - pull_request133 branch_patterns:134 - pattern: main135 include: true136 source: true137 - pattern: develop138 include: true139 source: true140 environment:141 groups:142 - private_git_credentials143 vars:144 CM_RECURSIVE_SUBMODULE_INIT: "false"145 cache:146 cache_paths:147 - $HOME/.gradle/caches148 - $HOME/.gradle/wrapper149 scripts:150 - name: Initialize private submodules151 script: |152 bash "$CM_BUILD_DIR/scripts/init-private-submodules.sh"153 - name: Build macOS DMG154 script: |155 set -o pipefail156 mkdir -p build/macos-dmg/logs157 ./gradlew :composeApp:packageReleaseDistributionForCurrentOS --no-daemon 2>&1 | tee build/macos-dmg/logs/gradle.log158 artifacts:159 - composeApp/build/compose/binaries/main-release/dmg/*.dmg160 - build/macos-dmg/**/*.log161