1313jobs :
1414 test-ios :
1515 runs-on : macos-14
16- defaults :
17- run :
18- working-directory : " ./example"
1916 steps :
2017 - uses : actions/checkout@v4
21- - uses : actions /setup-node@v4
18+ - uses : ruby /setup-ruby@v1
2219 with :
23- node-version-file : " ./.tool-versions "
20+ bundler-cache : true
2421 # Xcode_16.2.app is available, but it does not have any simulator pre-installed.
2522 # So it is not really usable.
2623 # Let's use Xcode_16.1.app instead.
27- - run : sudo xcode-select -s /Applications/Xcode_16.1 .app/Contents/Developer
24+ - run : sudo xcode-select -s /Applications/Xcode_16.2 .app/Contents/Developer
2825 - uses : subosito/flutter-action@v2
2926 with :
3027 # This has to be kept in sync with .tool-versions
3128 flutter-version : ' 3.27.1'
3229 channel : ' stable'
3330 # This action takes 1m30s to finish. Enable cache to make it shorter.
3431 cache : true
35- - run : flutter pub get
36- - run : flutter test
37- - run : flutter analyze --no-fatal-infos
38- - run : dart format --set-exit-if-changed lib
39- - run : flutter build ipa --no-codesign
32+ - run : make example-flutter-pub-get
33+ - run : make example-flutter-test
34+ - run : make example-flutter-analyze
35+ - run : make example-dart-format
36+ - run : make example-pod-install
37+ - run : make example-build-unsigned-ios-app
4038
4139 test-android :
4240 runs-on : macos-14
43- defaults :
44- run :
45- working-directory : " ./example"
4641 steps :
4742 - uses : actions/checkout@v4
48- - uses : actions /setup-node@v4
43+ - uses : ruby /setup-ruby@v1
4944 with :
50- node-version-file : " ./.tool-versions "
45+ bundler-cache : true
5146 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#java
5247 - name : Set java version
5348 run : |
@@ -60,10 +55,10 @@ jobs:
6055 # This action takes 1m30s to finish. Enable cache to make it shorter.
6156 cache : true
6257 - run : echo "$ANDROID_HOME/tools/bin" >> $GITHUB_PATH
63- - run : flutter pub get
64- - run : flutter test
65- - run : flutter analyze --no-fatal-infos
66- - run : dart format --set-exit-if-changed lib
58+ - run : make example-flutter- pub- get
59+ - run : make example-flutter- test
60+ - run : make example-flutter-analyze
61+ - run : make example-dart-format
6762 - run : flutter build apk --debug
6863
6964 deploy-docs :
@@ -78,52 +73,42 @@ jobs:
7873 channel : ' stable'
7974 # This action takes 1m30s to finish. Enable cache to make it shorter.
8075 cache : true
81- - run : flutter pub get
82- - run : flutter test
83- - run : flutter analyze --no-fatal-infos
84- - run : dart format --set-exit-if-changed lib
76+ - run : make sdk-flutter- pub- get
77+ - run : make sdk-flutter- test
78+ - run : make sdk-flutter-analyze
79+ - run : make sdk-dart-format
8580 # Install the latest dartdoc to avoid a bug
8681 # See DEVELOPER.md
8782 - run : flutter pub global activate dartdoc
88- if : ${{ github.ref == 'refs/heads/main' }}
8983 - run : flutter pub global run dartdoc
90- if : ${{ github.ref == 'refs/heads/main' }}
9184 - name : Deploy docs to gh-pages
9285 uses : peaceiris/actions-gh-pages@v3
93- if : ${{ github.ref == 'refs/heads/main' }}
86+ if : ${{ github.repository == 'authgear/authgear-sdk-flutter' && github. ref == 'refs/heads/main' }}
9487 with :
9588 github_token : ${{ secrets.GITHUB_TOKEN }}
9689 publish_dir : ./doc/api
9790
9891 deploy-ios :
9992 runs-on : macos-14
10093 needs : ["test-ios"]
101- # We cannot build in PRs because secrets are not available in PRs.
102- if : ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }}
103- defaults :
104- run :
105- working-directory : " ./example"
94+ if : ${{ github.repository == 'authgear/authgear-sdk-flutter' }}
10695 steps :
10796 - uses : actions/checkout@v4
108- - uses : actions /setup-node@v4
97+ - uses : ruby /setup-ruby@v1
10998 with :
110- node-version-file : " ./.tool-versions"
111- # Xcode_16.2.app is available, but it does not have any simulator pre-installed.
112- # So it is not really usable.
113- # Let's use Xcode_16.1.app instead.
114- - run : sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
115- - run : npm install -g appcenter-cli
99+ bundler-cache : true
100+ - run : sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer
116101 - uses : subosito/flutter-action@v2
117102 with :
118103 # This has to be kept in sync with .tool-versions
119104 flutter-version : ' 3.27.1'
120105 channel : ' stable'
121106 # This action takes 1m30s to finish. Enable cache to make it shorter.
122107 cache : true
123- - run : flutter pub get
124- - run : flutter test
125- - run : flutter analyze --no-fatal-infos
126- - run : dart format --set-exit-if-changed lib
108+ - run : make example-flutter- pub- get
109+ - run : make example-flutter- test
110+ - run : make example-flutter-analyze
111+ - run : make example-dart-format
127112 - name : Prepare certificate and provisioning profile
128113 env :
129114 IOS_CERTIFICATE_PASSWORD : ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
@@ -153,14 +138,29 @@ jobs:
153138 # apply provisioning profile
154139 mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
155140 cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
156- - name : Build .ipa
141+ - name : Install App Store Connect API key
142+ env :
143+ IOS_API_KEY_BASE64 : ${{ secrets.IOS_API_KEY_BASE64 }}
144+ IOS_API_KEY_ID : ${{ secrets.IOS_API_KEY_ID }}
157145 run : |
158- BUILD_NUMBER=$(date +%s)
159- flutter build ipa --export-options-plist ./exportOptions.plist --build-number $BUILD_NUMBER
160- - name : Distribute to App Center
146+ API_KEY_PATH=$RUNNER_TEMP/AuthKey_${IOS_API_KEY_ID}.p8
147+ echo -n "$IOS_API_KEY_BASE64" | base64 --decode -o $API_KEY_PATH
148+ - name : Create fastlane api key json
161149 env :
162- APPCENTER_ACCESS_TOKEN : ${{ secrets.IOS_APPCENTER_ACCESS_TOKEN }}
163- run : appcenter distribute release --debug --silent --file "./build/ios/ipa/Authgear Flutter.ipa" --store "App Store Connect Users" --app "Oursky/Authgear-Demo-Flutter-iOS" --release-notes "no release notes"
150+ API_ISSUER : ${{ secrets.IOS_API_KEY_ISSUER }}
151+ API_KEY : ${{ secrets.IOS_API_KEY_ID }}
152+ run : |
153+ export API_KEY_PATH=$RUNNER_TEMP/AuthKey_${API_KEY}.p8
154+ make fastlane-api-key-json
155+ - run : make example-build-ios-app
156+ - name : Upload to TestFlight
157+ if : ${{ github.ref == 'refs/heads/main' }}
158+ run : make example-upload-ios-app
159+ - name : Clean up keychain and provisioning profile
160+ if : ${{ always() }}
161+ run : |
162+ security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
163+ rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
164164
165165 deploy-android :
166166 runs-on : macos-14
0 commit comments