Skip to content

Trying to push build by xcode #117

Trying to push build by xcode

Trying to push build by xcode #117

Workflow file for this run

name: Publish to App Store Connect
on: push
# push:
# branches:
# - main
# workflow_dispatch:
jobs:
ios_deploy_testflight:
runs-on: macos-13
env:
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
APP_STORE_CONNECT_KEY_IDENTIFIER: ${{ secrets.APP_STORE_CONNECT_KEY_IDENTIFIER }}
APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY }}
APP_STORE_APP_ID: ${{ secrets.APP_STORE_APP_ID }}
DIST_CERTIFICATE: ${{ secrets.DIST_CERTIFICATE_BASE64 }}
DIST_CERTIFICATE_PASSWORD: ${{ secrets.DIST_CERTIFICATE_PASSWORD }}
DIST_PROFILE: ${{ secrets.DIST_PROFILE_BASE64 }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: Retrieve the secret and decode it to file
env:
FIREABSE_APP_ID_JSON_BASE64: ${{ secrets.FIREBASE_APP_ID_JSON_BASE64 }}
DESKTOP_CREDENTIALS_BASE64: ${{ secrets.DESKTOP_CREDENTIALS_BASE64 }}
FIREBASE_OPTIONS_BASE64: ${{ secrets.FIREBASE_OPTIONS_BASE64 }}
GOOGLE_SERVICES_PLIST_IOS_BASE64: ${{ secrets.GOOGLE_SERVICES_PLIST_IOS_BASE64 }}
run: |
echo $FIREABSE_APP_ID_JSON_BASE64 | base64 --decode > ios/firebase_app_id_file.json
echo $FIREBASE_OPTIONS_BASE64 | base64 --decode > lib/firebase_options.dart
echo $GOOGLE_SERVICES_PLIST_IOS_BASE64 | base64 --decode > ios/Runner/GoogleService-Info.plist
echo $DESKTOP_CREDENTIALS_BASE64 | base64 --decode > lib/desktop_credentials.dart
- name: Install dependencies
run: |
flutter pub get
- name: Install Codemagic CLI tools
run: pip install codemagic-cli-tools
- name: Set up keychain
run: keychain initialize
- name: Set up Provisioning Profiles
run: |
PROFILES_HOME="$HOME/Library/MobileDevice/Provisioning Profiles"
mkdir -p "$PROFILES_HOME"
PROFILE_PATH="$(mktemp "$PROFILES_HOME"/$(uuidgen).mobileprovision)"
echo ${DIST_PROFILE} | base64 --decode > "$PROFILE_PATH"
- name: Set up signing certificate
run: |
echo $DIST_CERTIFICATE | base64 --decode > /tmp/certificate.p12
keychain add-certificates --certificate /tmp/certificate.p12 --certificate-password $DIST_CERTIFICATE_PASSWORD
- name: Setup Code signing settings on Xcode project
run: xcode-project use-profiles
- name: Build ipa for Distribution
run: |
file='VERSION'
fileData=`cat $file`
IFS='.'
read -a versionValue <<< "$fileData"
buildNumber=$(( ${versionValue[0]} * 1000000 + ${versionValue[1]} * 10000 + ${{ github.run_number }} ))
IFS=''
buildName="${versionValue[0]}.${versionValue[1]}.${{ github.run_number }}"
echo "Uploading build $buildName"
cd ios
xcode-project build-ipa --project=Runner.xcodeproj --scheme="Runner" --export-options-plist=$HOME/export_options.plist
- name: Upload to App Store Connect
run: |
APP_FILE=$(find $(pwd) -name "*.ipa")
app-store-connect publish \
--path "$APP_FILE"