-
Notifications
You must be signed in to change notification settings - Fork 159
185 lines (167 loc) · 6.16 KB
/
ios-build-and-release.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: iOS Build and Release
on:
push:
branches:
- main
- release/*
- fast-track/*
tags: ["*"]
pull_request:
types: [ready_for_review, opened, reopened, auto_merge_enabled]
workflow_dispatch:
inputs:
clo:
description: "Assets/StreamingAssets/clo.json"
required: false
type: string
default: ""
version-code:
description: "App Store Connect VersionCode"
app-version:
description: "App Store Connect VersionName ex(40.0.0)"
manual_build_option:
description: "Please turn on the option when manually executing the action"
type: boolean
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
jobs:
build:
name: Build for ${{ matrix.targetPlatform }}
runs-on:
group: linux-8cores
defaults:
run:
shell: bash
strategy:
matrix:
projectPath:
- nekoyume
targetPlatform:
- iOS
env:
APPLE_CONNECT_EMAIL: ${{ secrets.APPLE_CONNECT_EMAIL }}
APPLE_DEVELOPER_EMAIL: ${{ secrets.APPLE_DEVELOPER_EMAIL }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_TEAM_NAME: ${{ secrets.APPLE_TEAM_NAME }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_PERSONAL_ACCESS_TOKEN: ${{ secrets.MATCH_PERSONAL_ACCESS_TOKEN }}
IOS_APP_ID: com.planetariumlabs.ninechroniclesmobile
IOS_BUILD_PATH: ${{ format('{0}/build/iOS', github.workspace) }}
PROJECT_NAME: NineChronicles
RELEASE_NOTES: ${{ github.event.release.body }}
MATCH_REPOSITORY_ACCOUNT: ${{ secrets.MATCH_REPOSITORY_ACCOUNT }}
USYM_UPLOAD_AUTH_TOKEN: 'fake'
GOOGLE_SERVICE_INFO: ${{ secrets.GOOGLE_SERVICE_INFO }}
steps:
- name: Set CRLF
run: |
git config --global core.autocrlf true
- name: Checkout Repository
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Cache restore for debug
uses: actions/cache@v3
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }}
restore-keys: |
Library-${{ matrix.projectPath }}-macos-
- name: Copy clo.json
run: |
if [ -n "${{ github.event.inputs.clo }}" ]; then
echo ${{ github.event.inputs.clo }} > ${{ matrix.projectPath }}/Assets/StreamingAssets/clo.json
fi
- name: Decode GoogleService-Info.plist File
run: |
echo "$GOOGLE_SERVICE_INFO" | base64 -d > ${{ matrix.projectPath }}/Assets/GoogleService-Info.plist
# echo "$GOOGLE_SERVICE_INFO" | base64 -D -o ${{ matrix.projectPath }}/Assets/GoogleService-Info.plist
- name: Free Disk Space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
- uses: game-ci/unity-builder@v4
with:
projectPath: ${{ matrix.projectPath }}
targetPlatform: ${{ matrix.targetPlatform }}
buildMethod: 'Editor.Builder.Build${{ matrix.targetPlatform }}'
buildName: ${{ matrix.targetPlatform }}
versioning: Custom
version: ${{ github.event.inputs.app-version }}
allowDirtyBuild: true
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
build-and-upload:
name: Build Archive for iOS and Upload to TestFlight
runs-on: macos-13
timeout-minutes: 60
needs: build
if: startsWith(github.ref, 'refs/heads/release/') || startsWith(github.event.ref, 'refs/tags/')|| github.event.inputs.manual_build_option
strategy:
matrix:
projectPath:
- nekoyume
targetPlatform:
- iOS
env:
APPLE_CONNECT_EMAIL: ${{ secrets.APPLE_CONNECT_EMAIL }}
APPLE_DEVELOPER_EMAIL: ${{ secrets.APPLE_DEVELOPER_EMAIL }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_TEAM_NAME: ${{ secrets.APPLE_TEAM_NAME }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: ${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
MATCH_PERSONAL_ACCESS_TOKEN: ${{ secrets.MATCH_PERSONAL_ACCESS_TOKEN }}
MATCH_REPOSITORY_ACCOUNT: ${{ secrets.MATCH_REPOSITORY_ACCOUNT }}
IOS_APP_ID: com.planetariumlabs.ninechroniclesmobile
IOS_BUILD_PATH: ${{ format('{0}/build/iOS', github.workspace) }}
PROJECT_NAME: NineChronicles
RELEASE_NOTES: ${{ github.event.release.body }}
USYM_UPLOAD_AUTH_TOKEN: 'fake'
GOOGLE_SERVICE_INFO: ${{ secrets.GOOGLE_SERVICE_INFO }}
GIT_REPO_CERT: ${{ secrets.GIT_REPO_CERT }}
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }}
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }}
ASC_KEY_CONTENT: ${{ secrets.ASC_KEY_CONTENT }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Download iOS Artifact
uses: actions/download-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
- name: Cache restore cocoapods
uses: actions/cache@v2
if: ${{ always() }}
with:
path: |
'build/iOS/Nine Chronicles M/Pods'
~/.cocoapods/repos
key: Pods-${{ hashFiles('**/Podfile') }}
restore-keys: Pods-
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Archive iOS
uses: maierj/[email protected]
with:
lane: 'ios build'
- name: Upload to the App Store
uses: maierj/[email protected]
with:
lane: 'ios beta'