-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Adding iOS workflow file. #342
- Loading branch information
1 parent
11f4552
commit ee23878
Showing
4 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Deploy iOS (Apple App Store) | ||
on: | ||
# Only trigger, when the "build" workflow succeeded (only works in the Master Branch) | ||
workflow_run: | ||
workflows: ["Build & Test"] | ||
types: | ||
- completed | ||
|
||
# Only trigger, when pushing into the `main` branch | ||
push: | ||
branches: [main] | ||
|
||
# DELETE THIS | ||
#pull_request: | ||
# branches: [ "main" ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-and-deploy_android: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
|
||
- name: ⬇️ Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: 🔐 Install Apple certificate and provisioning profile | ||
env: | ||
P12_DISTRIBUTION_CERTIFICATE_BASE64: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_BASE64 }}" | ||
P12_DISTRIBUTION_CERTIFICATE_PASSWORD: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_PASSWORD }}" | ||
DISTRIBUTION_PROVISIONING_PROFILE_BASE64: "${{ secrets.IOS_DISTRIBUTION_PROVISIONING_PROFILE_BASE64 }}" | ||
KEYCHAIN_PASSWORD: "${{ secrets.IOS_RUNNER_LOCAL_KEYCHAIN_PASSWORD }}" | ||
EXPORT_OPTIONS_BASE64: "${{ secrets.IOS_EXPORT_OPTIONS_BASE64 }}" | ||
run: | | ||
# create variables | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
PROVISIONING_PROFILE_PATH=$RUNNER_TEMP/build_pp.mobileprovision | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
EXPORT_OPTIONS_PATH="${{ github.workspace }}/app/ios/Runner/ExportOptions.plist" | ||
# import certificate, provisioning profile and export options from secrets | ||
echo -n "$P12_DISTRIBUTION_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | ||
echo -n "$DISTRIBUTION_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PROVISIONING_PROFILE_PATH | ||
echo -n "$EXPORT_OPTIONS_BASE64" | base64 --decode -o $EXPORT_OPTIONS_PATH | ||
# create temporary keychain | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
# import certificate to keychain | ||
security import $CERTIFICATE_PATH -P "$P12_DISTRIBUTION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
# apply provisioning profile | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PROVISIONING_PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles | ||
# Needed to run Flutter-based commands | ||
- name: 🐦 Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
# If the flutter version that is used in development increases, it's recommended this one increases as well | ||
flutter-version: "3.13.5" | ||
channel: "stable" | ||
id: flutter | ||
|
||
# Setting up Melos, which will | ||
#- name: ⚙️ Setup Melos | ||
# uses: bluefireteam/melos-action@v2 | ||
|
||
- name: 📚 Install dependencies | ||
run: flutter pub get | ||
|
||
- name: 🍏📦 Create iOS appbundle release | ||
run: | | ||
flutter build ipa \ | ||
--release \ | ||
--export-options-plist=ios/Runner/ExportOptions.plist | ||
--obfuscate \ | ||
--split-debug-info=${{ github.workspace }}/build/app/outputs/symbols | ||
- name: 🍏🚀 Deploy to App Store (Testflight) | ||
uses: apple-actions/upload-testflight-build@v1 | ||
with: | ||
app-path: ${{ github.workspace }}/app/build/ios/ipa/flutter_ci_cd_demo.ipa | ||
issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | ||
api-key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} | ||
api-private-key: ${{ secrets.APP_STORE_CONNECT_API_PRIVATE_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters