Skip to content

Instantly share code, notes, and snippets.

@GAM3RG33K
Created May 28, 2021 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GAM3RG33K/343cd894585b88a6439a2d7f68090b13 to your computer and use it in GitHub Desktop.
Save GAM3RG33K/343cd894585b88a6439a2d7f68090b13 to your computer and use it in GitHub Desktop.
Codemagic configuration file for iOS
workflows:
ios-workflow:
name: iOS Workflow
max_build_duration: 30
environment:
vars:
XCODE_WORKSPACE: "Runner.xcworkspace"
XCODE_SCHEME: "Runner"
# https://docs.codemagic.io/code-signing-yaml/signing-ios/
# Put your bundle id here
BUNDLE_ID: APP_BUNDLE_IDENTIFIER
# Put your encrypted App Store Connect Issuer Id here
APP_STORE_CONNECT_ISSUER_ID: Encrypted(...)
# Put your encrypted App Store Connect Key Identifier here
APP_STORE_CONNECT_KEY_IDENTIFIER: Encrypted(...)
# Put your encrypted App Store Connect Private Key here
APP_STORE_CONNECT_PRIVATE_KEY: Encrypted(...)
# Put your encrypted Certificate Private Key here
CERTIFICATE_PRIVATE_KEY: Encrypted(...)
# Put your encrypted Apple Id email address here
APPLE_ID: Encrypted(...)
# Put your encrypted App Specific password here
APPLE_APP_SPECIFIC_PASSWORD: Encrypted(...)
# APP_STORE_ID: APP_STORE_ID # <-- Use the TestFlight Apple id number (An automatically generated ID assigned to your app) found under General > App Information > Apple ID.
flutter: 2.0.2
xcode: latest
cocoapods: default
scripts:
- name: Set up keychain to be used for codesigning using Codemagic CLI 'keychain' command
script: |
keychain initialize
- name: Fetch signing files
script: |
app-store-connect fetch-signing-files $BUNDLE_ID --type IOS_APP_STORE --create
- name: Use system default keychain
script: |
keychain add-certificates
- name: Set up code signing settings on Xcode project
script: |
xcode-project use-profiles
- name: Get Flutter packages
script: |
cd . && flutter packages pub get
- name: Flutter build ipa
# $BUILD_NUMBER refers to current build index of codemagic, including the running ones if in parellel
script: |
flutter build ipa --release \
--build-number=$(($BUILD_NUMBER + 7)) \
--export-options-plist=/Users/builder/export_options.plist -v
artifacts:
- build/ios/ipa/*.ipa
- /tmp/xcodebuild_logs/*.log
- flutter_drive.log
publishing:
email:
recipients:
# mentioned emails will get the notification with the ipa file link, that can be installed directly in iOS devices
- user@example.com
notify:
# To receive a notification when a build succeeds
success: true
# To not receive a notification when a build fails
failure: false
app_store_connect:
apple_id: $APPLE_ID
password: $APPLE_APP_SPECIFIC_PASSWORD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment