Skip to content

Commit

Permalink
👷 TestFlight CD 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
SwiftyJunnos committed Dec 18, 2023
1 parent 2d95cec commit 1e7160c
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 3 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/TestFlight_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: TestFlight Deploy

env:
WORKSPACE: iOS/MusicSpot.xcworkspace
SCHEME: MusicSpot-Release
ARCHIVE: MusicSpot.xcarchive

on:
push:
branches:
- 'iOS/release'

jobs:
deploy:
runs-on: macos-13
env:
DEPLOY_CERTIFICATE_BASE64: ${{ secrets.IOS_DEPLOY_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.IOS_P12_PASSWORD }}
DEPLOY_PROVISION_PROFILE_BASE64: ${{ secrets.IOS_DEPLOY_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWD }}
steps:
- uses: actions/checkout@v4

- name: Create secret file
env:
API_SECRET: ${{ secrets.API_SECRET }}
run: |
echo -n $API_SECRET | base64 -D -o iOS/MSData/Sources/MSData/Resources/APIInfo.plist
- name: Setup Deploy Certificates
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/deploy_certificate.p12
PROFILE_PATH=$RUNNER_TEMP/deploy_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$DEPLOY_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$DEPLOY_PROVISION_PROFILE_BASE64" | base64 --decode -o $PROFILE_PATH
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
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 $PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Setup Xcode
if: ${{ !env.ACT }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.0.1'

- name: Archive
run: |
xcodebuild clean archive \
-workspace $WORKSPACE \
-scheme $SCHEME \
-configuration release \
-archivePath $ARCHIVE
- name: Export
run: |
xcodebuild \
-exportArchive \
-archivePath $ARCHIVE \
-exportOptionsPlist ExportOptions.plist \
-exportPath . \
-allowProvisioningUpdates
- name: Upload to TestFlight
uses: apple-actions/upload-testflight-build@v1
with:
app-path: 'MusicSpot.ipa'
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
2 changes: 1 addition & 1 deletion .github/workflows/Xcode_build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- 'iOS/release'
- 'iOS/epic/**'
types: [assigned, labeled, opened, synchronize, reopened]
types: [ assigned, opened, synchronize, reopened, auto_merge_enabled, ready_for_review ]

jobs:
prepare-matrix:
Expand Down
24 changes: 24 additions & 0 deletions ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>upload</string>
<key>generateAppStoreInformation</key>
<false/>
<key>manageAppVersionAndBuildNumber</key>
<true/>
<key>method</key>
<string>app-store</string>
<key>signingStyle</key>
<string>automatic</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>XW996HTK32</string>
<key>testFlightInternalTestingOnly</key>
<false/>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions iOS/MusicSpot/MusicSpot.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
Expand All @@ -432,7 +432,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.overheat.boostcamp8.MusicSpot;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "MusicSpot Development";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "MusicSpot Distribution";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
Expand Down

0 comments on commit 1e7160c

Please sign in to comment.