Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 27 additions & 14 deletions .github/workflows/build_loop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,10 @@ name: 4. Build Loop
run-name: Build Loop (${{ github.ref_name }})
on:
workflow_dispatch:

## Remove the "#" sign from the beginning of the line below to get automated builds on push (code changes in your repository)
#push:

# Automated builds now include automatic certificate update - the nuke certs part of that process could
# affect other OS apps if run simultaneously.
# Each OS needs a time of day distinct from other apps, LoopWorkspace uses 9 every Wed and 7 every 1st of month
schedule:
# avoid starting an action at hh:00 when GitHub resources are impacted
- cron: "33 9 * * 3" # Checks for updates at 09:33 UTC every Wednesday
- cron: "33 7 1 * *" # Builds the app on the 1st of every month at 07:33 UTC
# Check for updates every Sunday
# Later logic builds if there are updates or if it is the 2nd Sunday of the month
- cron: "33 7 * * 0" # Sunday at UTC 7:33

env:
UPSTREAM_REPO: LoopKit/LoopWorkspace
Expand All @@ -22,6 +15,26 @@ env:
ALIVE_BRANCH_DEV: alive-dev

jobs:

# Set a logic flag if this is the second instance of this day-of-week in this month
day_in_month:
runs-on: ubuntu-latest
name: Check day in month
outputs:
IS_SECOND_IN_MONTH: ${{ steps.date-check.outputs.is_second_instance }}

steps:
- id: date-check
name: Check if this is the second time this day-of-week happens this month
run: |
DAY_OF_MONTH=$(date +%-d)
WEEK_OF_MONTH=$(( ($(date +%-d) - 1) / 7 + 1 ))
if [[ $WEEK_OF_MONTH -eq 2 ]]; then
echo "is_second_instance=true" >> "$GITHUB_OUTPUT"
else
echo "is_second_instance=false" >> "$GITHUB_OUTPUT"
fi

# Checks if Distribution certificate is present and valid, optionally nukes and
# creates new certs if the repository variable ENABLE_NUKE_CERTS == 'true'
check_certs:
Expand Down Expand Up @@ -193,15 +206,15 @@ jobs:
# Builds Loop
build:
name: Build
needs: [check_certs, check_alive_and_permissions, check_latest_from_upstream]
needs: [check_certs, check_alive_and_permissions, check_latest_from_upstream, day_in_month]
runs-on: macos-15
permissions:
contents: write
if:
| # runs if started manually, or if sync schedule is set and enabled and scheduled on the first Saturday each month, or if sync schedule is set and enabled and new commits were found
| # builds with manual start; if automatic: once a month or when new commits are found
github.event_name == 'workflow_dispatch' ||
(needs.check_alive_and_permissions.outputs.WORKFLOW_PERMISSION == 'true' &&
(vars.SCHEDULED_BUILD != 'false' && github.event.schedule == '33 7 1 * *') ||
(vars.SCHEDULED_BUILD != 'false' && needs.day_in_month.outputs.IS_SECOND_IN_MONTH == 'true') ||
(vars.SCHEDULED_SYNC != 'false' && needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' )
)
steps:
Expand Down Expand Up @@ -334,4 +347,4 @@ jobs:
name: build-artifacts
path: |
artifacts
buildlog
buildlog
2 changes: 1 addition & 1 deletion AmplitudeService
2 changes: 1 addition & 1 deletion DanaKit
2 changes: 1 addition & 1 deletion LogglyService
2 changes: 1 addition & 1 deletion LoopSupport
2 changes: 1 addition & 1 deletion OmniBLE
5 changes: 4 additions & 1 deletion Scripts/define_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MESSAGE_FILE="xlate_message_file.txt"
# matches lokalise order, en plus alphabetical order by language name in English
LANGUAGES=(en \
ar \
ce \
zh-Hans \
cs \
da \
Expand All @@ -42,7 +43,8 @@ LANGUAGES=(en \
fr \
de \
he \
hi ]
hi \
hu \
it \
ja \
nb \
Expand All @@ -54,6 +56,7 @@ LANGUAGES=(en \
es \
sv \
tr \
uk \
vi \
)

Expand Down
2 changes: 1 addition & 1 deletion VersionOverride.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

// Version [for DIY Loop]
// configure the version number in LoopWorkspace
LOOP_MARKETING_VERSION = 3.8.1
LOOP_MARKETING_VERSION = 3.8.2
CURRENT_PROJECT_VERSION = 57