-
Notifications
You must be signed in to change notification settings - Fork 36
142 lines (128 loc) · 4.53 KB
/
release-ios-base.yaml
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
name: release-ios-base
on:
workflow_call:
inputs:
name:
description: 'Name of the project'
required: true
type: string
root-path:
description: 'Path of the react-native project'
required: true
type: string
xcode-project-path:
description: 'Path of the Xcode project'
required: true
type: string
xcode-workspace-path:
description: 'Path of the Xcode workspace'
required: true
type: string
release-type:
description: 'Release type of the project (debug/internal/production)'
type: string
scheme-name:
description: 'Scheme name of the project'
required: true
type: string
bundle-id:
description: 'Bundle ID of the project'
required: true
type: string
apple-id:
description: 'App ID of the project'
required: true
type: string
secrets:
project-id:
description: 'WalletConnect Cloud ID'
required: true
relay-url:
description: 'WalletConnect Relay URL'
required: false
sentry-dsn:
required: true
sentry-file:
required: true
apple-username:
required: true
apple-key-id:
required: true
apple-key-content:
required: true
apple-issuer-id:
required: true
match-username:
required: true
match-keychain-password:
required: true
match-git-url:
required: true
match-ssh-key:
required: true
google-services-file:
required: false
jobs:
build:
runs-on: macos-latest-xlarge
steps:
- name: Checkout
uses: actions/checkout@v3
- name: webfactory/ssh-agent
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.match-ssh-key }}
- name: Setup
uses: ./.github/actions/ci-setup
with:
root-path: ${{ inputs.root-path }}
- name: Set podfile path
id: podfile-hash
run: |
echo "Root path: ${{ inputs.root-path }}"
echo "Podfile path: ${{ inputs.root-path }}/ios/Podfile.lock"
echo "File exists: $(test -f "${{ inputs.root-path }}/ios/Podfile.lock" && echo "yes" || echo "no")"
echo "podfile_path=${{ inputs.root-path }}/ios/Podfile.lock" >> "$GITHUB_ENV"
- name: Cache pods
id: pods-cache
uses: actions/cache@v3
with:
path: ${{ inputs.root-path }}/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles(env.podfile_path) }}
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2
bundler-cache: true
- name: Install Fastlane
run: gem install fastlane
- name: Install Cocoapods
run: gem install cocoapods
# Create env file
- run: touch ${{ inputs.root-path }}/.env.${{ inputs.release-type }} && echo -e "ENV_PROJECT_ID=${{ secrets.project-id }}\nENV_RELAY_URL=${{ secrets.relay-url }}\nENV_SENTRY_DSN=${{ secrets.sentry-dsn }}\nENV_SENTRY_TAG=${{ inputs.release-type }}" >> ${{ inputs.root-path }}/.env.${{ inputs.release-type }}
# Create sentry file
- run: touch ${{ inputs.root-path }}/ios/sentry.properties && echo "${{ secrets.sentry-file }}" >> ${{ inputs.root-path }}/ios/sentry.properties
- name: Create Google Services file
env:
google-services-file: ${{ secrets.google-services-file }}
if: ${{ env.google-services-file != '' }}
run: echo ${{ env.google-services-file }} | base64 --decode >> ${{ inputs.root-path }}/ios/GoogleService-Info.plist
- name: Build and Upload to App Store
uses: maierj/[email protected]
with:
lane: 'release_testflight'
bundler-cache: true
env:
APPLE_ID: ${{ inputs.apple-id }}
APPLE_USERNAME: ${{ secrets.apple-username }}
APPLE_KEY_ID: ${{ secrets.apple-key-id }}
APPLE_KEY_CONTENT: ${{ secrets.apple-key-content }}
APPLE_ISSUER_ID: ${{ secrets.apple-issuer-id }}
BUNDLE_ID: ${{ inputs.bundle-id }}
MATCH_USERNAME: ${{ secrets.match-username }}
MATCH_PASSWORD: ${{ secrets.match-keychain-password }}
MATCH_GIT_URL: ${{ secrets.match-git-url }}
PODFILE_PATH: ${{ inputs.root-path }}/ios/Podfile
SCHEME: ${{ inputs.scheme-name }}
XCODE_PROJECT_PATH: ${{ inputs.xcode-project-path }}
XCWORKSPACE_PATH: ${{ inputs.xcode-workspace-path }}