-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (116 loc) · 4.31 KB
/
main.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Build project IOS
on: [workflow_dispatch]
jobs:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
unity-version:
- 2021.3.22f1
os:
- ubuntu-latest
targetPlatform:
- iOS # Build an iOS player.
steps:
###########################
# Checkout #
###########################
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
###########################
# Cache #
###########################
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
###########################
# Disk #
###########################
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/[email protected]
###########################
# Build #
###########################
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
###########################
# Upload #
###########################
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
releaseToAppStore:
name: Release to the App Store
runs-on: macos-latest
needs: buildForAllSupportedPlatforms
strategy:
matrix:
targetPlatform:
- iOS # Build an iOS player.
steps:
###########################
# Checkout #
###########################
- name: Checkout Repository
uses: actions/checkout@v4
###########################
# Download iOS Artifact #
###########################
- name: Download iOS Artifact
uses: actions/download-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
###########################
# Install Pods #
###########################
- name: Install Pods
run: |
cd ${{ github.workspace }}/build/${{ matrix.targetPlatform }}/iOS/ # Змініть шлях до вашого Podfile
pod install --repo-update
###########################################
# Fix File Permissions and Run fastlane #
###########################################
- name: Fix File Permissions and Run fastlane
env:
APPLE_CONNECT_EMAIL: ${{ secrets.APPLE_CONNECT_EMAIL }}
APPLE_DEVELOPER_EMAIL: ${{ secrets.APPLE_DEVELOPER_EMAIL }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MATCH_REPOSITORY: ${{ secrets.MATCH_REPOSITORY }}
MATCH_DEPLOY_KEY: ${{ secrets.MATCH_DEPLOY_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
APPSTORE_P8: ${{ secrets.APPSTORE_P8 }}
IOS_BUILD_PATH: ${{ format('{0}/build/iOS', github.workspace) }}
IOS_BUNDLE_ID: com.TestCIRealProject.TestCIRealProject # Change it to match your Unity bundle id
PROJECT_NAME: TestCIRealProject # Change it to match your project's name
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${MATCH_DEPLOY_KEY}"
find $IOS_BUILD_PATH -type f -name "**.sh" -exec chmod +x {} \;
find $IOS_BUILD_PATH -type f -iname "usymtool" -exec chmod +x {} \;
bundle install
bundle exec fastlane ios release
#bundle exec fastlane ios beta
#bundle exec fastlane ios build
####################################
# Cleanup to avoid storage limit #
####################################
- name: Cleanup to avoid storage limit
if: always()
uses: geekyeggo/delete-artifact@v2
with:
name: build-iOS