-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (48 loc) · 2.04 KB
/
Deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Deploy
on: push
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install the Apple Certificate and Provisioning Profile
run: |
chmod +x install_dist_certs.sh && ./install_dist_certs.sh
chmod +x install_dist_profile.sh && ./install_dist_profile.sh
- name: Cache CocoaPods
uses: actions/cache@v2
with:
path: |
Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install CocoaPods
run: |
if [ -f "Podfile.lock" ] && [ -f "${{ runner.workspace }}/Podfile.lock" ] && cmp -s Podfile.lock "${{ runner.workspace }}/Podfile.lock"; then
echo "Podfile.lock unchanged. Skipping pod installs."
else
pod install --repo-update
fi
- name: Run Lint
run: |
Pods/SwiftLint/swiftlint Splito
- name: Build and Archive Project
run: |
ARCHIVE_PATH="$HOME/Library/Developer/Xcode/Archives/Splito/${CI_COMMIT_SHA}/${CI_JOB_ID}.xcarchive"
xcodebuild -workspace Splito.xcworkspace -scheme "Splito" clean archive -sdk iphoneos -destination 'platform=iOS Simulator,name=iPhone 13' -archivePath $ARCHIVE_PATH | xcpretty --color
- name: Export Archive
run: |
EXPORT_PATH="$HOME/Library/Developer/Xcode/Archives/Splito/${CI_COMMIT_SHA}/${CI_JOB_ID}"
xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH -exportOptionsPlist ExportOptions.plist | xcpretty --color
- name: Deploy to App Store Connect
run: |
echo "Collecting artifacts.."
cp -R "${ARCHIVE_PATH}/dSYMs" .
IPA="${EXPORT_PATH}Justly.ipa"
echo $IPA
echo "Uploading app to iTC..."
rm -rf $ARCHIVE_PATH
rm -rf $EXPORT_PATH
xcrun altool --upload-app -t ios -f $IPA -u $ITC_USER_NAME -p $ITC_USER_PASSWORD