-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds #43
Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds #43
Conversation
Looking nice! Please don't hardcode any pre-existing patch urls in. Those patches are not part of Loop, and we want to keep it clear that they're not part of the main supported Loop app. You could have a trivial patch that changes the name of the app or something like that as an example, if you want, but otherwise the workflow should let the user specify which patch file(s) they want to use. |
Thanks @ps2! I have changed the patch templates to a trivial change of Loop app name for submodule Loop, and a general template for LoopKit. I hope this can make it into the next release! |
.github/workflows/build_loop.yml
Outdated
#schedule: | ||
#- cron: '0 17 1 */2 *' # Runs at 17:00 UTC on the 1st in Jan, Mar, May, Jul, Sep and Nov. | ||
#- cron: '0 17 1 * *' # Runs at 17:00 UTC on the 1st in every month. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to base the build time on the last successful build, rather than a fixed day of the month. Someone building on the 31st might be surprised to get another build the next day, if this is billed as a "build once a month" action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be possible based on checking the timestamps on past build artifacts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be daily instead. Why wait a month for the latest build (bug fixes/new features)?
They can chose not to install it in TestFlight.
.github/workflows/build_loop.yml
Outdated
- name: Show value of 'has_new_commits' | ||
run: echo ${{ steps.sync.outputs.has_new_commits }} | ||
|
||
- uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow says it adds a dummy commit to the project periodically. I think this will break the useful notion of tracking what build a person is using by changing the git revision that is included in build details as seen in the issue report. It's also used by analytics to see how many people are running a particular revision.
I think I have messed this branch up a bit while trying to keep it in sync with dev. The PR only really changes 3 files, not 13 as indicated by GitHub. Not sure how to proceed. The actual changes are also on this branch: https://github.com/bjornoleh/LoopWorkspace/tree/auto-update Edit: I just rebased onto dev and force pushed. Hopefully it's ok now. |
I am testing this and communicating with Bjorn via private message. But some information needs to be posted publicly on the PR instead. I really like the Workspace level patches and will be updating docs to enable users to create their own patches and use them with the GitHub build method as well as Mac/Xcode. Comment:
For example, in my testing, I get same result by changing
is
|
Comment:
Comment:
|
Thanks for your input, @marionbarker ! I didn't check up on the differences between wget and curl previously, I just used what I had used before. I notice now that curl defaults to stdout, and as such is the better choice here. Edit: I have changed to curl now, and the default amount of logging is just fine, no need to use the --silent option. Regarding |
c6cfb0d
to
fe2cef8
Compare
I rebased onto current dev now, in case anyone were waiting for merge conflicts to be resolved before proceeding... :-) |
fe2cef8
to
f25e251
Compare
There were still some bad submodule refs that had snuck in, it should be fixed now. I only changed 3 fils in this PR, which is now correctly reflected here. |
Tested this a bit over the weekend and this seems very complete. I'd suggest this is merge-ready and could make it into dev. @ps2 do you still see any unanswered issues? |
1ecaa77
to
a4cad5b
Compare
I made some changes to simplify things a little. I have not gotten much feedback to guide me, but for now I have reverted to let the workflows run on the default branch (main, in most cases), but have also made it so that the currrent branch name is used for both sync and build: If running the auto-update workflow from main, the latest commits on LoopKit main will be pulled, and the main branch on the fork will get these updates. Then the build_loop workflow will be launched (if new commits were found), and the same branch is build. If the auto-update workflow is run from the dev branch, updates are pulled from LoopKit dev and will update the user's dev branch. Then Loop dev will be built. The keep alive action will also run on the same branch. Empty commits will be created if there is repository inactivity of 50 days or more. This has the disadvantage of getting differing commits in the built Loop apps, with consequences for Analytics and possibly for support. If this is unacceptable, I have previously outlined how this can be circumvented by running the workflow from an "actions" branch instead (see discussions above and the now rather long commit history for this feature branch). Redundant Sync upstream action is removed from the build_loop workflow, as this now happens in update.yml. I have currently set build_loop to build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime somewhere in the US?). The auto-update workflow can run much more frequently, possibly nightly, as it currently stands. It will launch the build workflow if new commits are found. Does this still have any chance of making it into dev? I can squash the commits into one if that is desired. |
6f8f0f1
to
39af609
Compare
Changed template for scheduled runs to every month Added env variables for - upstream and target repo/branches - sync upstream 'true'/'false' - customize app 'true'/'false' Added sync action (aormsby/Fork-Sync-With-Upstream-action) to the (sync and) build job Added gautamkrishnar/keepalive-workflow to avoid expiration of scheduled workflows due to repository inactivity (60 days max). Adds an empty commit to fork if no activity during the last 27 days. Added Customize Loop action, which - applies any patches located in the LoopWorkspace/patches/ directory (@billybooth) - downloads (wget) and applies submodule patches specified in build_loop.yml Added (commented-out) CustomTypeOne/LoopPatches as templates for Loop and LoopKit submodule patches.
- runs on a frequent schedule - checks out LoopWorkspace `main` - compares and syncs with LoopKit/LoopWorkspace (unless owner = LoopKit) - keepalive action adds empty commits to LoopKit/LoopWorkspace `main` after `time_elapsed` days to to avoid inactivation of scheduled workflows, when these updates are passed on to forks (only if owner = LoopKit) - launches build_loop.yml workflow on forks to sync and build if new commits are found (unless owner = LoopKit)
- keepalive action moved to update.yml
to be set as default, and used to trigger scheduled builds of the main branch. Empty commits are added to an "actions" branch only (must be created by the user and set as default) to keep this branch "alive" and allow scheduled workflows to run uninterrupted (max 60 days of inactivity). The empty commits will not be included in the resulting TestFlight builds of main. Removed conditionals regarding LoopKit repository.
build_loop.yml: -Remove sync action from build_loop.yml -build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime). -rename env TARGET_BRANCH to BUILD_BRANCH - use current branch as BUILD_BRANCH for easy switching to building main or dev (manually insert alternative branch names as needed) update.yml: - check for updates every day - use current branch name for UPSTREAM_BRANCH and TARGET_BRANCH, to easily switch between dev and main by changing default branch, without any code changes. - do not run the upstream sync action on the upstream LoopKit repository - time_elapsed: 50 days for keepalive action
- with round brackets around branch name for readability: (${{ github.ref_name }})
- Checks for updates nightly - Ensures repository activity - Launches Build job if new commits are found, or if run manually - Workflow file cleanup
* Change the Expiration selection to `No expiration`. * Select the `repo` and `workflow` permission scopes.
39af609
to
5705c01
Compare
fastlane/testflight.md
Outdated
@@ -159,6 +159,18 @@ You do not need to fill out the next form. That is for submitting to the app sto | |||
1. On the right side, click "Run Workflow", and tap the green `Run workflow` button. | |||
1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded. | |||
|
|||
## Create a branch named "alive" | |||
|
|||
You will now create a branch that is used keep your repository active, which allows the TestFlight app to be built and updated automatically. This is needed to circumvent a 60 day repository inactivity limit for scheduled GitHub actions. The "alve" branch will only receive some additional commits to its history, and is not used to build the app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"You will now create a branch..." is a little commanding. Can we instead give them the reason they are doing this, and say "TestFlight builds expire every 90 days. This process you are implementing here will rebuild Loop periodically, and requires that you create a branch named "alive" so that github will not expire the rebuild if no code updates are made"
* Bring in MinimedKit project fix * Add debug log to TidepoolKit * TidepoolKit and TidepoolService updates * Fix double inclusion of ru, and add hi locale * Update LoopKit submodule * Remove TidepoolKitUI references * Ensure food entries have name set * Tidepool carb upload fix refinement * Add initialization error logging to TidepoolService * TidepoolService updates * Omnipod ref codes fixes * Bring in TidepoolService and NightscoutService changes * Fix tests * Update circleci job name * change default job name in circleci * Add version * Bring in RemoteCommands PRs * Ensure each submodule branch is at its HEAD before branching * Bring in latest translations * Readlink fix * Fastfile: Add time sensitive notifications to identifier setup (LoopKit#50) * Fastfile capabilities: add Time Sensitive Notifications to Loop target Spaceship::ConnectAPI::BundleIdCapability::Type::USERNOTIFICATIONS_TIMESENSITIVE * Remove instructions for manually adding Time Sensitive Notifications * G7SensorKit changes * Meal detection fixes for mmol/L * Reorg ps2 frameworks (LoopKit#53) * Update gitmodules to point to LoopKit repos instead of ps2 repos * Moving submodules * Add renamed projects * Nightscout remote cgm rename (LoopKit#54) * Update gitmodules * Update NightscoutRemoteCGM submodule references, and project references * Update submodule rev ro NightscoutRemoteCGM * Always upload artifacts * Changes from Tidepool (LoopKit#55) * Changes from Tidepool * Update to dev * Add merges for NightscoutRemoteCGM and G7SensorKit * Fix tests * Use MKRingProgressView from swift package * Update TidepoolKit * Add Minizip project back in * Update TidepoolKit * Update to ZipFoundation for providing zip file creation abilities (LoopKit#56) * Update to ZipFoundation for providing zip file creation abilities * Update Loop * Update to dev * Warnings cleanup * Tidepool sync (LoopKit#58) * Changes from Tidepool * Update to dev * Add merges for NightscoutRemoteCGM and G7SensorKit * Fix tests * Tidepool Merge * Fix merge issues * Update packages * Add branch name to build name (LoopKit#52) * G7 sensor reading age fix * Another G7 date issue fixed * Status wiget glucose age calc fix * Bring in latest submodule changes * Use current Xcode * Bump xcode version for github workflows * Update github actions to use macos 13, with latest Xcode * Bring in Loop and LoopKit changes * G7 HKDevice update * Bring in LoopKit crash fix * Algorithm experiments (LoopKit#62) * Turn on algorithm experiments * Loop updates * IRC added as experiment * Update Loop submodule * Bring in analytics changes * Bring in IRC fix * Analytics fix * Adding Libre Integration (LoopKit#51) * Libre testing branch * Update submodule * Update libre branch to latest dev * Fixes * Add NFC entitlement * Update LibreTransmitter to main branch * Update submodules to latest dev * update submodule * Add duration to suspend event * Update Nightscout service and LoopKit * Submodule updates * Add NFC_TAG_READING to fastlane bundle id configuration for Loop * Update ZipFoundation revision * Critical log export fix * Tidepool merge (LoopKit#65) * Removing TidepoolKit * Removing TidepoolKit * Update submodules * Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds (LoopKit#43) * Scheduled sync and build, with option to customize Loop Changed template for scheduled runs to every month Added env variables for - upstream and target repo/branches - sync upstream 'true'/'false' - customize app 'true'/'false' Added sync action (aormsby/Fork-Sync-With-Upstream-action) to the (sync and) build job Added gautamkrishnar/keepalive-workflow to avoid expiration of scheduled workflows due to repository inactivity (60 days max). Adds an empty commit to fork if no activity during the last 27 days. Added Customize Loop action, which - applies any patches located in the LoopWorkspace/patches/ directory (@billybooth) - downloads (wget) and applies submodule patches specified in build_loop.yml Added (commented-out) CustomTypeOne/LoopPatches as templates for Loop and LoopKit submodule patches. * Add ./patches/save_patches_here.md * build_loop.yml: update patch templates for submodules * build_loop.yml: comment out patch template for submodule Loop * build_loop.yml: patch template app name = CustomLoop * Update build_loop.yml: fix typo * Update save_patches_here.md: fix typo * build_loop.yml: delete test_mode * build_loop.yml: remove env CUSTOMIZE_APP * Update build_loop.yml: remove remaining env CUSTOMIZE_APP refs * build_loop.yml: remove '--exclude=' from 'git apply' * Create update.yml - runs on a frequent schedule - checks out LoopWorkspace `main` - compares and syncs with LoopKit/LoopWorkspace (unless owner = LoopKit) - keepalive action adds empty commits to LoopKit/LoopWorkspace `main` after `time_elapsed` days to to avoid inactivation of scheduled workflows, when these updates are passed on to forks (only if owner = LoopKit) - launches build_loop.yml workflow on forks to sync and build if new commits are found (unless owner = LoopKit) * Remove keepalive action from build_loop.yml - keepalive action moved to update.yml * Adapt build_loop.yml and update.yml to be run in an "actions" branch to be set as default, and used to trigger scheduled builds of the main branch. Empty commits are added to an "actions" branch only (must be created by the user and set as default) to keep this branch "alive" and allow scheduled workflows to run uninterrupted (max 60 days of inactivity). The empty commits will not be included in the resulting TestFlight builds of main. Removed conditionals regarding LoopKit repository. * build_loop.yml: Add job names for `secrets` and `upstream_sync_and_build` * update.yml: shorter job name for `check_latest_from_upstream`: Check upstream * build_loop.yml: use curl instead of wget for downloading patches * Changes to build_loop.yml and update.yml: build_loop.yml: -Remove sync action from build_loop.yml -build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime). -rename env TARGET_BRANCH to BUILD_BRANCH - use current branch as BUILD_BRANCH for easy switching to building main or dev (manually insert alternative branch names as needed) update.yml: - check for updates every day - use current branch name for UPSTREAM_BRANCH and TARGET_BRANCH, to easily switch between dev and main by changing default branch, without any code changes. - do not run the upstream sync action on the upstream LoopKit repository - time_elapsed: 50 days for keepalive action * Add branch name to run-names - with round brackets around branch name for readability: (${{ github.ref_name }}) * Remove mention of setting TARGET_BRANCH as default, since its not fixed * Move update and keep alive features to build_loop.yml - Checks for updates nightly - Ensures repository activity - Launches Build job if new commits are found, or if run manually - Workflow file cleanup * Delete update.yml * testflight.md: update GH_PAT instructions * Change the Expiration selection to `No expiration`. * Select the `repo` and `workflow` permission scopes. * testflight.md instructions: Create a branch named "alive" * testflight.md: rephrase section on ‘Create a branch named "alive"’ * Added MixpanelService to Loop (LoopKit#63) * Added MixpanelService to Loop * Update module url * bump mixpanel * Xcode 15 Beta 3 fixes * Remove unused project refs, and update MixpanelService signing * build_loop.yml: Disable upstream sync with optional repository variable (LoopKit#67) Set an optional "SYNC_UPSTREAM" repository variable to 'false' to disable syncing of fork with the upstream repository * Update submodules (LoopKit#68) G7 Logging fix Libre Demo retain fix NightscoutRemoteCGM fix deployment target * build_loop.yml: Separate checkout repo for building (LoopKit#69) * build_loop.yml: build_loop.yml: Separate checkout repo for building Checkout for syncing without submodules: recursive * build_loop.yml: remove "submodules: recursive" from checkout for syncing, fix typo. * Bring in IRC changes and always use dynamic carbs * Bring in changes to move charts to LoopKit * Homescreen Medium Widget, and insulin suspension forecast preview * Fastlane widget bundleid updates (LoopKit#75) * Update build_loop.yml * Update build_loop.yml * Update Fastfile for widget extension bundle id change * Adding top-to-bottom algorithm test * Submodule updates * Fix for crash when running forecast previews * Tidepool Sync (LoopKit#80) * Sync script updates (LoopKit#81) * Tidepool Sync * Make sure diffs exist, merge in LoopKit updates * Bring in LoopDataManager race condition fix * Update translation repo list * Update translations from Lokalise (LoopKit#82) * Update translations from Lokalise * Bring in translations for more repos * Bring in translations for more repos * Scheduled build improvements (LoopKit#71) * Add conditional scheduled build and sync * Update testflight.md with instructions for scheduling setup * Fix typo * Remove GITHUB_TOKEN; use GH_PAT instead * Update testflight.md with instructions how to add workflow scope * Fixed conditions for scheduled build * Fix upstream repo owner * Refactor build to use workflow permissions and auto-create alive branch * Change GITHUB_TOKEN to GH_PAT * Change token to GITHUB_TOKEN where appropriate; Make env variable names more descriptive * Fix broken alive branch auto-creation * Update testflight.md with opt-out and new config info * Update cron for sync and schedule, update build condition * Fix typo… * Update testflight.md with suggestions and re-organized contents * Fix typo from PR74 * Browser Build "Validate Secrets" Improvements (LoopKit#77) * Added improved validation and more descriptive error messages * Add validations from suggestions and test feedback * Modify validate_secrets to run in readonly mode * Streamline naming 1/3 * Streamline naming 2/3 * Streamline naming 3/3, add back validation preceding build * Fix LoopWidgetExtension bundle identifier * Add fastlane patterns back after accidentally removing them * Fix Match-Secrets auto-creation and if-condition * validate_secrets.yml: Set pipefail option so that fastlane exit codes are handled correctly * workflows: Include branch in (run) names and use consistent capitalization across reusable job names * This commit is purely aesthetic and aims to make the display names of Jobs consistent across workflows. Likewise, makes spacing and validation error messages consistent. * validate_secrets.yml: Make annotations more "actionable". * validate_secrets.yml: Improve error annotations around GH_PAT permissions * Trivial changes to FASTLANE / ASC error annotations (mention 'Keys' tab) --------- Co-authored-by: Billy Booth <[email protected]> * Bump submodule refs * More carb entry fixes * Omnipod debug logging updates * Fixes for automated builds (LoopKit#83) * Fix broken upstream sync; Remove orphaned environment variable * Fix condition for automated alive branch creation * Disable meal detection when calibrations are present, and localization fix * Bring in fixes for negative duration dose prevention * Bring in functional algo support * Bring in changes for app expiration warning for testflight builds * Tidepool sync * Fix cron schedule for automated sync and build (LoopKit#87) * Fix cron schedule for sync and build * Update cron tab descriptions in testflight.md * Fix typo in comment * Adding missing hindi translations for app intents * Update build destinations * GH Actions: Improve secrets validation (LoopKit#86) * validate_secrets.yml: Pass a "Could not install WWDR certificate" error through validation * validate_secrets.yml: Improve annotation when a public Match-Secrets repo exists * validate_secrets.yml: Rewrite Match-Secrets validation to be explicit about the Match-Secrets repository that will be used When the GH account that the GH_PAT token was created under does not match the repository_owner of the LoopWorkspace repository, the validation routine used a different Match-Secrets repository than fastlane. * validate_secrets.yml: Rewrite GH_PAT validation to capture scopes and distinguish between classic and fine-grained access tokens * validate_secrets.yml: Fix syntax error in Match-Secrets validation job * validate_secrets.yml: Depend less on patterns / read scopes from any token that provides them * Provide HAS_WORKFLOW_PERMISSION as an output * validate_secrets.yml: Annotate failures from unaccepted Apple PLAs * validate_secrets.yml: Fix typo and improve annotation when GH_PAT is invalid * validate_secrets.yml: Improve annotation when authorization fails and token format is unknown * validate_secrets.yml: Minor wording tweak * Update Fastlane to 2.215.0 (LoopKit#88) * Update Gemfile.lock for Fastlane to 2.215.0 Among other improvements, this should fix the WWDR issue. * build_loop.yml: Install bundle, bundle exec - bundle install - bundle exec fastlane build_loop - bundle exec fastlane release * Update Gemfile.lock Commands used to install bundler and update dependencies: sudo gem pristine ffi sudo gem install bundler sudo bundle install sudo bundle update fastlane * Don't install bundler, which comes with Ruby 2.7+ * Install dependencies and use bundler to exec fastlane across workflows --------- Co-authored-by: Billy Booth <[email protected]> * Bring in CGM Event Store * Add Mixpanel service to sync * Bring in Tidepool sync * Bump Loop submodule rev * Service state restoration fix * Upload pod changes to Nightscout as Site Change treatments, for the cannula age (CAGE) pill * MDT Set change upload * Bug fix for mdt set change detection, and upload pump alarms to NS * Add widget fixes * Update circleci build to xcode 15 (LoopKit#89) * Update circleci build to xcode 15 * Update workflow to build with Xcode 15 * Bump device * Fix iphone version * Run tests on iOS 16.4 until iOS 17 simulators are working * Include pending insulin in dosing decision * Update build settings to avoid macos build during translation import * Bump RileyLinkKit rev * heartbeat setup fix, and OmniKit translations * Add slide button cannula insertion * Disable autolock during pod pairing (Dash) * Sync the GitHub runner clock with the Windows time server (LoopKit#98) Adding a step to workflow jobs that interface Apple servers, as a workaround for build issues caused by runner clocks being out of sync. See https://github.com/actions/runner issue number 2996 for details. name: Sync clock run: sudo sntp -sS time.windows.com Added to the following workflows / jobs: validate_secrets.yml / validate-fastlane-secrets add_identifiers.yml / identifiers build_loop.yml / build create_certs.yml / certificates * Update submodules * update to rev of SlideButton package that handles rtl languages (LoopKit#103) * Bump submodule revs * Bring in test updates for iOS 17 * include flag for DEBUG_FEATURES_ENABLED by default (LoopKit#111) * Update submodules for guardrails crash, simulator settings access, and pod pairing UI resumption * Bring in OmniBLE updates * Bring in latest submodule revs * Update browser build action dependencies to meet GH node version requirements (LoopKit#120) * Bump submodule refs * Change GITHUB_TOKEN to user-created GH_PAT (LoopKit#125) Fixes permission issues where GH api responds with: ```swift gh: Resource not accessible by integration (HTTP 403) {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/git/refs#create-a-reference"} Error: Process completed with exit code 1. ``` because the default, auto-created GITHUB_TOKEN cannot be given appropriate content write permissions to create branches in the owner's repository * Update Gemfile.lock to bump Fastlane to 2.220.0 (LoopKit#126) * Update testflight.md - apple moved keys under integrations (LoopKit#112) * Update testflight.md - apple moved keys under integrations * Fix typo * Update fastlane and macOS (LoopKit#143) * update Fastlane to 2.221.1 * update runners to macOS 14 * Update submodules * Ps2/xcode15.4 (LoopKit#145) * Update to xcode15.4 * update ios version used in circleci builds * update ios version used in circleci builds * Update build_loop.yml (LoopKit#146) * Update submodule for CGMBLEKit * Update to Loop 3.4 Release * Fix browser build sync and alive behavior (LoopKit#164) * Fix browser build sync and alive behavior - Added logic to extend the alive check for the existence of either `alive-main` or `alive-dev` branches. - Resolved an issue where unexpected successes were occurring when failures were expected. - Implemented a check to determine the existence of the `alive-main` and `alive-dev` branches and create them if they do not exist. - Introduced a mechanism to identify the current branch being run (either `main` or `dev`). - Based on the current branch, the corresponding alive branch (`alive-main` or `alive-dev`) will be used to check for upstream changes. - Set a new variable `ABORT_SYNC` to `true` when the current branch is neither `dev` nor `main`. - The syncing attempt will proceed based on the `ABORT_SYNC` variable status. - Ensured proper branch synchronization to prevent build inconsistencies and failures - Addresses issue LoopKit/Loop#2192 - Updates app store connect link for validation error hints to new Apple URL scheme * 💚 Security Fix Co-Authored-By: ebouchut <[email protected]> --------- Co-authored-by: ebouchut <[email protected]> * Update for Loop 3.4.1 --------- Co-authored-by: Pete Schwamb <[email protected]> Co-authored-by: bjornoleh <[email protected]> Co-authored-by: Marion Barker <[email protected]> Co-authored-by: Cameron Ingham <[email protected]> Co-authored-by: Noah Brauner <[email protected]> Co-authored-by: Deniz Cengiz <[email protected]> Co-authored-by: Billy Booth <[email protected]> Co-authored-by: Marion Barker <[email protected]> Co-authored-by: ebouchut <[email protected]>
* Bring in MinimedKit project fix * Add debug log to TidepoolKit * TidepoolKit and TidepoolService updates * Fix double inclusion of ru, and add hi locale * Update LoopKit submodule * Remove TidepoolKitUI references * Ensure food entries have name set * Tidepool carb upload fix refinement * Add initialization error logging to TidepoolService * TidepoolService updates * Omnipod ref codes fixes * Bring in TidepoolService and NightscoutService changes * Fix tests * Update circleci job name * change default job name in circleci * Add version * Bring in RemoteCommands PRs * Ensure each submodule branch is at its HEAD before branching * Bring in latest translations * Readlink fix * Fastfile: Add time sensitive notifications to identifier setup (LoopKit#50) * Fastfile capabilities: add Time Sensitive Notifications to Loop target Spaceship::ConnectAPI::BundleIdCapability::Type::USERNOTIFICATIONS_TIMESENSITIVE * Remove instructions for manually adding Time Sensitive Notifications * G7SensorKit changes * Meal detection fixes for mmol/L * Reorg ps2 frameworks (LoopKit#53) * Update gitmodules to point to LoopKit repos instead of ps2 repos * Moving submodules * Add renamed projects * Nightscout remote cgm rename (LoopKit#54) * Update gitmodules * Update NightscoutRemoteCGM submodule references, and project references * Update submodule rev ro NightscoutRemoteCGM * Always upload artifacts * Changes from Tidepool (LoopKit#55) * Changes from Tidepool * Update to dev * Add merges for NightscoutRemoteCGM and G7SensorKit * Fix tests * Use MKRingProgressView from swift package * Update TidepoolKit * Add Minizip project back in * Update TidepoolKit * Update to ZipFoundation for providing zip file creation abilities (LoopKit#56) * Update to ZipFoundation for providing zip file creation abilities * Update Loop * Update to dev * Warnings cleanup * Tidepool sync (LoopKit#58) * Changes from Tidepool * Update to dev * Add merges for NightscoutRemoteCGM and G7SensorKit * Fix tests * Tidepool Merge * Fix merge issues * Update packages * Add branch name to build name (LoopKit#52) * G7 sensor reading age fix * Another G7 date issue fixed * Status wiget glucose age calc fix * Bring in latest submodule changes * Use current Xcode * Bump xcode version for github workflows * Update github actions to use macos 13, with latest Xcode * Bring in Loop and LoopKit changes * G7 HKDevice update * Bring in LoopKit crash fix * Algorithm experiments (LoopKit#62) * Turn on algorithm experiments * Loop updates * IRC added as experiment * Update Loop submodule * Bring in analytics changes * Bring in IRC fix * Analytics fix * Adding Libre Integration (LoopKit#51) * Libre testing branch * Update submodule * Update libre branch to latest dev * Fixes * Add NFC entitlement * Update LibreTransmitter to main branch * Update submodules to latest dev * update submodule * Add duration to suspend event * Update Nightscout service and LoopKit * Submodule updates * Add NFC_TAG_READING to fastlane bundle id configuration for Loop * Update ZipFoundation revision * Critical log export fix * Tidepool merge (LoopKit#65) * Removing TidepoolKit * Removing TidepoolKit * Update submodules * Add scheduled sync and build, and allow for customization of Loop with GitHub Actions / Fastlane builds (LoopKit#43) * Scheduled sync and build, with option to customize Loop Changed template for scheduled runs to every month Added env variables for - upstream and target repo/branches - sync upstream 'true'/'false' - customize app 'true'/'false' Added sync action (aormsby/Fork-Sync-With-Upstream-action) to the (sync and) build job Added gautamkrishnar/keepalive-workflow to avoid expiration of scheduled workflows due to repository inactivity (60 days max). Adds an empty commit to fork if no activity during the last 27 days. Added Customize Loop action, which - applies any patches located in the LoopWorkspace/patches/ directory (@billybooth) - downloads (wget) and applies submodule patches specified in build_loop.yml Added (commented-out) CustomTypeOne/LoopPatches as templates for Loop and LoopKit submodule patches. * Add ./patches/save_patches_here.md * build_loop.yml: update patch templates for submodules * build_loop.yml: comment out patch template for submodule Loop * build_loop.yml: patch template app name = CustomLoop * Update build_loop.yml: fix typo * Update save_patches_here.md: fix typo * build_loop.yml: delete test_mode * build_loop.yml: remove env CUSTOMIZE_APP * Update build_loop.yml: remove remaining env CUSTOMIZE_APP refs * build_loop.yml: remove '--exclude=' from 'git apply' * Create update.yml - runs on a frequent schedule - checks out LoopWorkspace `main` - compares and syncs with LoopKit/LoopWorkspace (unless owner = LoopKit) - keepalive action adds empty commits to LoopKit/LoopWorkspace `main` after `time_elapsed` days to to avoid inactivation of scheduled workflows, when these updates are passed on to forks (only if owner = LoopKit) - launches build_loop.yml workflow on forks to sync and build if new commits are found (unless owner = LoopKit) * Remove keepalive action from build_loop.yml - keepalive action moved to update.yml * Adapt build_loop.yml and update.yml to be run in an "actions" branch to be set as default, and used to trigger scheduled builds of the main branch. Empty commits are added to an "actions" branch only (must be created by the user and set as default) to keep this branch "alive" and allow scheduled workflows to run uninterrupted (max 60 days of inactivity). The empty commits will not be included in the resulting TestFlight builds of main. Removed conditionals regarding LoopKit repository. * build_loop.yml: Add job names for `secrets` and `upstream_sync_and_build` * update.yml: shorter job name for `check_latest_from_upstream`: Check upstream * build_loop.yml: use curl instead of wget for downloading patches * Changes to build_loop.yml and update.yml: build_loop.yml: -Remove sync action from build_loop.yml -build on schedule on the 1th every month for a predictable build schedule well within the 90 day TestFlight limit. The time of day should be chosen as a time where ongoing changes are unlikely during releases (nighttime). -rename env TARGET_BRANCH to BUILD_BRANCH - use current branch as BUILD_BRANCH for easy switching to building main or dev (manually insert alternative branch names as needed) update.yml: - check for updates every day - use current branch name for UPSTREAM_BRANCH and TARGET_BRANCH, to easily switch between dev and main by changing default branch, without any code changes. - do not run the upstream sync action on the upstream LoopKit repository - time_elapsed: 50 days for keepalive action * Add branch name to run-names - with round brackets around branch name for readability: (${{ github.ref_name }}) * Remove mention of setting TARGET_BRANCH as default, since its not fixed * Move update and keep alive features to build_loop.yml - Checks for updates nightly - Ensures repository activity - Launches Build job if new commits are found, or if run manually - Workflow file cleanup * Delete update.yml * testflight.md: update GH_PAT instructions * Change the Expiration selection to `No expiration`. * Select the `repo` and `workflow` permission scopes. * testflight.md instructions: Create a branch named "alive" * testflight.md: rephrase section on ‘Create a branch named "alive"’ * Added MixpanelService to Loop (LoopKit#63) * Added MixpanelService to Loop * Update module url * bump mixpanel * Xcode 15 Beta 3 fixes * Remove unused project refs, and update MixpanelService signing * build_loop.yml: Disable upstream sync with optional repository variable (LoopKit#67) Set an optional "SYNC_UPSTREAM" repository variable to 'false' to disable syncing of fork with the upstream repository * Update submodules (LoopKit#68) G7 Logging fix Libre Demo retain fix NightscoutRemoteCGM fix deployment target * build_loop.yml: Separate checkout repo for building (LoopKit#69) * build_loop.yml: build_loop.yml: Separate checkout repo for building Checkout for syncing without submodules: recursive * build_loop.yml: remove "submodules: recursive" from checkout for syncing, fix typo. * Bring in IRC changes and always use dynamic carbs * Bring in changes to move charts to LoopKit * Homescreen Medium Widget, and insulin suspension forecast preview * Fastlane widget bundleid updates (LoopKit#75) * Update build_loop.yml * Update build_loop.yml * Update Fastfile for widget extension bundle id change * Adding top-to-bottom algorithm test * Submodule updates * Fix for crash when running forecast previews * Tidepool Sync (LoopKit#80) * Sync script updates (LoopKit#81) * Tidepool Sync * Make sure diffs exist, merge in LoopKit updates * Bring in LoopDataManager race condition fix * Update translation repo list * Update translations from Lokalise (LoopKit#82) * Update translations from Lokalise * Bring in translations for more repos * Bring in translations for more repos * Scheduled build improvements (LoopKit#71) * Add conditional scheduled build and sync * Update testflight.md with instructions for scheduling setup * Fix typo * Remove GITHUB_TOKEN; use GH_PAT instead * Update testflight.md with instructions how to add workflow scope * Fixed conditions for scheduled build * Fix upstream repo owner * Refactor build to use workflow permissions and auto-create alive branch * Change GITHUB_TOKEN to GH_PAT * Change token to GITHUB_TOKEN where appropriate; Make env variable names more descriptive * Fix broken alive branch auto-creation * Update testflight.md with opt-out and new config info * Update cron for sync and schedule, update build condition * Fix typo… * Update testflight.md with suggestions and re-organized contents * Fix typo from PR74 * Browser Build "Validate Secrets" Improvements (LoopKit#77) * Added improved validation and more descriptive error messages * Add validations from suggestions and test feedback * Modify validate_secrets to run in readonly mode * Streamline naming 1/3 * Streamline naming 2/3 * Streamline naming 3/3, add back validation preceding build * Fix LoopWidgetExtension bundle identifier * Add fastlane patterns back after accidentally removing them * Fix Match-Secrets auto-creation and if-condition * validate_secrets.yml: Set pipefail option so that fastlane exit codes are handled correctly * workflows: Include branch in (run) names and use consistent capitalization across reusable job names * This commit is purely aesthetic and aims to make the display names of Jobs consistent across workflows. Likewise, makes spacing and validation error messages consistent. * validate_secrets.yml: Make annotations more "actionable". * validate_secrets.yml: Improve error annotations around GH_PAT permissions * Trivial changes to FASTLANE / ASC error annotations (mention 'Keys' tab) --------- Co-authored-by: Billy Booth <[email protected]> * Bump submodule refs * More carb entry fixes * Omnipod debug logging updates * Fixes for automated builds (LoopKit#83) * Fix broken upstream sync; Remove orphaned environment variable * Fix condition for automated alive branch creation * Disable meal detection when calibrations are present, and localization fix * Bring in fixes for negative duration dose prevention * Bring in functional algo support * Bring in changes for app expiration warning for testflight builds * Tidepool sync * Fix cron schedule for automated sync and build (LoopKit#87) * Fix cron schedule for sync and build * Update cron tab descriptions in testflight.md * Fix typo in comment * Adding missing hindi translations for app intents * Update build destinations * GH Actions: Improve secrets validation (LoopKit#86) * validate_secrets.yml: Pass a "Could not install WWDR certificate" error through validation * validate_secrets.yml: Improve annotation when a public Match-Secrets repo exists * validate_secrets.yml: Rewrite Match-Secrets validation to be explicit about the Match-Secrets repository that will be used When the GH account that the GH_PAT token was created under does not match the repository_owner of the LoopWorkspace repository, the validation routine used a different Match-Secrets repository than fastlane. * validate_secrets.yml: Rewrite GH_PAT validation to capture scopes and distinguish between classic and fine-grained access tokens * validate_secrets.yml: Fix syntax error in Match-Secrets validation job * validate_secrets.yml: Depend less on patterns / read scopes from any token that provides them * Provide HAS_WORKFLOW_PERMISSION as an output * validate_secrets.yml: Annotate failures from unaccepted Apple PLAs * validate_secrets.yml: Fix typo and improve annotation when GH_PAT is invalid * validate_secrets.yml: Improve annotation when authorization fails and token format is unknown * validate_secrets.yml: Minor wording tweak * Update Fastlane to 2.215.0 (LoopKit#88) * Update Gemfile.lock for Fastlane to 2.215.0 Among other improvements, this should fix the WWDR issue. * build_loop.yml: Install bundle, bundle exec - bundle install - bundle exec fastlane build_loop - bundle exec fastlane release * Update Gemfile.lock Commands used to install bundler and update dependencies: sudo gem pristine ffi sudo gem install bundler sudo bundle install sudo bundle update fastlane * Don't install bundler, which comes with Ruby 2.7+ * Install dependencies and use bundler to exec fastlane across workflows --------- Co-authored-by: Billy Booth <[email protected]> * Bring in CGM Event Store * Add Mixpanel service to sync * Bring in Tidepool sync * Bump Loop submodule rev * Service state restoration fix * Upload pod changes to Nightscout as Site Change treatments, for the cannula age (CAGE) pill * MDT Set change upload * Bug fix for mdt set change detection, and upload pump alarms to NS * Add widget fixes * Update circleci build to xcode 15 (LoopKit#89) * Update circleci build to xcode 15 * Update workflow to build with Xcode 15 * Bump device * Fix iphone version * Run tests on iOS 16.4 until iOS 17 simulators are working * Include pending insulin in dosing decision * Update build settings to avoid macos build during translation import * Bump RileyLinkKit rev * heartbeat setup fix, and OmniKit translations * Add slide button cannula insertion * Disable autolock during pod pairing (Dash) * Sync the GitHub runner clock with the Windows time server (LoopKit#98) Adding a step to workflow jobs that interface Apple servers, as a workaround for build issues caused by runner clocks being out of sync. See https://github.com/actions/runner issue number 2996 for details. name: Sync clock run: sudo sntp -sS time.windows.com Added to the following workflows / jobs: validate_secrets.yml / validate-fastlane-secrets add_identifiers.yml / identifiers build_loop.yml / build create_certs.yml / certificates * Update submodules * update to rev of SlideButton package that handles rtl languages (LoopKit#103) * Bump submodule revs * Bring in test updates for iOS 17 * include flag for DEBUG_FEATURES_ENABLED by default (LoopKit#111) * Update submodules for guardrails crash, simulator settings access, and pod pairing UI resumption * Bring in OmniBLE updates * Bring in latest submodule revs * Update browser build action dependencies to meet GH node version requirements (LoopKit#120) * Bump submodule refs * Change GITHUB_TOKEN to user-created GH_PAT (LoopKit#125) Fixes permission issues where GH api responds with: ```swift gh: Resource not accessible by integration (HTTP 403) {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/git/refs#create-a-reference"} Error: Process completed with exit code 1. ``` because the default, auto-created GITHUB_TOKEN cannot be given appropriate content write permissions to create branches in the owner's repository * Update Gemfile.lock to bump Fastlane to 2.220.0 (LoopKit#126) * Update testflight.md - apple moved keys under integrations (LoopKit#112) * Update testflight.md - apple moved keys under integrations * Fix typo * Update fastlane and macOS (LoopKit#143) * update Fastlane to 2.221.1 * update runners to macOS 14 * Update submodules * Ps2/xcode15.4 (LoopKit#145) * Update to xcode15.4 * update ios version used in circleci builds * update ios version used in circleci builds * Update build_loop.yml (LoopKit#146) * Update submodule for CGMBLEKit * Update to Loop 3.4 Release * Fix browser build sync and alive behavior (LoopKit#164) * Fix browser build sync and alive behavior - Added logic to extend the alive check for the existence of either `alive-main` or `alive-dev` branches. - Resolved an issue where unexpected successes were occurring when failures were expected. - Implemented a check to determine the existence of the `alive-main` and `alive-dev` branches and create them if they do not exist. - Introduced a mechanism to identify the current branch being run (either `main` or `dev`). - Based on the current branch, the corresponding alive branch (`alive-main` or `alive-dev`) will be used to check for upstream changes. - Set a new variable `ABORT_SYNC` to `true` when the current branch is neither `dev` nor `main`. - The syncing attempt will proceed based on the `ABORT_SYNC` variable status. - Ensured proper branch synchronization to prevent build inconsistencies and failures - Addresses issue LoopKit/Loop#2192 - Updates app store connect link for validation error hints to new Apple URL scheme * 💚 Security Fix Co-Authored-By: ebouchut <[email protected]> --------- Co-authored-by: ebouchut <[email protected]> * Update for Loop 3.4.1 * Xcode 16 updates. Loop 3.4.2 * Update Gemfile.lock for Fastlane 2.223.1 (LoopKit#208) * Update submodules for Loop 3.4.3 (LoopKit#211) * Update submodules * LoopKit: Improve selection choice visibility * LoopKit: fix locale for CarbEntry decimal separator * Loop: update version number to 3.4.3 * Loop 3.4.4 * Fix submodule refs for v3.4.4 * Restore main submodule ref for 3.4.4 --------- Co-authored-by: Pete Schwamb <[email protected]> Co-authored-by: bjornoleh <[email protected]> Co-authored-by: Marion Barker <[email protected]> Co-authored-by: Cameron Ingham <[email protected]> Co-authored-by: Noah Brauner <[email protected]> Co-authored-by: Deniz Cengiz <[email protected]> Co-authored-by: Billy Booth <[email protected]> Co-authored-by: Marion Barker <[email protected]> Co-authored-by: ebouchut <[email protected]>
This PR should make it very easy to get TestFlight distributions built on schedule every month, and thus avoid expiration of the TestFlight-distributed app (max 90 days), and also avoid inactivation of the scheduled workflow due to repository inactivity (max 60 days of inactivity). The fork of LoopWorkspace will be synced with upstream (LoopKit/LoopWorkspace) at every run of
build_loop.yml
, so users will get the latest released version (main) within a month, or when running the workflow manually at any time. The workflow will build and sync from main by default, but other branches and repos can be specified by env-variables in the workflow.An option to customize Loop by patches at workspace and/or submodule level is also included. Workspace patches can be saved in ./patches. Submodule patches from GitHub commit or PR links with .patch appended can be added to
build_loop.yml
, and will be downloaded by wget and applied to the specified submodule. CustomTypeOne/LoopPatches are used as templates for Loop and LoopKit submodule patches.Thanks @bjorkert and @billybooth for support and review!