Skip to content

Commit

Permalink
Merge pull request #338 from boostcampwm2023/iOS/task/TestFlight-Deploy
Browse files Browse the repository at this point in the history
[iOS] TestFlight 배포
  • Loading branch information
SwiftyJunnos authored Dec 19, 2023
2 parents 421e038 + c1c8fff commit 57da475
Show file tree
Hide file tree
Showing 14 changed files with 314 additions and 131 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/TestFlight_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: TestFlight Deploy

env:
PROJECT: iOS/MusicSpot/MusicSpot.xcodeproj
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 list-keychains -s "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
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 -project $PROJECT -list
xcodebuild clean archive \
-project $PROJECT \
-scheme $SCHEME \
-configuration release \
-archivePath $ARCHIVE
- name: Export
run: |
xcodebuild \
-exportArchive \
-archivePath $ARCHIVE \
-exportOptionsPlist ExportOptions.plist \
-exportPath . \
-allowProvisioningUpdates
- name: Install Private API Key P8
env:
APPSTORE_API_PRIVATE_KEY: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
run: |
mkdir -p ~/private_keys
echo -n "$APPSTORE_API_PRIVATE_KEY" | base64 -d -o ~/private_keys/AuthKey_$APPSTORE_API_KEY_ID.p8
- name: Upload to TestFlight
env:
APPSTORE_API_KEY_ID: ${{ secrets.APPSTORE_API_KEY_ID }}
APPSTORE_ISSUER_ID : ${{ secrets.APPSTORE_ISSUER_ID }}
run: |
xcrun altool \
--output-format xml \
--upload-app \
-f 'MusicSpot.ipa' \
-t ios \
--apiKey $APPSTORE_API_KEY_ID \
--apiIssuer $APPSTORE_ISSUER_ID
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: [ opened, synchronize, reopened, auto_merge_enabled, ready_for_review ]

jobs:
prepare-matrix:
Expand Down
108 changes: 0 additions & 108 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,100 +30,6 @@ Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Swift ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

### SwiftPackageManager ###
Packages
xcuserdata
*.xcodeproj


### Windows ###
# Windows thumbnail cache files
Thumbs.db
Expand All @@ -150,19 +56,5 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

### Xcode ###

## Xcode 8 and earlier

### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

# End of https://www.toptal.com/developers/gitignore/api/macos,windows,xcode,swift,swiftpackagemanager
node_modules
# End of https://www.toptal.com/developers/gitignore/api/macos
27 changes: 27 additions & 0 deletions ExportOptions.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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>export</string>
<key>manageAppVersionAndBuildNumber</key>
<true/>
<key>method</key>
<string>app-store</string>
<key>provisioningProfiles</key>
<dict>
<key>com.overheat.boostcamp8.MusicSpot</key>
<string>MusicSpot Distribution</string>
</dict>
<key>signingCertificate</key>
<string>Apple Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>XW996HTK32</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>
8 changes: 1 addition & 7 deletions iOS/.gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,xcode,swiftpackagemanager,swift
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,xcode,swiftpackagemanager,swift

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

Expand Down Expand Up @@ -129,6 +122,7 @@ xcuserdata
### Xcode Patch ###
*.xcodeproj/*
!*.xcodeproj/project.pbxproj
!*.xcodeproj/xcshareddata/xcschemes/**
/*.gcno
**/xcshareddata/WorkspaceSettings.xcsettings

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
9 changes: 6 additions & 3 deletions iOS/MusicSpot.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 57da475

Please sign in to comment.