Skip to content

Commit f0a3958

Browse files
authored
Merge pull request #413 from loopandlearn/add_release_script
Add a script to assist in release process for LoopFollow, LoopFollow_Second and LoopFollow_Third
2 parents 0252d3a + 2e9af60 commit f0a3958

File tree

3 files changed

+199
-66
lines changed

3 files changed

+199
-66
lines changed

README.md

Lines changed: 47 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
> **Message from the Loop and Learn Team:**
2-
> * We have taken responsibility for updates to the Loop Follow app
3-
> * Additional Loop Follow documentation is at [Loop and Learn: Loop Follow](https://www.loopandlearn.org/loop-follow/)
2+
> * We have taken responsibility for updates to the LoopFollow app - many thanks to Jon Fawcett, the originator of this app
3+
> * Additional LoopFollow documentation is at [Loop and Learn: LoopFollow](https://www.loopandlearn.org/loop-follow/)
44
> * If you are having problems with the app:
5-
> * Post in the [Loop and Learn Facebook group](https://www.facebook.com/groups/LOOPandLEARN); indicate that your question is related to Loop Follow
5+
> * Please join the [LoopFollow Facebook group](https://www.facebook.com/groups/loopfollowlnl);
6+
> * You can also post in the [Loop and Learn Facebook group](https://www.facebook.com/groups/LOOPandLEARN); but be sure to indicate that your question is related to LoopFollow
67
> * If you do not use Facebook - please click on this [link to file an Issue](https://github.com/loopandlearn/LoopFollow/issues) with your problem
78
89
> **New location for LoopFollow Repository:**
@@ -11,37 +12,26 @@
1112
> * GitHub should automatically redirect you to this new address
1213
> * We have also modifed one branch and one file name to match standard conventions: _main_ (from _Main_) and _README.md_ (from _readme.md_)
1314
14-
> **Message from Jon Fawcett:**
15-
> * Because our family now uses Omnipod 5, I will no longer be involved in updating LoopFollow
16-
> * I have transferred the _LoopFollow_ repository from the _JonFawcett_ to the _loopandlearn_ username
17-
> * I will also no longer provide an option for a TestFlight invitation from me. (Jon Fawcett)
18-
> * You must build the app yourself.
19-
2015
> **Message to Developers**
2116
2217
* Please click on this link: [For Developers](#for-developers)
2318

24-
## Loop Follow
25-
![screenshot](https://user-images.githubusercontent.com/38429455/93782187-436e8880-fbf8-11ea-8709-e2afba692132.png)
19+
## LoopFollow
2620

2721
### Purpose:
2822

29-
Using so many different apps as a parent or caregiver of a T1D can be very cumbersome. Add in the extra details from Looping
30-
and it can be a challenge flipping back and forth between apps. Each app has different strengths and weaknesses.
31-
- Spike is great for alarms.
32-
- Spike and Sugarmate are great for the calendar complication on Apple Watch.
33-
- Nightscout X or Nightscout in Safari are needed for intricate details from NS.
34-
- IFTTT and Pushover are needed for Not Looping alerts.
23+
Using so many different apps as a parent or caregiver of a T1D can be very cumbersome. Add in the extra details from looping with an Open Source Automated Insulin Delivery app
24+
and it can be a challenge flipping back and forth between apps. Each app has different strengths and weaknesses. LoopFollow melds together some needs into one app.
25+
26+
An example of the main screen for LoopFollow is shown in the graphic below:
3527

36-
And there are some functions I've always wished for and not found anywhere such a one-time temporary alert
37-
for those nights when Loop is stuck on high and you open loop with a correction. This lets you set a higher
38-
low alert for the BG you want to wake up to and close Loop.
28+
![example of main screen for LoopFollow](img/loopfollow-main-screen.png)}
3929

4030
### Building Options
4131

42-
Please see [Loop and Learn: Loop Follow](https://www.loopandlearn.org/loop-follow/) for all the building options.
32+
Please see [Loop and Learn: LoopFollow](https://www.loopandlearn.org/loop-follow/) for all the building options.
4333

44-
With the release of version 2.1.0, there is now an easy option for building up to three instances of the Loop Follow app for multiple Loopers in your family. Each instance can be configured to have the display name you choose with these names being the default:
34+
With the release of version 2.1.0, there is now an easy option for building up to three instances of the LoopFollow app for multiple Loopers in your family. Each instance can be configured to have the display name you choose with these names being the default:
4535

4636
* LoopFollow
4737
* LoopFollow_Second
@@ -56,7 +46,7 @@ The _display_name_ is found in a single file.
5646
Summary instructions by build method:
5747

5848
* Browser Build:
59-
* Fork and setup the repository for each Loop Follow instance you want to use:
49+
* Fork and setup the repository for each LoopFollow instance you want to use:
6050
* https://github.com/loopandlearn/LoopFollow
6151
* https://github.com/loopandlearn/LoopFollow_Second
6252
* https://github.com/loopandlearn/LoopFollow_Third
@@ -69,55 +59,27 @@ Summary instructions by build method:
6959
* LoopFollowDisplayNameConfig_Second.xcconfig
7060
* LoopFollowDisplayNameConfig_Third.xcconfig
7161

72-
#### Updates
62+
### Updates
7363

74-
When modifications and versions are updated, there might be a slight delay for getting the second and third forks updated as well, so if you are using this feature, wait until all three repositories are updated.
64+
When modifications and versions are updated, you might see activity at GitHub. Please wait for the release message to be posted at [LoopFollow Releases](https://github.com/loopandlearn/LoopFollow/releases) before using the updated versions for the `main` branch of LoopFollow, LoopFollow_Second and LoopFollow_Third.
7565

76-
### General feature list
66+
### Version Numbers
7767

78-
Please review the list on [Loop and Learn: Loop Follow](https://www.loopandlearn.org/loop-follow/) which may be updated more frequently than this README.md file.
79-
80-
Each time a release is made, the features added or bugs fixed are found at [Loop Follow Releases](https://github.com/loopandlearn/LoopFollow/releases).
81-
82-
Each of the features below is selectable - you decide whether to use them.  Additionally, many features are adjustable because YDMV (your diabetes may vary).
83-
84-
1. Scrollable/scalable graph display with BG, IOB, COB, Basal, Bolus, and the General Nightscout Care portal info
85-
* Supports Glucose display when Dexcom is available but Nightscout is not
86-
* Supports compatible data from Nightscout when the URL is provided (enable `Show Nightscout Settings` to see the URL, Token and Status rows)
87-
* Loop: Loop status, Loop Prediction
88-
* Trio and iAPS: status, Prediction lines, Autosens
89-
* To remove the Data Table associated with NS, enter a blank line in URL
90-
2. Tap on Alarms on Toolbar to configure.
91-
* Override DND (Do Not Disturb) and system volume for all alerts with a Snooze All Until and a Mute All Until
92-
* List of Alarms covers the standard high/low/rise/fall/urgent glucose but also include alerts for missed glucose readings, if below configured glucose, IOB, COB, Not Looping, Overrides, Pump, Missed Bolus, SAGE, CAGE, Battery and Rec. Bolus
93-
* Each Alarm has configurable settings including Sound selection, PreSnooze (set to be quiet At Night, During Day or Never) and Snooze Until and in some cases glucose ranges at which they are active
94-
3. Calendar entries (displayed on watch and/or carplay at 5 minute intervals) pre-formatted with two lines that the user can modify:
95-
* BG, arrow, delta,  MINAGO (minutes ago for reading)
96-
* COB, IOB, Basal (U/hr)
97-
4. Background silent audio is played to keep iOS from killing the app; this trick is why it can’t go into the App Store for a simple download and why Loop Follow puts an extra load on the phone battery
98-
5. Badge displays the current BG value on the app icon
99-
6. Information Display Settings allows user to configure the items selected and their order for the right panel when Nightscout URL is provided
100-
* IOB, COB, Basal, Override, Battery, Pump, SAGE, CAGE, (Recommended) Rec. Bolus, (Glucose Eventually) Pred., Carbs today (Loop, Trio and iAPS)
101-
* Autosens (Trio and iAPS only)
102-
7. Pull down on the glucose value to force a refresh from Nightscout (iPhone only - does not work on Mac)
103-
8. When adding a Nightscout site, NS Status says "Checking", "Site Not Found", "Token Required", "Invalid Token", or "OK"
104-
9. New with v2.1.2: Multiple Loopers (up to 3) are easily supported with either Browser Build or Mac-Xcode build
105-
10. New with v2.1.2: The app name (displayed on phone) can be customized when building
106-
* If enabled, that custom name will be displayed on the main Loop Follow display
68+
Updates to the `main` branch (releases) have a version number that ends in 0; for example, 2.7.0.
10769

108-
### Open Source DIY
109-
- This is a DIY open source project that may or may not function as you expect. You take full responsibility for building and running this app and do so at your own risk.
70+
* Immediately following the release, the `dev` branch is at the same version as `main` indicating the code is identical
71+
* Each time a feature is merged into the `dev` branch, the final number increments; for example, 2.7.1, 2.7.2
72+
* When the next release is made, the second digit is incremented and the final digit is restore to 0 for both `main` and `dev`; for example, 2.8.0
11073

111-
## Versions
74+
### General feature list
11275

113-
We added version numbers to Loop Follow. Typically the main branch and dev branch are at the same version, but when work is underway, the dev branch may have different code, which we try to indicate with a different version number.
76+
Please review the list on [Loop and Learn: LoopFollow](https://www.loopandlearn.org/loop-follow/).
11477

115-
The versioning is:
78+
Each time a release is made, the features added or bugs fixed for that particular release are found at [LoopFollow Releases](https://github.com/loopandlearn/LoopFollow/releases).
11679

117-
* major.minor.micro
118-
* For example our first version is 2.0.0
80+
### Open Source DIY
11981

120-
For the most part, the deveopers keep main and dev branches at the same level. But sometimes we want to combine several PR or keep a modification in dev for additional testing.
82+
> This is a DIY open source project that may or may not function as you expect. You take full responsibility for building and running this app and do so at your own risk.
12183
12284
## For Developers
12385

@@ -126,8 +88,27 @@ For the most part, the deveopers keep main and dev branches at the same level. B
12688
12789
New PR are directed to the dev branch. If you direct one to main, we will move it to point to dev. So always start with your code aligned with dev.
12890

129-
After a PR is merged to dev, the repository maintainers will bump up the verion number before merging to main - please do not modify the version in your branch.
91+
Always rename your branch (that is aligned with `dev`) to a name suitable for your feature, for example, `feature_name`, before starting to add commits to your branch.
92+
93+
After a PR is merged to `dev`, there is an automatic bump up the version number - please do not modify the version in your branch.
94+
95+
### Version Updates
96+
97+
Only the maintainers for LoopFollow will update version numbers.
98+
99+
### Release Process
100+
101+
To assist in releasing to all three LoopFollow repositories, the script `release.sh` is now available. This bumps up the version number to M.N+1.0 for a minor release or M+1.0.0 for a major release. It also updates the LoopFollow_Second and LoopFollow_Third repositories with parallel changes to what was just released for LoopFollow. Only LoopFollow uses a `dev` branch. The other repositories use just the `main` branch and are kept at the released version.
102+
103+
When a release is generated, the updates found in the `dev` branch are merged into `main`; the version number in the `Config.xcconfig` file is updated to A.B.O; a tag of the form v.A.B.0 is created and associated with the `main` branch at that time.
104+
105+
When PR are subsequently merged to `dev`, the version number is incremented by 1 in the last place, e.g., "v.A.B.1" etc.
106+
107+
### Files in LoopFollow Only
108+
109+
There are several files found only in the LoopFollow repository:
130110

131-
#### Version Updates
111+
* .github/workflow/auto_version_dev.yml
112+
* release.sh
132113

133-
Only the maintainers for Loop Follow will update version numbers. This is done by incrementing the LOOP_FOLLOW_MARKETING_VERSION in Config.xcconfig file.
114+
These files are not added to _Second or _Third version because they are not needed for those repositories.

img/loopfollow-main-screen.png

327 KB
Loading

release.sh

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#!/usr/bin/env bash
2+
# ------------------------------------------------------------
3+
# release.sh – semi-automatic release helper
4+
# ------------------------------------------------------------
5+
set -euo pipefail
6+
set -o errtrace
7+
trap 'echo "❌ Error – aborting"; exit 1' ERR
8+
9+
# -------- configurable -----------------
10+
APP_NAME="${1:-LoopFollow}"
11+
SECOND_DIR="${APP_NAME}_Second"
12+
THIRD_DIR="${APP_NAME}_Third"
13+
VERSION_FILE="Config.xcconfig"
14+
MARKETING_KEY="LOOP_FOLLOW_MARKETING_VERSION"
15+
DEV_BRANCH="dev"
16+
MAIN_BRANCH="main"
17+
PATCH_DIR="../${APP_NAME}_update_patches"
18+
# ---------------------------------------
19+
20+
# --- functions here ---
21+
pause() { read -rp "▶▶ Press Enter to continue (Ctrl-C to abort)…"; }
22+
echo_run() { echo "+ $*"; "$@"; }
23+
24+
push_cmds=()
25+
queue_push() { push_cmds+=("git -C \"$(pwd)\" $*"); echo "+ [queued] (in $(pwd)) git $*"; }
26+
27+
queue_push_tag () {
28+
local tag="$1"
29+
queue_push push origin "refs/tags/$tag"
30+
}
31+
32+
update_follower () {
33+
local DIR="$1"
34+
echo; echo "🔄 Updating $DIR"
35+
cd "$DIR"
36+
37+
# 1 · Make sure we’re on a clean, up-to-date main
38+
echo_run git switch "$MAIN_BRANCH"
39+
echo_run git fetch
40+
echo_run git pull
41+
42+
# 2 · Apply the patch with 3-way fallback
43+
if ! git apply --3way --whitespace=nowarn "$PATCH_FILE"; then
44+
echo "‼️ Some hunks could not be merged automatically."
45+
fi
46+
47+
# 3 · Pause if any conflict markers remain
48+
if git ls-files -u | grep -q .; then
49+
echo "⚠️ Conflicts detected."
50+
echo " If Fastfile or build_LoopFollow.yml were modified, these are expected."
51+
echo " Open your merge tool, resolve, then press Enter."
52+
pause
53+
fi
54+
55+
# 4 · Single commit capturing all staged changes
56+
git add -u
57+
git add $(git ls-files --others --exclude-standard) 2>/dev/null || true
58+
git commit -m "transfer v${new_ver} updates from LF to ${DIR}"
59+
60+
echo_run git status
61+
pause # build & test checkpoint
62+
queue_push push origin "$MAIN_BRANCH"
63+
cd ..
64+
}
65+
66+
# ---------- PRIMARY REPO ----------
67+
PRIMARY_ABS_PATH="$(pwd -P)"
68+
echo "🏁 Working in $PRIMARY_ABS_PATH"
69+
70+
# --- start out in main to capture old_ver ----
71+
echo_run git switch "$MAIN_BRANCH"
72+
echo_run git fetch
73+
echo_run git pull
74+
75+
# -------- version bump logic (unchanged) -----------
76+
old_ver=$(grep -E "^${MARKETING_KEY}[[:space:]]*=" "$VERSION_FILE" | awk '{print $3}')
77+
major_candidate="$(awk -F. '{printf "%d.0.0", $1 + 1}' <<<"$old_ver")"
78+
minor_candidate="$(awk -F. '{printf "%d.%d.0", $1, $2 + 1}' <<<"$old_ver")"
79+
80+
echo
81+
echo "Which version bump do you want?"
82+
echo " 1) Major → $major_candidate"
83+
echo " 2) Minor → $minor_candidate"
84+
read -rp "Enter 1 or 2 (default = 2): " choice
85+
echo
86+
87+
case "$choice" in
88+
1) new_ver="$major_candidate" ;; ""|2) new_ver="$minor_candidate" ;;
89+
*) echo "❌ Invalid choice – aborting."; exit 1 ;;
90+
esac
91+
92+
echo "🔢 Bumping version: $old_ver$new_ver"
93+
94+
# --- switch to dev branch ----
95+
echo_run git switch "$DEV_BRANCH"
96+
echo_run git fetch
97+
echo_run git pull
98+
99+
# --- update version number ----
100+
sed -i '' "s/${MARKETING_KEY}[[:space:]]*=.*/${MARKETING_KEY} = ${new_ver}/" "$VERSION_FILE"
101+
echo_run git diff "$VERSION_FILE"; pause
102+
echo_run git commit -m "update version to ${new_ver} [skip ci]" "$VERSION_FILE"
103+
104+
echo "💻 Build & test dev branch now."; pause
105+
queue_push push origin "$DEV_BRANCH"
106+
107+
# --- create a patch ---------------------------
108+
mkdir -p "$PATCH_DIR"
109+
PATCH_FILE="${PATCH_DIR}/LF_diff_${old_ver}_to_${new_ver}.patch"
110+
111+
git diff -M --binary "$MAIN_BRANCH" "$DEV_BRANCH" \
112+
> "$PATCH_FILE"
113+
114+
# --- merge dev into main for new release
115+
echo_run git switch "$MAIN_BRANCH"
116+
echo_run git merge "$DEV_BRANCH"
117+
echo "💻 Build & test main branch now."; pause
118+
queue_push push origin "$MAIN_BRANCH"
119+
120+
cd ..
121+
update_follower "$SECOND_DIR"
122+
update_follower "$THIRD_DIR"
123+
124+
# ---------- GitHub Actions Test ---------
125+
echo; echo "💻 Test GitHub Build Actions and then continue."; pause
126+
127+
# --- return to primary path
128+
cd ${PRIMARY_ABS_PATH}
129+
130+
# ---------- push queue ----------
131+
echo; echo "🚀 Ready to tag and push changes upstream."
132+
echo_run git log --oneline -2
133+
134+
read -rp "▶▶ Ready to tag? (y/N): " confirm
135+
if [[ $confirm =~ ^[Yy]$ ]]; then
136+
git tag -a "v${new_ver}" -m "v${new_ver}"
137+
queue_push_tag "v${new_ver}"
138+
echo_run git log --oneline -2
139+
else
140+
echo "🚫 tag skipped, can add later"
141+
fi
142+
143+
read -rp "▶▶ Push everything now? (y/N): " confirm
144+
if [[ $confirm =~ ^[Yy]$ ]]; then
145+
for cmd in "${push_cmds[@]}"; do echo "+ $cmd"; bash -c "$cmd"; done
146+
echo "🎉 All pushes completed."
147+
echo; echo "🎉 All repos updated to v${new_ver} (local)."
148+
echo "👉 Remember to create a GitHub release for tag v${new_ver}."
149+
else
150+
echo "🚫 Pushes skipped. Run manually if needed:"; printf ' %s\n' "${push_cmds[@]}"
151+
echo "🚫 Release not completed, pushes to GitHub were skipped"
152+
fi

0 commit comments

Comments
 (0)