forked from eatvio/eatvio_app
fix(ci/cd): test-flight
This commit is contained in:
@@ -19,7 +19,6 @@ jobs:
|
||||
issuer-id: ${{ vars.APPSTORE_ISSUER_ID }}
|
||||
api-key-id: ${{ vars.APPSTORE_KEY_ID }}
|
||||
api-private-key: ${{ vars.APPSTORE_PRIVATE_KEY }}
|
||||
keychain-password: 1
|
||||
|
||||
- run: |
|
||||
chmod +x ./Build-tf
|
||||
|
||||
83
Build-tf
83
Build-tf
@@ -1,34 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/bash
|
||||
BUILD_NAME="1.0.0"
|
||||
BUILD_NUMBER="1"
|
||||
EXPORT_OPTIONS_PLIST="Support/ExportOptions.plist"
|
||||
|
||||
set -xeu
|
||||
set -o pipefail
|
||||
|
||||
export LANG=en_US.UTF-8
|
||||
LANG=en_US.UTF-8
|
||||
|
||||
function finish() {
|
||||
if [[ -d "${RESULT_BUNDLE_PATH}" ]]; then
|
||||
ditto -c -k --sequesterRsrc --keepParent "${RESULT_BUNDLE_PATH}" "${RESULT_BUNDLE_PATH}.zip"
|
||||
rm -rf "${RESULT_BUNDLE_PATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
trap finish EXIT
|
||||
|
||||
SDK="${SDK:-iphoneos}"
|
||||
WORKSPACE="${WORKSPACE:-ios/Runner.xcworkspace}"
|
||||
SCHEME="${SCHEME:-Runner}"
|
||||
CONFIGURATION="${CONFIGURATION:-Release}"
|
||||
|
||||
BUILD_DIR="${BUILD_DIR:-build}"
|
||||
ARTIFACT_PATH="${RESULT_PATH:-${BUILD_DIR}/Artifacts}"
|
||||
RESULT_BUNDLE_PATH="${ARTIFACT_PATH}/${SCHEME}.xcresult"
|
||||
ARCHIVE_PATH="${ARCHIVE_PATH:-${BUILD_DIR}/Archives/${SCHEME}.xcarchive}"
|
||||
DERIVED_DATA_PATH="${DERIVED_DATA_PATH:-${BUILD_DIR}/DerivedData}"
|
||||
CURRENT_PROJECT_VERSION="${BUILD_NUMBER:-0}"
|
||||
EXPORT_OPTIONS_FILE="Support/ExportOptions.plist"
|
||||
|
||||
# Clean and prepare the build
|
||||
flutter clean
|
||||
flutter pub get
|
||||
dart run build_runner build --delete-conflicting-outputs
|
||||
@@ -37,37 +11,28 @@ cd ios
|
||||
rm -rf Pods Podfile.lock
|
||||
pod install --repo-update
|
||||
pod update || { echo "Pod update failed"; exit 1; }
|
||||
cd ..
|
||||
echo "Building iOS IPA"
|
||||
|
||||
rm -rf "${RESULT_BUNDLE_PATH}" "${DERIVED_DATA_PATH}"
|
||||
mkdir -p "${ARTIFACT_PATH}"
|
||||
flutter build ipa \
|
||||
--build-name="$BUILD_NAME" \
|
||||
--build-number="$BUILD_NUMBER" \
|
||||
--export-options-plist="$EXPORT_OPTIONS_PLIST" \
|
||||
--release \
|
||||
-v
|
||||
|
||||
# Archive the build
|
||||
xcrun xcodebuild \
|
||||
-workspace "${WORKSPACE}" \
|
||||
-scheme "${SCHEME}" \
|
||||
-configuration "${CONFIGURATION}" \
|
||||
-sdk "${SDK}" \
|
||||
-parallelizeTargets \
|
||||
-showBuildTimingSummary \
|
||||
-derivedDataPath "${DERIVED_DATA_PATH}" \
|
||||
-archivePath "${ARCHIVE_PATH}" \
|
||||
-resultBundlePath "${RESULT_BUNDLE_PATH}" \
|
||||
-allowProvisioningUpdates \
|
||||
CURRENT_PROJECT_VERSION="${CURRENT_PROJECT_VERSION}" \
|
||||
DEVELOPMENT_TEAM=VL68C36HYS \
|
||||
archive || { echo "Xcode archive failed"; exit 1; }
|
||||
BUILD_RESULT=$?
|
||||
echo "Build exit code: $BUILD_RESULT"
|
||||
echo "Contents of build directory:"
|
||||
ls -R build/ios/
|
||||
|
||||
# Export the build to .ipa
|
||||
xcrun xcodebuild \
|
||||
-exportArchive \
|
||||
-exportOptionsPlist "${EXPORT_OPTIONS_FILE}" \
|
||||
-archivePath "${ARCHIVE_PATH}" \
|
||||
-exportPath "${ARTIFACT_PATH}/${SCHEME}.ipa" || { echo "Export to IPA failed"; exit 1; }
|
||||
|
||||
# Zip the archive
|
||||
if [[ -d "${ARCHIVE_PATH}" ]]; then
|
||||
ditto -c -k --sequesterRsrc --keepParent "${ARCHIVE_PATH}" "${ARTIFACT_PATH}/${SCHEME}.xcarchive.zip"
|
||||
if [ $BUILD_RESULT -eq 0 ]; then
|
||||
echo "Build completed successfully!"
|
||||
echo "IPA file location: ./build/ios/ipa/"
|
||||
else
|
||||
echo "Archive directory not found, skipping zip."
|
||||
echo "Build failed!"
|
||||
echo "Please ensure:"
|
||||
echo "1. Valid provisioning profile is configured in Xcode"
|
||||
echo "2. exportOptions.plist contains correct provisioning profile information"
|
||||
echo "3. Signing certificates are properly installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -8,19 +8,20 @@
|
||||
<true/>
|
||||
<key>method</key>
|
||||
<string>app-store</string>
|
||||
<key>provisioningProfiles</key>
|
||||
<dict>
|
||||
<key>com.eatvioapp.app</key>
|
||||
<string>Distribution</string>
|
||||
</dict>
|
||||
<key>signingCertificate</key>
|
||||
<string>Apple Distribution: ITVIO, OOO (VL68C36HYS)</string>
|
||||
<key>signingStyle</key>
|
||||
<string>automatic</string>
|
||||
<string>automatic</string>
|
||||
<key>stripSwiftSymbols</key>
|
||||
<true/>
|
||||
<key>uploadSymbols</key>
|
||||
<true/>
|
||||
<key>teamID</key>
|
||||
<string>VL68C36HYS</string>
|
||||
<key>teamName</key>
|
||||
<string>ITVIO, OOO</string>
|
||||
<key>bundleIdentifier</key>
|
||||
<string>com.eatvioapp.app</string>
|
||||
<key>automaticallyManageSigning</key>
|
||||
<true/>
|
||||
<string>VL68C36HYS</string>
|
||||
</dict>
|
||||
</plist>
|
||||
</plist>
|
||||
Reference in New Issue
Block a user