1212
1313jobs :
1414 test-ios :
15- runs-on : macos-13
15+ runs-on : macos-14
1616 defaults :
1717 run :
1818 working-directory : " ./example"
@@ -21,11 +21,14 @@ jobs:
2121 - uses : actions/setup-node@v4
2222 with :
2323 node-version-file : " ./.tool-versions"
24- - run : sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
24+ # Xcode_16.2.app is available, but it does not have any simulator pre-installed.
25+ # So it is not really usable.
26+ # Let's use Xcode_16.1.app instead.
27+ - run : sudo xcode-select -s /Applications/Xcode_16.1.app/Contents/Developer
2528 - uses : subosito/flutter-action@v2
2629 with :
2730 # This has to be kept in sync with .tool-versions
28- flutter-version : ' 3.24.2 '
31+ flutter-version : ' 3.27.1 '
2932 channel : ' stable'
3033 # This action takes 1m30s to finish. Enable cache to make it shorter.
3134 cache : true
3639 - run : flutter build ipa --no-codesign
3740
3841 test-android :
39- runs-on : macos-13
42+ runs-on : macos-14
4043 defaults :
4144 run :
4245 working-directory : " ./example"
@@ -45,14 +48,14 @@ jobs:
4548 - uses : actions/setup-node@v4
4649 with :
4750 node-version-file : " ./.tool-versions"
48- # https://github.com/actions/runner-images/blob/main/images/macos/macos-13 -Readme.md#java
51+ # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64 -Readme.md#java
4952 - name : Set java version
5053 run : |
51- echo "JAVA_HOME=$JAVA_HOME_17_X64 " >> $GITHUB_ENV
54+ echo "JAVA_HOME=$JAVA_HOME_21_arm64 " >> $GITHUB_ENV
5255 - uses : subosito/flutter-action@v2
5356 with :
5457 # This has to be kept in sync with .tool-versions
55- flutter-version : ' 3.24.2 '
58+ flutter-version : ' 3.27.1 '
5659 channel : ' stable'
5760 # This action takes 1m30s to finish. Enable cache to make it shorter.
5861 cache : true
7174 - uses : subosito/flutter-action@v2
7275 with :
7376 # This has to be kept in sync with .tool-versions
74- flutter-version : ' 3.24.2 '
77+ flutter-version : ' 3.27.1 '
7578 channel : ' stable'
7679 # This action takes 1m30s to finish. Enable cache to make it shorter.
7780 cache : true
9396 publish_dir : ./doc/api
9497
9598 deploy-ios :
96- runs-on : macos-13
99+ runs-on : macos-14
97100 needs : ["test-ios"]
98- if : ${{ github.ref == 'refs/heads/main' }}
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' }}
99103 defaults :
100104 run :
101105 working-directory : " ./example"
@@ -104,12 +108,15 @@ jobs:
104108 - uses : actions/setup-node@v4
105109 with :
106110 node-version-file : " ./.tool-versions"
107- - run : sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
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
108115 - run : npm install -g appcenter-cli
109116 - uses : subosito/flutter-action@v2
110117 with :
111118 # This has to be kept in sync with .tool-versions
112- flutter-version : ' 3.24.2 '
119+ flutter-version : ' 3.27.1 '
113120 channel : ' stable'
114121 # This action takes 1m30s to finish. Enable cache to make it shorter.
115122 cache : true
@@ -119,23 +126,31 @@ jobs:
119126 - run : dart format --set-exit-if-changed lib
120127 - name : Prepare certificate and provisioning profile
121128 env :
129+ IOS_CERTIFICATE_PASSWORD : ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
122130 IOS_CERTIFICATE_BASE64 : ${{ secrets.IOS_CERTIFICATE_BASE64 }}
123131 IOS_PROVISIONING_PROFILE_BASE64 : ${{ secrets.IOS_PROVISIONING_PROFILE_BASE64 }}
132+ IOS_KEYCHAIN_PASSWORD : ${{ secrets.IOS_KEYCHAIN_PASSWORD }}
124133 run : |
125134 CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
126135 PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
127136 KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
128137
138+ # import certificate and provisioning profile from secrets
129139 echo -n "$IOS_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
140+
130141 echo -n "$IOS_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PP_PATH
131142
132- security create-keychain -p "" $KEYCHAIN_PATH
133- security set-keychain-settings $KEYCHAIN_PATH
134- security unlock-keychain -p "" $KEYCHAIN_PATH
143+ # create temporary keychain
144+ security create-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
145+ security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
146+ security unlock-keychain -p "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
135147
136- security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
148+ # import certificate to keychain
149+ security import $CERTIFICATE_PATH -P "$IOS_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
150+ security set-key-partition-list -S apple-tool:,apple: -k "$IOS_KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
137151 security list-keychain -d user -s $KEYCHAIN_PATH
138152
153+ # apply provisioning profile
139154 mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
140155 cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
141156 - name : Build .ipa
@@ -148,9 +163,10 @@ jobs:
148163 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"
149164
150165 deploy-android :
151- runs-on : macos-13
166+ runs-on : macos-14
152167 needs : ["test-android"]
153- if : ${{ github.ref == 'refs/heads/main' }}
168+ # We cannot build in PRs because secrets are not available in PRs.
169+ if : ${{ github.repository == 'authgear/authgear-sdk-flutter' && github.ref == 'refs/heads/main' }}
154170 defaults :
155171 run :
156172 working-directory : " ./example"
@@ -159,15 +175,15 @@ jobs:
159175 - uses : actions/setup-node@v4
160176 with :
161177 node-version-file : " ./.tool-versions"
162- # https://github.com/actions/runner-images/blob/main/images/macos/macos-13 -Readme.md#java
178+ # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64 -Readme.md#java
163179 - name : Set java version
164180 run : |
165- echo "JAVA_HOME=$JAVA_HOME_17_X64 " >> $GITHUB_ENV
181+ echo "JAVA_HOME=$JAVA_HOME_21_arm64 " >> $GITHUB_ENV
166182 - run : npm install -g appcenter-cli
167183 - uses : subosito/flutter-action@v2
168184 with :
169185 # This has to be kept in sync with .tool-versions
170- flutter-version : ' 3.24.2 '
186+ flutter-version : ' 3.27.1 '
171187 channel : ' stable'
172188 # This action takes 1m30s to finish. Enable cache to make it shorter.
173189 cache : true
0 commit comments