You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you still want to set up everything yourself, here's what you need to do:
28
58
29
59
**Steps to follow in the post**
30
60
@@ -34,11 +64,9 @@ Before continuing with the tutorial…
34
64
4._Storing your Android signing key_
35
65
5._Set up your GitLab workflow .yml file_
36
66
67
+
## 1. Copy Fastline files
37
68
38
-
## 1\. Copy Fastline files
39
-
40
-
Fastlane is a Ruby library created to automate common mobile development tasks. Using Fastlane, you can configure custom “lanes” which bundle a series of “actions” that perform tasks that you’d normally perform using Android studio. You can do a lot with Fastlane, but for the purposes of this tutorial, we’ll be using only a handful of core actions.
41
-
69
+
Fastlane is a Ruby library created to automate common mobile development tasks. Using Fastlane, you can configure custom "lanes" which bundle a series of "actions" that perform tasks that you'd normally perform using Android studio. You can do a lot with Fastlane, but for the purposes of this tutorial, we'll be using only a handful of core actions.
42
70
43
71
Create a Fastlane folder at the root of your project and copy the following files:
44
72
Fastlane
@@ -133,13 +161,45 @@ GitLab provides a way to store encrypted CI/CD variables, similar to GitHub's re
133
161
2. Navigate to CI/CD > Variables
134
162
3. Add the following variables:
135
163
136
-
- ANDROID_KEYSTORE_FILE: the base64-encoded `.jks` or `.keystore` file used to sign your Android builds. This will either be the keystore file associated with your upload key (if using Play App Signing), or your app signing key.
164
+
- ANDROID_KEYSTORE_FILE: the base64-encoded `.jks` or `.keystore` file used to sign your Android builds. This will either be the keystore file associated with your upload key (if using Play App Signing), or your app signing key.
137
165
- KEYSTORE_KEY_PASSWORD: the password associated with the keystore file
138
166
- KEYSTORE_KEY_ALIAS: the key store alias
139
167
- KEYSTORE_STORE_PASSWORD: the private key password
140
168
- DEVELOPER_PACKAGE_NAME: your android app ID like com.example.app
141
169
- PLAY_CONFIG_JSON: The base64-encoded service account key JSON.
142
170
171
+
### Creating a Google Play Service Account Key
172
+
173
+
To generate the `PLAY_CONFIG_JSON` secret, follow these steps:
174
+
175
+
1. Go to the [Google Cloud Console](https://console.cloud.google.com/)
176
+
2. Create a new project or select an existing one
177
+
3. Enable the Google Play Android Developer API
178
+
4. Create a service account:
179
+
- Go to "IAM & Admin" > "Service Accounts"
180
+
- Click "Create Service Account"
181
+
- Give it a name and description
182
+
- Click "Create and Continue"
183
+
- Skip role assignment and click "Done"
184
+
5. Generate a JSON key:
185
+
- Find your service account in the list
186
+
- Click the three dots menu > "Manage keys"
187
+
- Click "Add Key" > "Create new key"
188
+
- Choose JSON format
189
+
- Click "Create"
190
+
6. Grant the service account access to your app in the Play Console:
191
+
- Go to [Play Console](https://play.google.com/console)
192
+
- Navigate to "Users and permissions"
193
+
- Click "Invite new users"
194
+
- Enter the service account email (ends with @*.iam.gserviceaccount.com)
Copy file name to clipboardExpand all lines: src/content/blog/en/automatic-capacitor-ios-build-codemagic.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ We are going to use a **_macOS M1_** machine, you can see in the screenshot its
42
42
43
43
> **_📣_ In the post we assume that we have the app created in iTunes connect, we do have the certificates of the Apple ecosystem, everything will be setup by Codemagic!**
The service is ‘_free’_ up to the limit, depending on the chosen machine.
76
+
The service is 'free' up to the limit, depending on the chosen machine.
40
77
We are going to use a **_macOS_** machine, you can see in the screenshot its price and limits (prices as of the creation of the tutorial, they could undergo changes in the future)
41
78
42
79
🔴 **_Once warned of requirements and prices, if you like, we continue…_**
43
80
44
81
> **_📣_ In the post we assume that we have the app created in iTunes connect, we do have the certificates of the Apple ecosystem, everything will be copied by Fastlane!**
45
82
46
-
## Let’s go to the mess 🧑🏽💻
83
+
## Let's dive in 🤿
47
84
48
85
**Steps to follow in the post**
49
86
@@ -57,7 +94,7 @@ We are going to use a **_macOS_** machine, you can see in the screenshot its pri
57
94
58
95
## 1\. Using App Store Connect API with Fastlane Match
59
96
60
-
> Starting February 2021, two-factor authentication or two-step verification is required for all users to sign in to App Store Connect. This extra layer of security for your Apple ID helps ensure that you’re the only person who can access your account.
97
+
> Starting February 2021, two-factor authentication or two-step verification is required for all users to sign in to App Store Connect. This extra layer of security for your Apple ID helps ensure that you're the only person who can access your account.
61
98
> From [Apple Support](https://developer.apple.com/support/authentication/)
62
99
63
100
> Getting started with match requires you to revoke your existing certificates. But no worry, you will have the new one directly.
@@ -73,7 +110,7 @@ To be able to use App Store Connect API, Fastlane needs **three** things.
73
110
74
111
## Creating an App Store Connect API Key
75
112
76
-
To generate keys, you must have Admin permission in App Store Connect. If you don’t have that permission, you can direct the relevant person to this article and follow the following instructions.
113
+
To generate keys, you must have Admin permission in App Store Connect. If you don't have that permission, you can direct the relevant person to this article and follow the following instructions.
77
114
78
115
1 — Log in to [App Store Connect](https://appstoreconnect.apple.com/).
79
116
@@ -97,28 +134,28 @@ To generate keys, you must have Admin permission in App Store Connect. If you do
97
134
98
135
7 — Click Generate.
99
136
100
-
> **An API key’s access cannot be limited to specific apps.**
137
+
> **An API key's access cannot be limited to specific apps.**
101
138
102
-
The new key’s name, key ID, a download link, and other information appear on the page.
139
+
The new key's name, key ID, a download link, and other information appear on the page.
103
140
104
141

105
142
106
143
You can grab all three necessary information here.
107
144
<1> Issue ID.
108
145
<2> Key ID.
109
-
<3> Click “Download API Key” to download your API private key. The download link appears only if the private key has not yet been downloaded. Apple does not keep a copy of the private key. So, you can download it only once.
146
+
<3> Click "Download API Key" to download your API private key. The download link appears only if the private key has not yet been downloaded. Apple does not keep a copy of the private key. So, you can download it only once.
110
147
111
148
> _🔴_ Store your private key in a safe place. You should never share your keys, store keys in a code repository, or include keys in client-side code.
112
149
113
150
## Using an App Store Connect API Key
114
151
115
-
The API Key file (p8 file that you download), the key ID, and the issuer ID are needed to create the JWT token for authorization. There are multiple ways that these pieces of information can be input into Fastlane using Fastlane’s new action, `app_store_connect_api_key`. You can learn other ways in [Fastlane documentation](https://docs.fastlane.tools/actions/app_store_connect_api_key/). I show this method because I think it is the easiest way to work with most CI out there, where you can set environment variables.
152
+
The API Key file (p8 file that you download), the key ID, and the issuer ID are needed to create the JWT token for authorization. There are multiple ways that these pieces of information can be input into Fastlane using Fastlane's new action, `app_store_connect_api_key`. You can learn other ways in [Fastlane documentation](https://docs.fastlane.tools/actions/app_store_connect_api_key/). I show this method because I think it is the easiest way to work with most CI out there, where you can set environment variables.
116
153
117
154
_Now we can manage Fastlane with the App Store Connect API key, great!_
118
155
119
156
## 2\. Copy Fastline files
120
157
121
-
Fastlane is a Ruby library created to automate common mobile development tasks. Using Fastlane, you can configure custom “lanes” which bundle a series of “actions” that perform tasks that you’d normally perform using Android studio. You can do a lot with Fastlane, but for the purposes of this tutorial, we’ll be using only a handful of core actions.
158
+
Fastlane is a Ruby library created to automate common mobile development tasks. Using Fastlane, you can configure custom "lanes" which bundle a series of "actions" that perform tasks that you'd normally perform using Android studio. You can do a lot with Fastlane, but for the purposes of this tutorial, we'll be using only a handful of core actions.
122
159
123
160
124
161
Create a Fastlane folder at the root of your project and copy the following files:
Fastlane [match](https://docs.fastlane.tools/actions/match/) is a new approach to iOS’s code signing. Fastlane match makes it easy for teams to manage the required certificates and provisioning profiles for your iOS apps.
306
+
Fastlane [match](https://docs.fastlane.tools/actions/match/) is a new approach to iOS's code signing. Fastlane match makes it easy for teams to manage the required certificates and provisioning profiles for your iOS apps.
270
307
271
308
Create a new private repository named `certificates`, for example on your GitHub personal account or organization.
272
309
@@ -357,26 +394,26 @@ For private projects, the estimated cost per build can go up to **$0.08/min x 15
357
394
358
395
If you share the same concerns for the pricing as I do for private projects, you can keep the `skip_waiting_for_build_processing` to `true`.
359
396
360
-
What’s the catch? You have to manually update the compliance of your app in App Store Connect after the build has been processed, for you to distribute the build to your users.
397
+
What's the catch? You have to manually update the compliance of your app in App Store Connect after the build has been processed, for you to distribute the build to your users.
361
398
362
-
This is just an optional parameter to update if you want to save on the build minutes for private projects. For free projects, this shouldn’t be a problem at all. See [pricing](https://github.com/pricing/).
399
+
This is just an optional parameter to update if you want to save on the build minutes for private projects. For free projects, this shouldn't be a problem at all. See [pricing](https://github.com/pricing/).
363
400
364
401
365
402
## 3\. Setup GitHub Actions
366
403
367
404
**Configure GitHub secrets**
368
405
369
-
Ever wonder where the values of the `ENV` are coming from? Well, it’s not a secret anymore – it’s from your project’s secret. 🤦
406
+
Ever wonder where the values of the `ENV` are coming from? Well, it's not a secret anymore – it's from your project's secret. 🤦
370
407
371
408

372
409
373
-
1\.`APP_STORE_CONNECT_TEAM_ID` - the ID of your App Store Connect team in you’re in multiple teams.
410
+
1\.`APP_STORE_CONNECT_TEAM_ID` - the ID of your App Store Connect team in you're in multiple teams.
374
411
375
412
2\.`DEVELOPER_APP_ID` - in App Store Connect, go to the app → **App Information** → Scroll down to the `General Information` section of your app and look for `Apple ID`.
376
413
377
-
3\.`DEVELOPER_APP_IDENTIFIER` - your app’s bundle identifier.
414
+
3\.`DEVELOPER_APP_IDENTIFIER` - your app's bundle identifier.
378
415
379
-
4\.`DEVELOPER_PORTAL_TEAM_ID` - the ID of your Developer Portal team if you’re in multiple teams.
416
+
4\.`DEVELOPER_PORTAL_TEAM_ID` - the ID of your Developer Portal team if you're in multiple teams.
380
417
381
418
5\.`FASTLANE_APPLE_ID` - the Apple ID or developer email you use to manage the app.
382
419
@@ -503,9 +540,9 @@ Yes, you can, and it is effortless.
503
540
504
541
Imagine that you have a private repository, and you have used up the minutes of the free plan and you do not want to pay for new releases, or maybe you prefer to submit the application manually.
505
542
506
-
**_Let’s go for it_**
543
+
**_Let's go for it_**
507
544
508
-
Ok, first we need to create in **_my\_project\_path/fastlane_** path a file called **_.env,_** just in the same path as _Fastfile,_ to be able to create the same _secret_ properties found in our _GitHub, a_s below:
545
+
Ok, first we need to create in _my_project_path/fastlane_ path a file called **_.env,_** just in the same path as _Fastfile,_ to be able to create the same _secret_ properties found in our _GitHub, a_s below:
509
546
510
547
.env file for deploy from local machine
511
548
@@ -525,7 +562,7 @@ It should work the same as it happens from GitHub Actions on the remote machine
525
562
526
563

527
564
528
-
Terminal execution: $ Fastlane closed\_beta
565
+
Terminal execution: $ Fastlane closed_beta
529
566
530
567
**_If you have come this far, my congratulations, now you have a fully automated process for your iOS apps with Fastlane and GitHub Actions._**
0 commit comments