Merge pull request 'feature/ci/gitea-macos-runner' (#47) from feature/ci/gitea-macos-runner into main

Reviewed-on: Loverde-Company-LTDA/Pedi-Foods-Skip#47
This commit is contained in:
2026-09-10 20:09:06 -03:00
8 changed files with 57 additions and 342 deletions

View File

@@ -1,37 +1,24 @@
name: Beta (TestFlight)
name: Beta (TestFlight, on PR to develop)
on:
push:
pull_request:
branches:
- develop
jobs:
wake-macos-vm:
runs-on: macos-ctl
steps:
- name: Start macOS VM container
run: docker start macos
build-and-upload:
needs: wake-macos-vm
runs-on: macos-release
runs-on: macos-build
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
BUILD_NUMBER: ${{ gitea.run_number }}
BUILD_NUMBER: ${{ github.run_number }}
steps:
- name: Checkout
- name: Checkout repository (workaround - Gitea git-upload-pack bug, see go-gitea/gitea#21819)
run: |
export GIT_TERMINAL_PROMPT=0
export GIT_ASKPASS=/bin/false
export SSH_ASKPASS=/bin/false
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git -c credential.helper= -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}"
curl -sSfL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-o /tmp/repo.tar.gz \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/archive/${{ github.sha }}.tar.gz"
tar -xzf /tmp/repo.tar.gz --strip-components=1 -C "$GITHUB_WORKSPACE"
- name: Write App Store Connect API key
run: |
@@ -48,20 +35,11 @@ jobs:
- name: Unlock keychain and run fastlane beta
run: |
security unlock-keychain -p "${{ secrets.CI_KEYCHAIN_PASSWORD }}" ~/Library/Keychains/ci-signing.keychain-db
security list-keychains -d user -s ~/Library/Keychains/ci-signing.keychain-db ~/Library/Keychains/login.keychain-db
security default-keychain -d user -s ~/Library/Keychains/ci-signing.keychain-db
security unlock-keychain -p "${{ secrets.CI_KEYCHAIN_PASSWORD }}" ~/Library/Keychains/ci-build.keychain-db
security list-keychains -d user -s ~/Library/Keychains/ci-build.keychain-db ~/Library/Keychains/login.keychain-db
security find-identity -v -p codesigning
fastlane beta
- name: Clean up API key
if: always()
run: rm -f fastlane/apikey.json
sleep-macos-vm:
needs: build-and-upload
if: always()
runs-on: macos-ctl
steps:
- name: Stop macOS VM container
run: docker stop macos

View File

@@ -1,85 +0,0 @@
name: Release (App Store Connect)
on:
push:
branches:
- main
jobs:
wake-macos-vm:
runs-on: macos-ctl
steps:
- name: Start macOS VM container
run: docker start macos
build-archive-deliver:
needs: wake-macos-vm
runs-on: macos-release
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
ITC_TEAM_ID: ${{ secrets.ITC_TEAM_ID }}
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
BUILD_NUMBER: ${{ gitea.run_number }}
steps:
- name: Checkout
run: |
export GIT_TERMINAL_PROMPT=0
export GIT_ASKPASS=/bin/false
export SSH_ASKPASS=/bin/false
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git -c credential.helper= -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}"
- name: Verify ASC secrets
run: |
if [ -z "${{ secrets.ASC_KEY_ID }}" ]; then
echo "ERROR: ASC_KEY_ID is empty"
exit 1
fi
- name: Write App Store Connect API key
run: |
cat > fastlane/apikey.json <<EOF
{
"key_id": "${{ secrets.ASC_KEY_ID }}",
"issuer_id": "${{ secrets.ASC_ISSUER_ID }}",
"key": "${{ secrets.ASC_KEY_CONTENT }}",
"is_key_content_base64": true,
"duration": 1200,
"in_house": false
}
EOF
- name: Unlock keychain and run fastlane release
run: |
echo "whoami: $(whoami)"
echo "HOME: $HOME"
echo "expanded keychain path: $HOME/Library/Keychains/ci-signing.keychain-db"
ls -la "$HOME/Library/Keychains/" || echo "cannot list Keychains dir"
security unlock-keychain -p "${{ secrets.CI_KEYCHAIN_PASSWORD }}" "$HOME/Library/Keychains/ci-signing.keychain-db"
echo "--- keychain info ---"
security show-keychain-info "$HOME/Library/Keychains/ci-signing.keychain-db" || true
security list-keychains -d user -s "$HOME/Library/Keychains/ci-signing.keychain-db" "$HOME/Library/Keychains/login.keychain-db"
security default-keychain -d user -s "$HOME/Library/Keychains/ci-signing.keychain-db"
echo "--- current search list ---"
security list-keychains
echo "--- dump-keychain identity count ---"
security dump-keychain "$HOME/Library/Keychains/ci-signing.keychain-db" | grep -c "class.*0x80001000" || true
echo "--- find-identity ---"
security find-identity -v -p codesigning
fastlane release
- name: Clean up API key
if: always()
run: rm -f fastlane/apikey.json
sleep-macos-vm:
needs: build-archive-deliver
if: always()
runs-on: macos-ctl
steps:
- name: Stop macOS VM container
run: docker stop macos

