These instructions allow you to build Trio without having access to a Mac.
The browser build defaults to automatically updating and building a new version of Trio according to this schedule:
- automatically checks for updates weekly on Wednesdays and if updates are found, it will build a new version of the app
- automatically builds once a month regardless of whether there are updates on the first of the month
- with each scheduled run (weekly or monthly), a successful Build Trio log appears - if the time is very short, it did not need to build - only the long actions (>10 minutes) built a new Trio app
It also creates an alive branch, if you don't already have one. See Why do I have an alive branch?.
The Optional section provides instructions to modify the default behavior if desired. >
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.
Note that TestFlight requires apple id accounts 13 years or older. This can be circumvented by logging into Media & Purchase on the child's phone with an adult's account. More details on this can be found in LoopDocs.
This method for building without a Mac was ported from Loop. If you have used this method for Loop or one of the other DIY apps (Loop Caregiver, Loop Follow, Xdrip4iOS), some of the steps can be re-used and the full set of instructions does not need to be repeated. This will be mentioned in relevant sections below.
There are more detailed instructions in LoopDocs for doing Browser Builds of Loop and other apps, including troubleshooting and build errors. Please refer to LoopDocs for more details.
You require 6 Secrets (alphanumeric items) to use the GitHub build method and if you use the GitHub method to build other apps, e.g., Loop Follow or Xdrip4iOS, 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.
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.
TEAMID.FASTLANE_ISSUER_ID.FASTLANE_KEY_ID.FASTLANE_KEY. Copy the full text, including the "-----BEGIN PRIVATE KEY-----" and "-----END PRIVATE KEY-----" lines.If you have previously built another app using the "browser build" method, you can can re-use your previous personal access token (GH_PAT) and skip this step.
Log into your GitHub account to create a personal access token; this is one of two GitHub secrets needed for your build.
No expiration.workflow permission scope - this also selects repo scope.GH_PAT.This is the second one of two GitHub secrets needed for your build.
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).
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.
Match-Secrets. It should be private.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.
TEAMIDFASTLANE_ISSUER_IDFASTLANE_KEY_IDFASTLANE_KEYGH_PATMATCH_PASSWORDThis step validates most of your six Secrets and provides error messages if it detects an issue with one or more.
Run workflow button.Run workflow button.If you have already built Trio via Xcode using this Apple ID, you can skip on to Create Trio App in App Store Connect. Please note that in default builds of Trio, the app group is actually identical to the one used with Loop, so please enter these details exactly as described below. This is to ease the setup of apps such as Xdrip4iOS. It may require some caution if transfering between Trio and Loop.
TEAMID.If you have created a Trio app in App Store Connect before, you can skip this section as well.
BUNDLE_IDENTIFIER in your Config.xcconfig file
org.nightscout.TEAMID.trio with TEAMID matching your team idYou do not need to fill out the next form. That is for submitting to the app store.
For more details, please refer to LoopDocs: Set Up Users and LoopDocs: Deploy
alive branch?If a GitHub repository has no activity (no commits are made) in 60 days, then GitHub disables the ability to use automated actions for that repository. We need to take action more frequently than that or the automated build process won't work.
The build_trio.yml file uses a special branch called alive and adds a dummy commit to the alive branch at regular intervals. This "trick" keeps the Actions enabled so the automated build works.
The branch alive is created automatically for you. Do not delete or rename it! Do not modify alive yourself; it is not used for building the app.
What if you don't want to allow automated updates of the repository or automatic builds?
You can affect the default behavior:
GH_PAT workflow permissionTo enable the scheduled build and sync, the GH_PAT must hold the workflow permission scopes. This permission serves as the enabler for automatic and scheduled builds with browser build. To verify your token holds this permission, follow these steps.
repo, workflow next to the FastLane Access Token linkworkflow box. You will see that the checked boxes for the repo scope become disabled (change color to dark gray and are not clickable)Update token buttonIf you choose not to have automatic building enabled, be sure the GH_PAT has repo scope or you won't be able to manually build.
You can modify the automation by creating and using some variables.
To configure the automated build more granularly involves creating up to two environment variables: SCHEDULED_BUILD and/or SCHEDULED_SYNC. See How to configure a variable.
Note that the weekly and monthly Build Trio actions will continue, but the actions are modified if one or more of these variables is set to false. A successful Action Log will still appear, even if no automatic activity happens.
SCHEDULED_SYNC to false and either do not create SCHEDULED_BUILD or set it to trueSCHEDULED_BUILD to false and either do not create SCHEDULED_SYNC or set it to true
SCHEDULED_SYNC |
SCHEDULED_BUILD |
Automatic Actions |
|---|---|---|
true (or NA) |
true (or NA) |
keep-alive, weekly update check (auto update/build), monthly build with auto update |
true (or NA) |
false |
keep-alive, weekly update check with auto update, only builds if update detected |
false |
true (or NA) |
keep-alive, monthly build, no auto update |
false |
false |
no automatic activity, no keep-alive |
Secrets and Variables.ActionsVariables tabNew repository variable button (upper right)SCHEDULED_BUILD in the "Name" fieldfalse in the "Value" fieldAdd variable button to save.New repository variable button (upper right)SCHEDULED_SYNC in the "Name" fieldfalse in the "Value" fieldAdd variable button to save
Your build will run on the following conditions:
alive branch if necessaryfalse), no updates, keep-alive or building happens when Build Trio runsSCHEDULED_SYNC set tofalse), it will only run once a month, on the first of the month, no update will happen; keep-alive will runSCHEDULED_BUILD set tofalse), it will run once weekly, every Wednesday, to check for changes; if there are changes, it will update and build; keep-alive will run