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 }}
|
issuer-id: ${{ vars.APPSTORE_ISSUER_ID }}
|
||||||
api-key-id: ${{ vars.APPSTORE_KEY_ID }}
|
api-key-id: ${{ vars.APPSTORE_KEY_ID }}
|
||||||
api-private-key: ${{ vars.APPSTORE_PRIVATE_KEY }}
|
api-private-key: ${{ vars.APPSTORE_PRIVATE_KEY }}
|
||||||
keychain-password: 1
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
chmod +x ./Build-tf
|
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 clean
|
||||||
flutter pub get
|
flutter pub get
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
dart run build_runner build --delete-conflicting-outputs
|
||||||
@@ -37,37 +11,28 @@ cd ios
|
|||||||
rm -rf Pods Podfile.lock
|
rm -rf Pods Podfile.lock
|
||||||
pod install --repo-update
|
pod install --repo-update
|
||||||
pod update || { echo "Pod update failed"; exit 1; }
|
pod update || { echo "Pod update failed"; exit 1; }
|
||||||
cd ..
|
echo "Building iOS IPA"
|
||||||
|
|
||||||
rm -rf "${RESULT_BUNDLE_PATH}" "${DERIVED_DATA_PATH}"
|
flutter build ipa \
|
||||||
mkdir -p "${ARTIFACT_PATH}"
|
--build-name="$BUILD_NAME" \
|
||||||
|
--build-number="$BUILD_NUMBER" \
|
||||||
|
--export-options-plist="$EXPORT_OPTIONS_PLIST" \
|
||||||
|
--release \
|
||||||
|
-v
|
||||||
|
|
||||||
# Archive the build
|
BUILD_RESULT=$?
|
||||||
xcrun xcodebuild \
|
echo "Build exit code: $BUILD_RESULT"
|
||||||
-workspace "${WORKSPACE}" \
|
echo "Contents of build directory:"
|
||||||
-scheme "${SCHEME}" \
|
ls -R build/ios/
|
||||||
-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; }
|
|
||||||
|
|
||||||
# Export the build to .ipa
|
if [ $BUILD_RESULT -eq 0 ]; then
|
||||||
xcrun xcodebuild \
|
echo "Build completed successfully!"
|
||||||
-exportArchive \
|
echo "IPA file location: ./build/ios/ipa/"
|
||||||
-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"
|
|
||||||
else
|
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
|
fi
|
||||||
|
|||||||
@@ -8,19 +8,20 @@
|
|||||||
<true/>
|
<true/>
|
||||||
<key>method</key>
|
<key>method</key>
|
||||||
<string>app-store</string>
|
<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>
|
<key>signingStyle</key>
|
||||||
<string>automatic</string>
|
<string>automatic</string>
|
||||||
<key>stripSwiftSymbols</key>
|
<key>stripSwiftSymbols</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>uploadSymbols</key>
|
<key>uploadSymbols</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>teamID</key>
|
<key>teamID</key>
|
||||||
<string>VL68C36HYS</string>
|
<string>VL68C36HYS</string>
|
||||||
<key>teamName</key>
|
|
||||||
<string>ITVIO, OOO</string>
|
|
||||||
<key>bundleIdentifier</key>
|
|
||||||
<string>com.eatvioapp.app</string>
|
|
||||||
<key>automaticallyManageSigning</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
Reference in New Issue
Block a user