View File

@@ -1,43 +1,23 @@
name: Test (feature branches)
name: Validation (test + coverage)
on:
pull_request:
branches:
- "feature/*"
push:
branches-ignore:
- develop
- release
- main
jobs:
wake-macos-vm:
runs-on: macos-ctl
steps:
- name: Start macOS VM container
run: docker start macos
test:
needs: wake-macos-vm
runs-on: macos-release
runs-on: macos-build
steps:
- name: Checkout
- name: Checkout repository (workaround - Gitea git-upload-pack bug, see go-gitea/gitea#21819)
run: |
export GIT_TERMINAL_PROMPT=0
export GIT_ASKPASS=/bin/false
export SSH_ASKPASS=/bin/false
REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git"
AUTH_URL="$(echo "$REPO_URL" | sed "s#https://#https://x-access-token:${{ gitea.token }}@#")"
git -c credential.helper= -c http.lowSpeedLimit=1000 -c http.lowSpeedTime=30 clone "$AUTH_URL" .
git checkout "${{ gitea.sha }}"
curl -sSfL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-o /tmp/repo.tar.gz \
"${{ github.server_url }}/api/v1/repos/${{ github.repository }}/archive/${{ github.sha }}.tar.gz"
tar -xzf /tmp/repo.tar.gz --strip-components=1 -C "$GITHUB_WORKSPACE"
- name: Run unit tests
run: |
xcodebuild test \
-project PediFoods.xcodeproj \
-scheme "PediFoods" \
-destination "platform=iOS Simulator,name=iPhone 16,OS=latest"
sleep-macos-vm:
needs: test
if: always()
runs-on: macos-ctl
steps:
- name: Stop macOS VM container
run: docker stop macos
- name: Run tests with coverage
run: fastlane tests

1
.gitignore vendored
View File

@@ -66,3 +66,4 @@ Carthage/Build/
**/fastlane/README.md
**/fastlane/Preview.html
**/fastlane/test_output
.aider*

View File

@@ -36,7 +36,6 @@
2B202626C34FC9F5C87C0388 /* ApiOrderModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4625B70E3E8BEEB9D0B2042 /* ApiOrderModels.swift */; };
2F56755488E951C453AC2126 /* LCEssentials in Frameworks */ = {isa = PBXBuildFile; productRef = B8D5E8821C95A331C3A19DA1 /* LCEssentials */; };
2FCB3403A764AD74AC3BD47C /* LegalDocumentTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AA914FB8B32B106911FD67B /* LegalDocumentTests.swift */; };
901A6A5A00C18FC59F764B85 /* PublicStoreDistanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E55893DD92CBFB24F212454 /* PublicStoreDistanceTests.swift */; };
33AB0B87867400F3D0C65FA0 /* ApiClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DBC4B9B43C015C4DD411359 /* ApiClient.swift */; };
3689239282AADF06783CBBEA /* AuthFormatters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B3C375FC18002A884A44F1 /* AuthFormatters.swift */; };
3BD69E880EBC797B87EE547B /* StoreDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71DB74B676A58B367F026090 /* StoreDetailView.swift */; };
@@ -83,6 +82,7 @@
811217F88AA350A70CC22479 /* NotificationService.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C724E02EC34BB1D4352C2FF0 /* NotificationService.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
85EA52253BABA327EC07CFF0 /* AuthFormattersTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 561E00C486D60EC2DF720EAF /* AuthFormattersTests.swift */; };
8D6622AE9325D02B830BD115 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6CAA9B253B1A6C8815A0E69D /* LaunchScreen.storyboard */; };
901A6A5A00C18FC59F764B85 /* PublicStoreDistanceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E55893DD92CBFB24F212454 /* PublicStoreDistanceTests.swift */; };
90ADA376585F5438F3A1A1D6 /* HomeView+Favorites.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1517B141263438E466452037 /* HomeView+Favorites.swift */; };
918BCBC1EAD7EE134DB9742D /* CheckoutTypesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8FF15CEE5B137074E6B2489 /* CheckoutTypesTests.swift */; };
926E0C4DD3C82485D4262A62 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29B2F3558C58CD1E71F0F3A0 /* ContentView.swift */; };
@@ -211,6 +211,7 @@
4C415019CC1F314EE7318864 /* ApiCardModelsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiCardModelsTests.swift; sourceTree = "<group>"; };
4DC5416AEBA77C43CF55ABA8 /* PublicLocationPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicLocationPickerView.swift; sourceTree = "<group>"; };
4E0CCEF22D356F9EC723999D /* HomeView+Data.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HomeView+Data.swift"; sourceTree = "<group>"; };
4E55893DD92CBFB24F212454 /* PublicStoreDistanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicStoreDistanceTests.swift; sourceTree = "<group>"; };
507E868458359BE0E4FF25F1 /* ApiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiService.swift; sourceTree = "<group>"; };
52BFF93F21509F1AD4F6676B /* PediFoodsApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PediFoodsApp.swift; sourceTree = "<group>"; };
54795EDED987426386226358 /* GuestLocationStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuestLocationStoreTests.swift; sourceTree = "<group>"; };
@@ -251,7 +252,6 @@
89B662E8B7E1B8F1CF7E657E /* KeychainStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainStore.swift; sourceTree = "<group>"; };
8A3FB85A2A2E2952B9A2BAB0 /* DeepLinkDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinkDestination.swift; sourceTree = "<group>"; };
8AA914FB8B32B106911FD67B /* LegalDocumentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegalDocumentTests.swift; sourceTree = "<group>"; };
4E55893DD92CBFB24F212454 /* PublicStoreDistanceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicStoreDistanceTests.swift; sourceTree = "<group>"; };
8AF987AB319512C123DFD558 /* PediFoodsUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PediFoodsUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
8D2C6A0E85E133F947293181 /* OrderDetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderDetailsView.swift; sourceTree = "<group>"; };
8DD2B73D89E6D33643EF58F5 /* DeepLinkRouteEffectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeepLinkRouteEffectTests.swift; sourceTree = "<group>"; };
@@ -672,7 +672,7 @@
isa = PBXProject;
attributes = {
BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 2660;
TargetAttributes = {
66486D25E3A8A75EA8FACE44 = {
TestTargetID = B3B5CFF77A8ED019D1299ABB;
@@ -904,6 +904,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -937,6 +938,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -957,6 +959,7 @@
ONLY_ACTIVE_ARCH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
@@ -1133,7 +1136,9 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = K4E5BZMM4V;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = K4E5BZMM4V;
GENERATE_INFOPLIST_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1141,6 +1146,7 @@
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.br.pedifoods.PediFoodsUITests;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SWIFT_VERSION = 6;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -1152,6 +1158,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
@@ -1185,6 +1192,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -1198,6 +1206,7 @@
MTL_FAST_MATH = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
@@ -1208,7 +1217,9 @@
isa = XCBuildConfiguration;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
DEVELOPMENT_TEAM = K4E5BZMM4V;
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=macosx*]" = K4E5BZMM4V;
GENERATE_INFOPLIST_FILE = YES;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
@@ -1216,6 +1227,7 @@
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.br.pedifoods.PediFoodsUITests;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
SWIFT_VERSION = 6;
TARGETED_DEVICE_FAMILY = "1,2";

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
LastUpgradeVersion = "2660"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
@@ -55,8 +54,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
onlyGenerateCoverageForSpecifiedTargets = "NO">
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
@@ -88,8 +86,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
@@ -111,8 +107,6 @@
ReferencedContainer = "container:PediFoods.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
@@ -130,8 +124,6 @@
ReferencedContainer = "container:PediFoods.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">

View File

@@ -1,172 +0,0 @@
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
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
agvtool new-version -all $BITRISE_BUILD_NUMBER
- 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"
- platform: iOS
- 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
agvtool new-version -all $BITRISE_BUILD_NUMBER
- xcode-archive@5:
inputs:
- project_path: $BITRISE_PROJECT_PATH
- scheme: $BITRISE_SCHEME
- distribution_method: $BITRISE_DISTRIBUTION_METHOD
- automatic_code_signing: api-key
- platform: iOS
- 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

View File

@@ -3,6 +3,15 @@
default_platform(:ios)
lane :tests do
run_tests(
scheme: "PediFoods",
project: "PediFoods.xcodeproj",
clean: true,
code_coverage: true
)
end
lane :assemble do |options|
# Manual signing (team/identity/profile) for the "PediFoods" target is
# baked directly into PediFoods.xcodeproj's own project settings - not
@@ -15,7 +24,7 @@ lane :assemble do |options|
build_app(
scheme: "PediFoods",
sdk: "iphoneos",
export_method: ENV["BITRISE_DISTRIBUTION_METHOD"] || "app-store",
export_method: "app-store",
xcconfig: "fastlane/AppStore.xcconfig",
xcargs: xcargs,
derived_data_path: ".build/DerivedData",