Skip to content

Build Loop main

Build Loop main #15

Workflow file for this run

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:
## Remove the "#" sign from the beginning of the two lines below to get automated builds every two months
#schedule:
#- cron: '0 17 1 */2 *' # Runs at 17:00 UTC on the 1st in Jan, Mar, May, Jul, Sep and Nov.
jobs:
secrets:
uses: ./.github/workflows/validate_secrets.yml
secrets: inherit
build:
needs: secrets
runs-on: macos-14
steps:
# Uncomment to manually select latest Xcode if needed
- name: Select Latest Xcode
run: "sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer"
# Checks-out the repo
- name: Checkout Repo
uses: actions/checkout@v4
with:
submodules: recursive
# Customize Loop: Download and apply patches
- name: Customize Loop
run: |
# The lines below add the customizations listed using the CustomizationSelect script
# The "\" is a continuation character
# the line following a "\" cannot be blank - that causes the Action to never complete
/bin/bash -c "$(curl -fsSL \
https://raw.githubusercontent.com/loopandlearn/lnl-scripts/main/CustomizationSelect.sh)" \
now_line \
limit_loop_cycle_time \
testflight_expiration_warning
# LoopWorkspace commit: Adds xDrip4iOS and GlucoseDirect CGM clients
# Note - the added submodules must be cloned before the patch will work
echo "Downloading code to support xdrip-client-swift"
git clone https://github.com/johandegraeve/xdrip-client-swift-1.git xdrip-client-swift
echo "checking out the xdrip-client-swift commit that works with Loop 3.2.3"
cd xdrip-client-swift; git checkout 22ef96e; cd ..
echo "Downloading code to support GlucoseDirectClient"
git clone https://github.com/creepymonster/GlucoseDirectClient.git GlucoseDirectClient
echo "checking out the GlucoseDirectClient commit that works with Loop 3.2.3"
cd GlucoseDirectClient; git checkout 05f5c24; cd ..
# This patch configures LoopWorkspace to use the added CGM submodules
echo "Applying customization to add CGM support to Loop for xDrip4iOS and GlucoseDirect"
curl https://github.com/loopnlearn/LoopWorkspace/commit/4092277a21fa44a1258b693a5fbcce4d8d9dbd17.patch | git apply
# more customizations can be pasted after this line
# the final customization listed above CANNOT have a continuation character "\"
# more customizations can be pasted after this line
# Patch Fastlane Match to not print tables
- name: Patch Match Tables
run: find /usr/local/lib/ruby/gems -name table_printer.rb | xargs sed -i "" "/puts(Terminal::Table.new(params))/d"
# Sync the GitHub runner clock with the Windows time server (workaround as suggested in https://github.com/actions/runner/issues/2996)
- name: Sync clock
run: sudo sntp -sS time.windows.com
# Build signed Loop IPA file
- name: Fastlane Build & Archive
run: fastlane build_loop
env:
TEAMID: ${{ secrets.TEAMID }}
GH_PAT: ${{ secrets.GH_PAT }}
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }}
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }}
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
# Upload to TestFlight
- name: Fastlane upload to TestFlight
run: fastlane release
env:
TEAMID: ${{ secrets.TEAMID }}
GH_PAT: ${{ secrets.GH_PAT }}
FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }}
FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }}
FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
# Upload IPA and Symbols
- name: Upload IPA and Symbol artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
artifacts
buildlog