|
| 1 | +name: Notarize |
| 2 | +inputs: |
| 3 | + app-store-key: |
| 4 | + description: App Store key in PEM PKCS#8 format |
| 5 | + required: true |
| 6 | + app-store-key-id: |
| 7 | + description: App Store key ID |
| 8 | + required: true |
| 9 | + app-store-key-issuer-id: |
| 10 | + description: App Store key issuer ID |
| 11 | + required: true |
| 12 | + archive-path: |
| 13 | + description: Xcode archive path |
| 14 | + required: true |
| 15 | + export-path: |
| 16 | + description: The path to export the archive to |
| 17 | + required: true |
| 18 | +outputs: |
| 19 | + notarized-app: |
| 20 | + description: The compressed and notarized app |
| 21 | + value: ${{ steps.notarize.outputs.notarized-app }} |
| 22 | +runs: |
| 23 | + using: composite |
| 24 | + steps: |
| 25 | + - id: notarize |
| 26 | + shell: bash |
| 27 | + working-directory: Apple |
| 28 | + run: | |
| 29 | + echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8 |
| 30 | +
|
| 31 | + echo '{"destination":"upload","method":"developer-id"}' \ |
| 32 | + | plutil -convert xml1 -o ExportOptions.plist - |
| 33 | +
|
| 34 | + xcodebuild \ |
| 35 | + -exportArchive \ |
| 36 | + -allowProvisioningUpdates \ |
| 37 | + -allowProvisioningDeviceRegistration \ |
| 38 | + -authenticationKeyID ${{ inputs.app-store-key-id }} \ |
| 39 | + -authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \ |
| 40 | + -authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \ |
| 41 | + -archivePath '${{ inputs.archive-path }}' \ |
| 42 | + -exportOptionsPlist ExportOptions.plist |
| 43 | +
|
| 44 | + until xcodebuild \ |
| 45 | + -exportNotarizedApp \ |
| 46 | + -allowProvisioningUpdates \ |
| 47 | + -allowProvisioningDeviceRegistration \ |
| 48 | + -authenticationKeyID ${{ inputs.app-store-key-id }} \ |
| 49 | + -authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \ |
| 50 | + -authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \ |
| 51 | + -archivePath '${{ inputs.archive-path }}' \ |
| 52 | + -exportPath ${{ inputs.export-path }} |
| 53 | + do |
| 54 | + echo "Failed to export app, trying again in 10s..." |
| 55 | + sleep 10 |
| 56 | + done |
| 57 | +
|
| 58 | + rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8 ExportOptions.plist |
0 commit comments