[ci-bitrise] Mirror LC Wallet's bitrise.yml structure exactly

Switch from fastlane-driven build (build_app + hand-rolled apikey.json)
to Bitrise's own xcode-archive step, matching LC Wallet 1:1: manage-ios-
code-signing + xcode-archive@5 (automatic_code_signing: api-key) do the
build/sign, deploy-to-itunesconnect-deliver@2 handles TestFlight in the
beta workflow, fastlane only runs for the release lane (metadata push +
App Store upload) reading BITRISE_IPA_PATH — same shape as LC Wallet's
Fastfile beta/release lanes.

Only genuine differences from LC Wallet, all forced by this project's
actual layout:
- BITRISE_PROJECT_PATH/SCHEME point at Darwin/PediFoods.xcodeproj
- fastlane work_dir is Darwin/ (Fastfile lives there, not repo root)
- build number bumps CURRENT_PROJECT_VERSION in Skip.env instead of
  agvtool — this project has no VERSIONING_SYSTEM set, Skip.env is the
  actual shared source of truth for both Darwin and Android
- team_id comes from a DEVELOPMENT_TEAM secret instead of a hardcoded
  literal — LC Wallet's Apple team ID isn't necessarily this app's
This commit is contained in:
Daniel Arantes Loverde
2026-07-09 16:24:23 -03:00
parent 74526d0fb9
commit 5761523344
3 changed files with 84 additions and 60 deletions

View File

@@ -5,4 +5,6 @@ require('dotenv')
Dotenv.load '../../Skip.env' Dotenv.load '../../Skip.env'
app_identifier(ENV['ANDROID_APPLICATION_ID'] || ENV['PRODUCT_BUNDLE_IDENTIFIER']) app_identifier(ENV['ANDROID_APPLICATION_ID'] || ENV['PRODUCT_BUNDLE_IDENTIFIER'])
# apple_id("my@email") apple_id ENV["APPLE_ID"]
itc_team_id ENV["ITC_TEAM_ID"]
team_id ENV["DEVELOPMENT_TEAM"]

View File

@@ -20,35 +20,26 @@ lane :assemble do |options|
) )
end end
# ─── Upload IPA to TestFlight (Bitrise's xcode-archive step already built it) ──
lane :beta do |options| lane :beta do |options|
desc "Build and upload to TestFlight"
get_provisioning_profile(api_key_path: "fastlane/apikey.json")
assemble
upload_to_testflight( upload_to_testflight(
api_key_path: "fastlane/apikey.json", ipa: ENV["BITRISE_IPA_PATH"],
skip_waiting_for_build_processing: true skip_waiting_for_build_processing: true
) )
end end
# ─── Push metadata + upload IPA to App Store (Bitrise already built it) ───────
lane :release do |options| lane :release do |options|
desc "Build and release app" deliver(
ipa: ENV["BITRISE_IPA_PATH"],
# see https://docs.fastlane.tools/uploading-app-privacy-details/
#upload_app_privacy_details_to_app_store(json_path: "fastlane/app_privacy_details.json")
# if you have an apikey.json file (https://developer.apple.com/documentation/appstoreconnectapi/creating-api-keys-for-app-store-connect-api), fastlane can automatically fetch certificates and the ASC authentication information
#get_certificates(api_key_path: "fastlane/apikey.json")
get_provisioning_profile(api_key_path: "fastlane/apikey.json")
assemble
upload_to_app_store(
api_key_path: "fastlane/apikey.json",
app_rating_config_path: "fastlane/metadata/rating.json", app_rating_config_path: "fastlane/metadata/rating.json",
release_notes: { default: "Fixes and improvements." } release_notes: { default: "Fixes and improvements." },
skip_screenshots: false,
skip_metadata: false,
force: true,
submit_for_review: false,
automatic_release: false,
run_precheck_before_submit: false
) )
end end

View File

