|
1 | 1 | name: CD
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - push: |
5 |
| - branches: [cd] |
6 | 4 | schedule:
|
7 |
| - - cron: '0 1 * * *' |
| 5 | + - cron: '32 1 * * *' |
8 | 6 | workflow_dispatch:
|
9 | 7 | release:
|
10 | 8 | types: [published]
|
@@ -170,45 +168,15 @@ jobs:
|
170 | 168 | APPLE_STORE_AUTH_KEY_PATH: ${{ env.APPLE_STORE_AUTH_KEY_PATH }}
|
171 | 169 | APPLE_STORE_AUTH_KEY_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ID }}
|
172 | 170 | APPLE_STORE_AUTH_KEY_ISSUER_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}
|
173 |
| - |
174 |
| - run: xcrun xcodebuild -exportArchive -archivePath $PWD/Kiwix-$VERSION.xcarchive -exportPath $PWD/export/ -exportOptionsPlist export.plist -authenticationKeyPath $APPLE_STORE_AUTH_KEY_PATH -allowProvisioningUpdates -authenticationKeyID $APPLE_STORE_AUTH_KEY_ID -authenticationKeyIssuerID $APPLE_STORE_AUTH_KEY_ISSUER_ID |
| 171 | + run: python .github/retry-if-retcode.py --sleep 60 --attempts 5 --retcode 70 xcrun xcodebuild -exportArchive -archivePath $PWD/Kiwix-$VERSION.xcarchive -exportPath $PWD/export/ -exportOptionsPlist export.plist -authenticationKeyPath $APPLE_STORE_AUTH_KEY_PATH -allowProvisioningUpdates -authenticationKeyID $APPLE_STORE_AUTH_KEY_ID -authenticationKeyIssuerID $APPLE_STORE_AUTH_KEY_ISSUER_ID |
175 | 172 |
|
176 | 173 | - name: Export notarized App from archive
|
177 | 174 | if: ${{ matrix.destination.uploadto == 'dmg' }}
|
178 | 175 | env:
|
179 | 176 | APPLE_STORE_AUTH_KEY_PATH: ${{ env.APPLE_STORE_AUTH_KEY_PATH }}
|
180 | 177 | APPLE_STORE_AUTH_KEY_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ID }}
|
181 | 178 | APPLE_STORE_AUTH_KEY_ISSUER_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ISSUER_ID }}
|
182 |
| - run: | |
183 |
| - set +e |
184 |
| - attempts=0 |
185 |
| - retcode=-1 |
186 |
| - until [[ $retcode -eq 0 ]] |
187 |
| - do |
188 |
| - ((attempts++)) |
189 |
| - xcrun xcodebuild -exportNotarizedApp -archivePath $PWD/Kiwix-$VERSION.xcarchive -exportPath $PWD/export/ -authenticationKeyPath $APPLE_STORE_AUTH_KEY_PATH -allowProvisioningUpdates -authenticationKeyID $APPLE_STORE_AUTH_KEY_ID -authenticationKeyIssuerID $APPLE_STORE_AUTH_KEY_ISSUER_ID |
190 |
| - retcode=$? |
191 |
| -
|
192 |
| - if [[ $retcode -eq 0 ]] |
193 |
| - then |
194 |
| - echo "Export suceedeed" |
195 |
| - break |
196 |
| - fi |
197 |
| -
|
198 |
| - if [[ ! $retcode -eq 65 ]] |
199 |
| - then |
200 |
| - echo "Non-65 exit-code, propagating: {$retcode}" |
201 |
| - return $retcode |
202 |
| - fi |
203 |
| -
|
204 |
| - if [[ $attempts -ge 20 ]] |
205 |
| - then |
206 |
| - echo "Too many attempts (${attempts}), exiting ${retcode}" |
207 |
| - return $retcode |
208 |
| - fi |
209 |
| - echo "Not notarized ; retrying in a minute" |
210 |
| - sleep 60 |
211 |
| - done |
| 179 | + run: python .github/retry-if-retcode.py --sleep 60 --attempts 20 --retcode 65 xcrun xcodebuild -exportNotarizedApp -archivePath $PWD/Kiwix-$VERSION.xcarchive -exportPath $PWD/export/ -authenticationKeyPath $APPLE_STORE_AUTH_KEY_PATH -allowProvisioningUpdates -authenticationKeyID $APPLE_STORE_AUTH_KEY_ID -authenticationKeyIssuerID $APPLE_STORE_AUTH_KEY_ISSUER_ID |
212 | 180 |
|
213 | 181 | - name: Create DMG
|
214 | 182 | if: ${{ matrix.destination.uploadto == 'dmg' }}
|
|
0 commit comments