@@ -79,29 +79,38 @@ jobs:
79
79
working-directory : ./packages/flutter_test_runners/example_deep_links
80
80
81
81
steps :
82
- - name : Decode Provisioning Profile and Certificate
83
- working-directory : ~
82
+ - name : Install the Apple certificate and provisioning profile
84
83
env :
85
- PROVISIONING_PROFILE : ${{ secrets.PROVISIONING_PROFILE }}
86
- SIGNING_CERTIFICATE : ${{ secrets.SIGNING_CERTIFICATE }}
84
+ BUILD_CERTIFICATE_BASE64 : ${{ secrets.SIGNING_CERTIFICATE }}
85
+ P12_PASSWORD : ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
86
+ BUILD_PROVISION_PROFILE_BASE64 : ${{ secrets.PROVISIONING_PROFILE }}
87
+ EXPORT_OPTIONS_PLIST : ${{ secrets.EXPORT_OPTIONS_PLIST }}
87
88
run : |
88
- echo "$PROVISIONING_PROFILE" | base64 --decode > provisioning.mobileprovision
89
- echo "$SIGNING_CERTIFICATE" | base64 --decode > certificate.p12
90
-
91
- - name : Install Certificate and Provisioning Profile
92
- working-directory : ~
93
- env :
94
- SIGNING_CERTIFICATE_PASSWORD : ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
95
- run : |
96
- # Install the signing certificate
97
- security import certificate.p12 -k ~/Library/Keychains/login.keychain-db -P "$SIGNING_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
89
+ # create variables
90
+ CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
91
+ PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
92
+ KEYCHAIN_PATH=~/Library/Keychains/login.keychain-db
93
+
94
+ # import certificate and provisioning profile from secrets
95
+ echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
96
+ echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH
98
97
99
- # Move the provisioning profile to the correct location
98
+ # create temporary keychain
99
+ #security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
100
+ #security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
101
+ #security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
102
+
103
+ # import certificate to keychain
104
+ security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
105
+ security list-keychain -d user -s $KEYCHAIN_PATH
106
+
107
+ # apply provisioning profile
100
108
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
101
- mv provisioning.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/
102
-
103
- # Verify the certificate
104
- security find-identity -p codesigning -v
109
+ cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
110
+
111
+ # Save ExportOptions.plist from Base64 to file
112
+ EXPORT_OPTS_PATH=$RUNNER_TEMP/ExportOptions.plist
113
+ echo -n "$EXPORT_OPTIONS_PLIST" | base64 --decode -o $EXPORT_OPTS_PATH
105
114
106
115
- name : Checkout repository
107
116
uses : actions/checkout@v3
@@ -134,7 +143,7 @@ jobs:
134
143
run : flutter pub get
135
144
136
145
- name : Build iOS App
137
- run : flutter build ios --debug
146
+ run : flutter build ios --debug --export-options-plist=$EXPORT_OPTS_PATH
138
147
139
148
- name : Install iOS App
140
149
run : flutter install ipa
0 commit comments