Skip to content

Commit

Permalink
Manage provisioning profiles automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
danylokos committed Sep 12, 2023
1 parent 9740d77 commit 9d3e0b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
13 changes: 11 additions & 2 deletions .github/actions/build-archive-upload/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ runs:
id: build
env:
scheme: ${{ inputs.scheme }}
platform: ${{ inputs.platform }}
auth_key_issuer_id: ${{ inputs.auth_key_issuer_id }}
auth_key_id: ${{ inputs.auth_key_id }}
auth_key_path: ${{ inputs.auth_key_path }}
build_settings: ${{ inputs.build_settings }}
shell: bash
run: |
Expand All @@ -34,7 +38,12 @@ runs:
xcodebuild clean build archive \
-scheme "$scheme" \
-archivePath "$archive_file" \
"$build_settings" | xcpretty && exit ${PIPESTATUS[0]}
-destination "generic/platform=$platform" \
-allowProvisioningUpdates \
-authenticationKeyPath "$auth_key_path" \
-authenticationKeyID $auth_key_id \
-authenticationKeyIssuerID $auth_key_issuer_id \
"$build_settings" #| xcpretty && exit ${PIPESTATUS[0]}
- name: Create export options plist
id: export-options-plist
Expand Down Expand Up @@ -78,7 +87,7 @@ runs:
-allowProvisioningUpdates \
-authenticationKeyPath "$auth_key_path" \
-authenticationKeyID $auth_key_id \
-authenticationKeyIssuerID $auth_key_issuer_id | xcpretty && exit ${PIPESTATUS[0]}
-authenticationKeyIssuerID $auth_key_issuer_id #| xcpretty && exit ${PIPESTATUS[0]}
- name: Upload app to TestFlight
id: upload
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,18 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install the Apple certificate and provisioning profile
- name: Install the Apple certificate
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
TVOS_BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.TVOS_BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
TVOS_PP_PATH=$RUNNER_TEMP/tvos_build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
# import certificate from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
echo -n "$TVOS_BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $TVOS_PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
Expand All @@ -42,11 +36,6 @@ jobs:
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
cp $TVOS_PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install App Store Connect private key
id: appstore-private-key
env:
Expand Down

0 comments on commit 9d3e0b6

Please # to comment.