-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: deploy testflight | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: macos-latest | ||
env: | ||
XC_WORKSPACE: ${{ 'pins.xcodeproj' }} | ||
XC_SCHEME: ${{ 'Release' }} | ||
XC_ARCHIVE: ${{ 'pins.xcarchive' }} | ||
|
||
# certificate | ||
ENCRYPTED_CERT_FILE_PATH: ${{ '.github/secrets/certification.p12.gpg' }} | ||
DECRYPTED_CERT_FILE_PATH: ${{ '.github/secrets/certification.p12' }} | ||
CERT_ENCRYPTION_KEY: ${{ secrets.CERTS_ENCRYPTION_PWD }} | ||
|
||
# provisioning | ||
ENCRYPTED_PROVISION_FILE_PATH: ${{ '.github/secrets/HappyChuseok_GithubActions.mobileprovision.gpg' }} | ||
DECRYPTED_PROVISION_FILE_PATH: ${{ '.github/secrets/HappyChuseok_GithubActions.mobileprovision' }} | ||
PROVISIONING_ENCRYPTION_KEY: ${{ secrets.PROVISION_ENCRYPTION_PWD }} | ||
|
||
# certification export key | ||
CERT_EXPORT_KEY: ${{ secrets.CERT_EXPORT_PWD }} | ||
|
||
KEYCHAIN: ${{ 'test.keychain' }} | ||
|
||
steps: | ||
- name: Select latest Xcode | ||
run: "sudo xcode-select -s /Applications/Xcode.app" | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
- name: Configure Keychain | ||
run: | | ||
security create-keychain -p "" "$KEYCHAIN" | ||
security list-keychains -s "$KEYCHAIN" | ||
security default-keychain -s "$KEYCHAIN" | ||
security unlock-keychain -p "" "$KEYCHAIN" | ||
security set-keychain-settings | ||
- name : Configure Code Signing | ||
run: | | ||
gpg -d -o "$DECRYPTED_CERT_FILE_PATH" --pinentry-mode=loopback --passphrase "$CERT_ENCRYPTION_KEY" "$ENCRYPTED_CERT_FILE_PATH" | ||
gpg -d -o "$DECRYPTED_PROVISION_FILE_PATH" --pinentry-mode=loopback --passphrase "$PROVISIONING_ENCRYPTION_KEY" "$ENCRYPTED_PROVISION_FILE_PATH" | ||
security import "$DECRYPTED_CERT_FILE_PATH" -k "$KEYCHAIN" -P "$CERT_EXPORT_KEY" -A | ||
security set-key-partition-list -S apple-tool:,apple: -s -k "" "$KEYCHAIN" | ||
mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles" | ||
echo `ls .github/secrets/*.mobileprovision` | ||
for PROVISION in `ls .github/secrets/*.mobileprovision` | ||
do | ||
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)` | ||
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision" | ||
done | ||
- name: Archive app | ||
run: | | ||
xcodebuild clean archive -project $XC_WORKSPACE -scheme $XC_SCHEME -configuration release -archivePath $XC_ARCHIVE | ||
- name: Export app | ||
run: | | ||
xcodebuild -exportArchive -archivePath $XC_ARCHIVE -exportOptionsPlist ExportOptions.plist -exportPath . -allowProvisioningUpdates | ||
- name: Upload app to TestFlight | ||
uses: apple-actions/upload-testflight-build@v1 | ||
with: | ||
app-path: 'pins.ipa' | ||
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }} | ||
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }} | ||
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }} |