format_version: '26' default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios meta: bitrise.io: stack: osx-xcode-26.0.x machine_type_id: g2-m1.8core app: envs: - BITRISE_DISTRIBUTION_METHOD: app-store opts: is_expand: false # MANUAL (Bitrise Secrets tab — never commit these): # ASC_KEY_ID → App Store Connect API Key ID # ASC_ISSUER_ID → App Store Connect Issuer ID # ASC_KEY_CONTENT → .p8 file content (raw, written verbatim into apikey.json) # DEVELOPMENT_TEAM → Apple Developer Team ID, written into # Darwin/fastlane/AppStore.xcconfig at build time # (Darwin/PediFoods.xcconfig leaves it blank on purpose) # ─── WORKFLOWS ──────────────────────────────────────────────────────────────── workflows: # ── Beta → TestFlight ────────────────────────────────────────────────────── beta: description: Build, sign, and upload to TestFlight steps: - git-clone@8: {} - script@1: title: Set build number inputs: - content: | cd $BITRISE_SOURCE_DIR # CURRENT_PROJECT_VERSION lives in Skip.env — shared by both # Darwin/PediFoods.xcconfig and Android/settings.gradle.kts, # not a standard Xcode "Apple Generic Versioning" setting, # so agvtool does not apply here. sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env - script@1: title: Write code signing team and App Store Connect API key inputs: - content: | echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" # ASC_KEY_CONTENT is the raw multi-line .p8 PEM content — build # the JSON with Ruby's encoder so its embedded newlines get # escaped correctly instead of breaking the JSON string. export APIKEY_PATH="$BITRISE_SOURCE_DIR/Darwin/fastlane/apikey.json" ruby -rjson -e ' File.write(ENV["APIKEY_PATH"], JSON.generate({ "key_id" => ENV["ASC_KEY_ID"], "issuer_id" => ENV["ASC_ISSUER_ID"], "key" => ENV["ASC_KEY_CONTENT"], "in_house" => false })) ' - fastlane@3: inputs: - lane: beta - work_dir: $BITRISE_SOURCE_DIR/Darwin # ── Full release → App Store ─────────────────────────────────────────────── release: description: Build, sign, and upload to App Store steps: - git-clone@8: {} - script@1: title: Verify secrets inputs: - content: | if [ -z "$ASC_KEY_ID" ] || [ -z "$DEVELOPMENT_TEAM" ]; then echo "ERROR: ASC_KEY_ID / ASC_ISSUER_ID / ASC_KEY_CONTENT / DEVELOPMENT_TEAM must be set in Bitrise Secrets" exit 1 fi echo "ASC_KEY_ID is set (length: ${#ASC_KEY_ID})" echo "DEVELOPMENT_TEAM is set (length: ${#DEVELOPMENT_TEAM})" - script@1: title: Set build number inputs: - content: | cd $BITRISE_SOURCE_DIR sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env - script@1: title: Write code signing team and App Store Connect API key inputs: - content: | echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" # ASC_KEY_CONTENT is the raw multi-line .p8 PEM content — build # the JSON with Ruby's encoder so its embedded newlines get # escaped correctly instead of breaking the JSON string. export APIKEY_PATH="$BITRISE_SOURCE_DIR/Darwin/fastlane/apikey.json" ruby -rjson -e ' File.write(ENV["APIKEY_PATH"], JSON.generate({ "key_id" => ENV["ASC_KEY_ID"], "issuer_id" => ENV["ASC_ISSUER_ID"], "key" => ENV["ASC_KEY_CONTENT"], "in_house" => false })) ' - fastlane@3: inputs: - lane: release - work_dir: $BITRISE_SOURCE_DIR/Darwin - deploy-to-bitrise-io@2: {} # ─── TRIGGER MAP ────────────────────────────────────────────────────────────── trigger_map: - push_branch: develop workflow: beta - push_branch: main workflow: release