@@ -9,16 +9,37 @@ meta:
app: app:
envs: envs:
- BITRISE_PROJECT_PATH: Darwin/PediFoods.xcodeproj
opts:
is_expand: false
- BITRISE_SCHEME: PediFoods App
opts:
is_expand: false
- BITRISE_DISTRIBUTION_METHOD: app-store - BITRISE_DISTRIBUTION_METHOD: app-store
opts: opts:
is_expand: false is_expand: false
- APPLE_ID: developer@loverde.com.br
# MANUAL (Bitrise Secrets tab — never commit these): # MANUAL (Bitrise Secrets tab — never commit these):
# ASC_KEY_ID → App Store Connect API Key ID # ASC_KEY_ID → App Store Connect API Key ID
# ASC_ISSUER_ID → App Store Connect Issuer ID # ASC_ISSUER_ID → App Store Connect Issuer ID
# ASC_KEY_CONTENT → .p8 file content (raw, written verbatim into apikey.json) # ASC_KEY_CONTENT → .p8 file content base64-encoded
# ITC_TEAM_ID → iTunes Connect Team ID (numeric)
# DEVELOPMENT_TEAM → Apple Developer Team ID, written into # DEVELOPMENT_TEAM → Apple Developer Team ID, written into
# Darwin/fastlane/AppStore.xcconfig at build time # Darwin/fastlane/AppStore.xcconfig at build time
# (Darwin/PediFoods.xcconfig leaves it blank on purpose) # (Darwin/PediFoods.xcconfig leaves it blank on
# purpose — this project has no VERSIONING_SYSTEM /
# hardcoded team like LC Wallet, so it's injected
# here instead)
# ─── PIPELINES ────────────────────────────────────────────────────────────────
pipelines:
run_tests:
workflows:
build_for_testing: {}
test_without_building:
depends_on:
- build_for_testing
parallel: "$TEST_SHARD_COUNT"
# ─── WORKFLOWS ──────────────────────────────────────────────────────────────── # ─── WORKFLOWS ────────────────────────────────────────────────────────────────
workflows: workflows:
@@ -34,46 +55,57 @@ workflows:
- content: | - content: |
cd $BITRISE_SOURCE_DIR cd $BITRISE_SOURCE_DIR
# CURRENT_PROJECT_VERSION lives in Skip.env — shared by both # CURRENT_PROJECT_VERSION lives in Skip.env — shared by both
# Darwin/PediFoods.xcconfig and Android/settings.gradle.kts, # Darwin/PediFoods.xcconfig and Android/settings.gradle.kts.
# not a standard Xcode "Apple Generic Versioning" setting, # No VERSIONING_SYSTEM is set on the target, so agvtool
# so agvtool does not apply here. # (which LC Wallet uses) does not apply to this project.
sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env
- script@1: - script@1:
title: Write code signing team and App Store Connect API key title: Write code signing team
inputs: inputs:
- content: | - content: |
echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig"
# ASC_KEY_CONTENT is the raw multi-line .p8 PEM content — build - manage-ios-code-signing@2:
# 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: inputs:
- lane: beta - distribution_method: app-store
- work_dir: $BITRISE_SOURCE_DIR/Darwin - 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
- 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 ─────────────────────────────────────────────── # ── Full release → App Store ───────────────────────────────────────────────
release: release:
description: Build, sign, and upload to App Store description: Build, sign, push metadata, 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: steps:
- git-clone@8: {} - git-clone@8: {}
- script@1: - script@1:
title: Verify secrets title: Verify ASC secrets
inputs: inputs:
- content: | - content: |
if [ -z "$ASC_KEY_ID" ] || [ -z "$DEVELOPMENT_TEAM" ]; then if [ -z "$ASC_KEY_ID" ]; then
echo "ERROR: ASC_KEY_ID / ASC_ISSUER_ID / ASC_KEY_CONTENT / DEVELOPMENT_TEAM must be set in Bitrise Secrets" echo "ERROR: ASC_KEY_ID is empty"
exit 1 exit 1
fi fi
echo "ASC_KEY_ID is set (length: ${#ASC_KEY_ID})" 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})"
echo "DEVELOPMENT_TEAM is set (length: ${#DEVELOPMENT_TEAM})" echo "DEVELOPMENT_TEAM is set (length: ${#DEVELOPMENT_TEAM})"
- script@1: - script@1:
title: Set build number title: Set build number
@@ -82,22 +114,21 @@ workflows:
cd $BITRISE_SOURCE_DIR cd $BITRISE_SOURCE_DIR
sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env sed -i '' "s/CURRENT_PROJECT_VERSION = .*/CURRENT_PROJECT_VERSION = $BITRISE_BUILD_NUMBER/" Skip.env
- script@1: - script@1:
title: Write code signing team and App Store Connect API key title: Write code signing team
inputs: inputs:
- content: | - content: |
echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig" echo "DEVELOPMENT_TEAM = $DEVELOPMENT_TEAM" >> "$BITRISE_SOURCE_DIR/Darwin/fastlane/AppStore.xcconfig"
# ASC_KEY_CONTENT is the raw multi-line .p8 PEM content — build - manage-ios-code-signing@2:
# the JSON with Ruby's encoder so its embedded newlines get inputs:
# escaped correctly instead of breaking the JSON string. - distribution_method: app-store
export APIKEY_PATH="$BITRISE_SOURCE_DIR/Darwin/fastlane/apikey.json" - project_path: $BITRISE_PROJECT_PATH
ruby -rjson -e ' - scheme: $BITRISE_SCHEME
File.write(ENV["APIKEY_PATH"], JSON.generate({ - xcode-archive@5:
"key_id" => ENV["ASC_KEY_ID"], inputs:
"issuer_id" => ENV["ASC_ISSUER_ID"], - project_path: $BITRISE_PROJECT_PATH
"key" => ENV["ASC_KEY_CONTENT"], - scheme: $BITRISE_SCHEME
"in_house" => false - distribution_method: $BITRISE_DISTRIBUTION_METHOD
})) - automatic_code_signing: api-key
'
- fastlane@3: - fastlane@3:
inputs: inputs:
- lane: release - lane: release