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: - TEST_SHARD_COUNT: 2 - BITRISE_PROJECT_PATH: PediFoods.xcodeproj opts: is_expand: false - BITRISE_SCHEME: PediFoods App opts: is_expand: false - BITRISE_DISTRIBUTION_METHOD: app-store opts: is_expand: false - APPLE_ID: developer@loverde.com.br # 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 base64-encoded # ITC_TEAM_ID → iTunes Connect Team ID (numeric) # ─── PIPELINES ──────────────────────────────────────────────────────────────── pipelines: run_tests: workflows: build_for_testing: {} test_without_building: depends_on: - build_for_testing parallel: "$TEST_SHARD_COUNT" # ─── WORKFLOWS ──────────────────────────────────────────────────────────────── workflows: # ── Parallel test pipeline: step 1 — build only ─────────────────────────── build_for_testing: description: Build app for testing (no run) — used by run_tests pipeline steps: - git-clone@8: {} - xcode-build-for-test@3: inputs: - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - simulator_device: iPhone 16 - simulator_os_version: latest - output_tool: xcpretty - deploy-to-bitrise-io@2: inputs: - pipeline_intermediate_files: "$BITRISE_TEST_BUNDLE_ZIP_PATH:BITRISE_TEST_BUNDLE_ZIP_PATH" # ── Parallel test pipeline: step 2 — run shards ─────────────────────────── test_without_building: description: Run test shards in parallel — depends on build_for_testing steps: - pull-intermediate-files@1: inputs: - artifact_sources: build_for_testing - xcode-test-without-building@0: inputs: - xctestrun: $BITRISE_TEST_BUNDLE_ZIP_PATH - destination: platform=iOS Simulator,name=iPhone 16,OS=latest - test_shard_index: $BITRISE_IO_PARALLEL_INDEX - total_number_of_shards: $TEST_SHARD_COUNT - generate_code_coverage_files: "yes" # ── Metadata push (no build) ─────────────────────────────────────────────── metadata: description: Push App Store metadata and screenshots for all languages steps: - git-clone@8: {} - fastlane@3: inputs: - lane: metadata - work_dir: $BITRISE_SOURCE_DIR # ── Simple single-machine test (non-parallel) ────────────────────────────── test: description: Run unit tests (single machine, for PR checks) steps: - git-clone@8: {} - xcode-test@5: inputs: - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - simulator_device: iPhone 16 - simulator_os_version: latest - should_build_before_test: "yes" - generate_code_coverage_files: "yes" # ── 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/Darwin agvtool new-version -all $BITRISE_BUILD_NUMBER - manage-ios-code-signing@2: inputs: - distribution_method: app-store - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME # MANUAL: Upload .p12 cert + .mobileprovision in # Bitrise → Code Signing tab BEFORE running this workflow - xcode-archive@5: inputs: - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - distribution_method: $BITRISE_DISTRIBUTION_METHOD - automatic_code_signing: api-key - register_test_devices: "no" - deploy-to-itunesconnect-deliver@2: inputs: - itunescon_user: $APPLE_ID - api_key_path: "" - api_issuer: $ASC_ISSUER_ID - submit_for_review: "no" - skip_metadata: "yes" - skip_screenshots: "yes" # ── Full release → App Store ─────────────────────────────────────────────── release: description: Build, sign, push metadata+screenshots, upload binary to App Store envs: - ASC_KEY_ID: $ASC_KEY_ID - ASC_ISSUER_ID: $ASC_ISSUER_ID - ASC_KEY_CONTENT: $ASC_KEY_CONTENT - ITC_TEAM_ID: $ITC_TEAM_ID steps: - git-clone@8: {} - script@1: title: Verify ASC secrets inputs: - content: | if [ -z "$ASC_KEY_ID" ]; then echo "ERROR: ASC_KEY_ID is empty" exit 1 fi echo "ASC_KEY_ID is set (length: ${#ASC_KEY_ID})" echo "ASC_ISSUER_ID is set (length: ${#ASC_ISSUER_ID})" echo "ASC_KEY_CONTENT is set (length: ${#ASC_KEY_CONTENT})" - script@1: title: Set build number inputs: - content: | cd $BITRISE_SOURCE_DIR/Darwin agvtool new-version -all $BITRISE_BUILD_NUMBER - manage-ios-code-signing@2: inputs: - distribution_method: app-store - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - xcode-archive@5: inputs: - project_path: $BITRISE_PROJECT_PATH - scheme: $BITRISE_SCHEME - distribution_method: $BITRISE_DISTRIBUTION_METHOD - automatic_code_signing: api-key - fastlane@3: inputs: - lane: release - work_dir: $BITRISE_SOURCE_DIR - deploy-to-bitrise-io@2: {} # ─── TRIGGER MAP ────────────────────────────────────────────────────────────── trigger_map: - push_branch: develop workflow: beta - push_branch: main workflow: release - pull_request_source_branch: feature/* workflow: test