Update release pipelines to upload release artifacts

This commit is contained in:
Conrad Kramer 2024-03-16 10:40:09 -07:00
parent 4334f8c9c9
commit cb1bc1c8aa
52 changed files with 593 additions and 74 deletions

View file

@ -26,9 +26,12 @@ runs:
run: |
echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8
xcodebuild archive \
xcodebuild clean archive \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-skipPackagePluginValidation \
-skipMacroValidation \
-onlyUsePackageVersionsFromResolvedFile \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
@ -38,6 +41,4 @@ runs:
-archivePath '${{ inputs.archive-path }}' \
-resultBundlePath BuildResults.xcresult
./Tools/xcresulttool-github BuildResults.xcresult
rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8

View file

@ -18,7 +18,7 @@ inputs:
runs:
using: composite
steps:
- name: Cache Swift Packages
- name: Xcode Cache
uses: actions/cache@v3
with:
path: |

View file

@ -1,4 +1,4 @@
name: Notarize
name: Export
inputs:
app-store-key:
description: App Store key in PEM PKCS#8 format
@ -24,8 +24,7 @@ inputs:
runs:
using: composite
steps:
- id: notarize
shell: bash
- shell: bash
working-directory: Apple
run: |
echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8

58
.github/actions/notarize/action.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: Notarize
inputs:
app-store-key:
description: App Store key in PEM PKCS#8 format
required: true
app-store-key-id:
description: App Store key ID
required: true
app-store-key-issuer-id:
description: App Store key issuer ID
required: true
archive-path:
description: Xcode archive path
required: true
export-path:
description: The path to export the archive to
required: true
outputs:
notarized-app:
description: The compressed and notarized app
value: ${{ steps.notarize.outputs.notarized-app }}
runs:
using: composite
steps:
- id: notarize
shell: bash
working-directory: Apple
run: |
echo "${{ inputs.app-store-key }}" > AuthKey_${{ inputs.app-store-key-id }}.p8
echo '{"destination":"upload","method":"developer-id"}' \
| plutil -convert xml1 -o ExportOptions.plist -
xcodebuild \
-exportArchive \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
-archivePath '${{ inputs.archive-path }}' \
-exportOptionsPlist ExportOptions.plist
until xcodebuild \
-exportNotarizedApp \
-allowProvisioningUpdates \
-allowProvisioningDeviceRegistration \
-authenticationKeyID ${{ inputs.app-store-key-id }} \
-authenticationKeyIssuerID ${{ inputs.app-store-key-issuer-id }} \
-authenticationKeyPath "${PWD}/AuthKey_${{ inputs.app-store-key-id }}.p8" \
-archivePath '${{ inputs.archive-path }}' \
-exportPath ${{ inputs.export-path }}
do
echo "Failed to export app, trying again in 10s..."
sleep 10
done
rm -rf AuthKey_${{ inputs.app-store-key-id }}.p8 ExportOptions.plist

View file

@ -18,9 +18,6 @@ inputs:
runs:
using: composite
steps:
- shell: bash
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- shell: bash
working-directory: Apple
run: |
@ -28,10 +25,10 @@ runs:
-scheme '${{ inputs.scheme }}' \
-destination '${{ inputs.destination }}' \
${{ inputs.test-plan && '-testPlan ' }}${{ inputs.test-plan }} \
-resultBundlePath "${{ inputs.artifact-prefix }}-${{ steps.vars.outputs.sha_short }}.xcresult"
-resultBundlePath "${{ inputs.artifact-prefix }}.xcresult"
- uses: kishikawakatsumi/xcresulttool@v1
if: always()
with:
path: Apple/${{ inputs.artifact-prefix }}-${{ steps.vars.outputs.sha_short }}.xcresult
path: Apple/${{ inputs.artifact-prefix }}.xcresult
title: ${{ inputs.check-name }}
show-passed-tests: false