Skip to content

Commit 3b83f8e

Browse files
authored
Update README and testflight instruction files (#39)
* Update GitHub build instructions * Add link to testflight.md in README * grammar fix * Update for clarity * update GitHub row to Secrets and variables * fix link and add notes * fix typo * Change suggested expiration for GH_PAT to 90 days * Update README * Clarify a comment on testflight instructions
1 parent 1069efe commit 3b83f8e

File tree

2 files changed

+114
-30
lines changed

2 files changed

+114
-30
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# LoopWorkspace
22

3-
## Clone
3+
The Loop app can be built using GitHub in a browser on any computer or using a Mac with Xcode.
4+
5+
* Non-developers may prefer the GitHub method
6+
* Developers or Loopers who want full build control may prefer the Mac/Xcode method
7+
8+
## GitHub Build Instructions
9+
10+
The GitHub Build Instructions are at this [link](fastlane/testflight.md) and further expanded in [LoopDocs: Browser Build](https://loopkit.github.io/loopdocs/gh-actions/gh-overview/).
11+
12+
## Mac/Xcode Build Instructions
13+
14+
The rest of this README contains information needed for Mac/Xcode build. Additonal instructions are found in [LoopDocs: Mac/Xcode Build](https://loopkit.github.io/loopdocs/build/overview/).
15+
16+
### Clone
417

518
This repository uses git submodules to pull in the various workspace dependencies.
619

@@ -12,7 +25,7 @@ git clone --branch=<branch> --recurse-submodules https://github.com/LoopKit/Loop
1225

1326
Replace `<branch>` with the initial LoopWorkspace repository branch you wish to checkout.
1427

15-
## Open
28+
### Open
1629

1730
Change to the cloned directory and open the workspace in Xcode:
1831

@@ -21,13 +34,13 @@ cd LoopWorkspace
2134
xed .
2235
```
2336

24-
## Input your development team
37+
### Input your development team
2538

2639
You should be able to build to a simulator without changing anything. But if you wish to build to a real device, you'll need a developer account, and you'll need to tell Xcode about your team id, which you can find at https://developer.apple.com/.
2740

2841
Select the LoopConfigOverride file in Xcode's project navigator, uncomment the `LOOP_DEVELOPMENT_TEAM`, and replace the existing team id with your own id.
2942

30-
## Build
43+
### Build
3144

3245
Select the "Loop (Workspace)" scheme (not the "Loop" scheme) and Build, Run, or Test.
3346

fastlane/testflight.md

Lines changed: 97 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,104 @@
1-
# Using Github Actions + FastLane to deploy to TestFlight
1+
# Using GitHub Actions + FastLane to deploy to TestFlight
22

3-
These instructions allow you to build Loop without having access to a Mac. They also allow you to easily install Loop on phones that are not connected to your computer. So you can send builds and updates to those you care for easily, or have an easy to access backup if you run Loop for yourself. You do not need to worry about correct Xcode/Mac versions either. An app built using this method can easily be deployed to newer versions of iOS, as soon as they are available.
3+
These instructions allow you to build Loop without having access to a Mac.
44

5-
The setup steps are somewhat involved, but nearly all are one time steps. Subsequent builds are trivial. Note that TestFlight requires apple id accounts 13 years or older. Your app must be updated once every 90 days, but it's a simple click to make a new build and can be done from anywhere.
5+
* You can install Loop on phones via TestFlight that are not connected to your computer
6+
* You can send builds and updates to those you care for
7+
* You can install Loop on your phone using only the TestFlight app if a phone was lost or the app is accidentally deleted
8+
* You do not need to worry about specific Xcode/Mac versions for a given iOS
9+
10+
The setup steps are somewhat involved, but nearly all are one time steps. Subsequent builds are trivial. Your app must be updated once every 90 days, but it's a simple click to make a new build and can be done from anywhere. The 90-day update is a TestFlight requirement, which can be automated.
11+
12+
There are more detailed instructions in LoopDocs for using GitHub for Browser Builds of Loop, including troubleshooting and build errors. Please refer to:
13+
14+
* [LoopDocs: GitHub Overview](https://loopkit.github.io/loopdocs/gh-actions/gh-overview/)
15+
* [LoopDocs: GitHub Errors](https://loopkit.github.io/loopdocs/gh-actions/gh-errors/)
16+
17+
Note that installing with TestFlight, (in the US), requires the Apple ID account holder to be 13 years or older. For younger Loopers, an adult must log into Media & Purchase on the child's phone to install Loop. More details on this can be found in [LoopDocs](https://loopkit.github.io/loopdocs/gh-actions/gh-deploy/#install-testflight-loop-for-child).
618

719
## Prerequisites
820

9-
* A [github account](https://github.com/signup). The free level comes with plenty of storage and free compute time to build loop, multiple times a day, if you wanted to.
10-
* A paid [Apple Developer account](https://developer.apple.com). You may be able to use the free version, but that has not been tested.
21+
* A [GitHub account](https://github.com/signup). The free level comes with plenty of storage and free compute time to build loop, multiple times a day, if you wanted to.
22+
* A paid [Apple Developer account](https://developer.apple.com).
1123
* Some time. Set aside a couple of hours to perform the setup.
1224

25+
## Save 6 Secrets
26+
27+
You require 6 Secrets (alphanumeric items) to use the GitHub build method and if you use the GitHub method to build more than Loop, e.g., Loop Follow or LoopCaregiver, you will use the same 6 Secrets for each app you build with this method. Each secret is indentified below by `ALL_CAPITAL_LETTER_NAMES`.
28+
29+
* Four Secrets are from your Apple Account
30+
* Two Secrets are from your GitHub account
31+
* Be sure to save the 6 Secrets in a text file using a text editor
32+
- Do **NOT** use a smart editor, which might auto-correct and change case, because these Secrets are case sensitive
1333

1434
## Generate App Store Connect API Key
1535

36+
This step is common for all GitHub Browser Builds; do this step only once. You will be saving 4 Secrets from your Apple Account in this step.
37+
1638
1. Sign in to the [Apple developer portal page](https://developer.apple.com/account/resources/certificates/list).
17-
1. Copy the team id from the upper right of the screen. Record this as your `TEAMID`.
18-
1. Go to the [App Store Connect](https://appstoreconnect.apple.com/access/api) interface, click the "Keys" tab, and create a new key with "Admin" access. Give it a name like "FastLane API Key".
19-
1. Record the key id; this will be used for `FASTLANE_KEY_ID`.
39+
1. Copy the Team ID from the upper right of the screen. Record this as your `TEAMID`.
40+
1. Go to the [App Store Connect](https://appstoreconnect.apple.com/access/api) interface, click the "Keys" tab, and create a new key with "Admin" access. Give it the name: "FastLane API Key".
2041
1. Record the issuer id; this will be used for `FASTLANE_ISSUER_ID`.
42+
1. Record the key id; this will be used for `FASTLANE_KEY_ID`.
2143
1. Download the API key itself, and open it in a text editor. The contents of this file will be used for `FASTLANE_KEY`. Copy the full text, including the "-----BEGIN PRIVATE KEY-----" and "-----END PRIVATE KEY-----" lines.
2244

23-
## Setup Github
24-
1. Create a [new empty repository](https://github.com/new) titled `Match-Secrets`. It should be private.
25-
1. Fork https://github.com/LoopKit/LoopWorkspace into your account.
45+
## Create GitHub Personal Access Token
46+
47+
Log into your GitHub account to create a personal access token; this is one of two GitHub secrets needed for your build.
48+
2649
1. Create a [new personal access token](https://github.com/settings/tokens/new):
27-
* Enter a name for your token. Something like "FastLane Access Token".
28-
* 30 days is fine, or you can select longer if you'd like.
50+
* Enter a name for your token, use "FastLane Access Token".
51+
* Change the selection to 90 days.
2952
* Select the `repo` permission scope.
3053
* Click "Generate token".
3154
* Copy the token and record it. It will be used below as `GH_PAT`.
32-
1. In the forked LoopWorkspace repo, go to Settings -> Secrets -> Actions.
55+
56+
## Make up a Password
57+
58+
This is the second one of two GitHub secrets needed for your build.
59+
60+
The first time you build with the GitHub Browser Build method for any DIY app, you will make up a password and record it as `MATCH_PASSWORD`. Note, if you later lose `MATCH_PASSWORD`, you will need to delete and make a new Match-Secrets repository (next step).
61+
62+
## Setup GitHub Match-Secrets Repository
63+
64+
The creation of the Match-Secrets repository is a common step for all GitHub Browser Builds; do this step only once. You must be logged into your GitHub account.
65+
66+
1. Create a [new empty repository](https://github.com/new) titled `Match-Secrets`. It should be private.
67+
68+
Once created, you will not take any direct actions with this repository; it needs to be there for the GitHub to use as you progress through the steps.
69+
70+
## Setup GitHub LoopWorkspace Repository
71+
72+
1. Fork https://github.com/LoopKit/LoopWorkspace into your account.
73+
1. In the forked LoopWorkspace repo, go to Settings -> Secrets and variables -> Actions.
3374
1. For each of the following secrets, tap on "New repository secret", then add the name of the secret, along with the value you recorded for it:
3475
* `TEAMID`
35-
* `FASTLANE_KEY_ID`
3676
* `FASTLANE_ISSUER_ID`
77+
* `FASTLANE_KEY_ID`
3778
* `FASTLANE_KEY`
3879
* `GH_PAT`
39-
* `MATCH_PASSWORD` - just make up a password for this
80+
* `MATCH_PASSWORD`
81+
82+
## Validate repository secrets
83+
84+
This step validates most of your six Secrets and provides error messages if it detects an issue with one or more.
85+
86+
1. Click on the "Actions" tab of your LoopWorkspace repository and enable workflows if needed
87+
1. On the left side, select "1. Validate Secrets".
88+
1. On the right side, click "Run Workflow", and tap the green `Run workflow` button.
89+
1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded.
90+
1. The workflow will check if the required secrets are added and that they are correctly formatted. If errors are detected, please check the run log for details.
4091

4192
## Add Identifiers for Loop App
4293

4394
1. Click on the "Actions" tab of your LoopWorkspace repository.
44-
1. Select "Add Identifiers".
45-
1. Click "Run Workflow", and tap the green button.
95+
1. On the left side, select "2. Add Identifiers".
96+
1. On the right side, click "Run Workflow", and tap the green `Run workflow` button.
4697
1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded.
4798

4899
## Create App Group
49100

50-
If you have already built Loop via Xcode using this Apple ID, you can skip on to [Create Loop App in App Store Connect](#create-loop-app-in-app-store-connect).
101+
If you have already built Loop via Xcode using this Apple ID, you can skip on to [Add App Group to Bundle Identifiers](#add-app-group-to-bundle-identifiers).
51102

52103
1. Go to [Register an App Group](https://developer.apple.com/account/resources/identifiers/applicationGroup/add/) on the apple developer site.
53104
1. For Description, use "Loop App Group".
@@ -56,6 +107,10 @@ If you have already built Loop via Xcode using this Apple ID, you can skip on to
56107

57108
## Add App Group to Bundle Identifiers
58109

110+
Note 1 - If you previously built with Xcode, the `Names` listed below may be different, but the `Identifiers` will match. A table is provided below the steps to assist. The Add Identifier Action that you completed above generates 6 identifiers, but only 4 need to be modified as indicated in this step.
111+
112+
Note 2 - Depending on your build history, you may find some of the Identifiers are already configured - and you are just verifying the status; but in other cases, you will need to configure the Identifiers.
113+
59114
1. Go to [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) on the apple developer site.
60115
1. For each of the following identifier names:
61116
* Loop
@@ -70,6 +125,18 @@ If you have already built Loop via Xcode using this Apple ID, you can skip on to
70125
1. Click "Confirm".
71126
1. Remember to do this for each of the identifiers above.
72127

128+
#### Table with Name and Identifier for Loop 3
129+
130+
| NAME | IDENTIFIER |
131+
|-------|------------|
132+
| Loop | com.TEAMID.loopkit.Loop |
133+
| Loop Intent Extension | com.TEAMID.loopkit.Loop.Loop-Intent-Extension |
134+
| Loop Status Extension | com.TEAMID.loopkit.Loop.statuswidget |
135+
| Small Status Widget | com.TEAMID.loopkit.Loop.SmallStatusWidget |
136+
| WatchApp | com.TEAMID.loopkit.Loop.LoopWatch |
137+
| WatchAppExtension | com.TEAMID.loopkit.Loop.LoopWatch.watchkitextension |
138+
139+
73140
## Add Time Sensitive Notifications to Loop App ID
74141
1. Go to [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) on the apple developer site.
75142
1. Click on the "Loop" identifier
@@ -80,7 +147,7 @@ If you have already built Loop via Xcode using this Apple ID, you can skip on to
80147

81148
## Create Loop App in App Store Connect
82149

83-
If you have created a Loop app in App Store Connect before, you can skip this section as well.
150+
If you have created a Loop app in App Store Connect before, you can skip this section.
84151

85152
1. Go to the [apps list](https://appstoreconnect.apple.com/apps) on App Store Connect and click the blue "plus" icon to create a New App.
86153
* Select "iOS".
@@ -95,18 +162,22 @@ You do not need to fill out the next form. That is for submitting to the app sto
95162

96163
## Create Building Certficates
97164

98-
1. Go back to the "Actions" tab of your LoopWorkspace repository in github.
99-
1. Select "Create Certificates".
100-
1. Click "Run Workflow", and tap the green button.
165+
1. Go back to the "Actions" tab of your LoopWorkspace repository in GitHub.
166+
1. On the left side, select "3. Create Certificates".
167+
1. On the right side, click "Run Workflow", and tap the green `Run workflow` button.
101168
1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded.
102169

103-
## Build Loop!
170+
## Build Loop
104171

105172
1. Click on the "Actions" tab of your LoopWorkspace repository.
106-
1. Select "Build Loop".
107-
1. Click "Run Workflow", select your branch, and tap the green button.
173+
1. On the left side, select "4. Build Loop".
174+
1. On the right side, click "Run Workflow", and tap the green `Run workflow` button.
108175
1. You have some time now. Go enjoy a coffee. The build should take about 20-30 minutes.
109176
1. Your app should eventually appear on [App Store Connect](https://appstoreconnect.apple.com/apps).
110177
1. For each phone/person you would like to support Loop on:
111178
* Add them in [Users and Access](https://appstoreconnect.apple.com/access/users) on App Store Connect.
112179
* Add them to your TestFlight Internal Testing group.
180+
181+
## TestFlight and Deployment Details
182+
183+
Please refer to [LoopDocs: Set Up Users](https://loopkit.github.io/loopdocs/gh-actions/gh-first-time/#set-up-users-and-access-testflight) and [LoopDocs: Deploy](https://loopkit.github.io/loopdocs/gh-actions/gh-deploy/)

0 commit comments

Comments
 (0)