diff --git a/.github/workflows/build_iAPS.yml b/.github/workflows/build_iAPS.yml index 15cf43f543..f47f3a8616 100644 --- a/.github/workflows/build_iAPS.yml +++ b/.github/workflows/build_iAPS.yml @@ -3,14 +3,15 @@ run-name: Build iAPS (${{ 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: + # this will trigger this workflow for any push to any branch that this workflow is + # active on, *but*, the auto_build_check job will check to see if this branch is + # enabled *for* being auto built, and short circuit the process if so. + # + # if AUTO_BUILD_BRANCHES is not set, or the current branch is not listed, this + # workflow is triggered, but doesn't actually do anything. + # + push: - schedule: - #- cron: '30 04 1 * *' # Runs at 04:30 UTC on the 1st every month - - cron: '0 8 * * 3' # Checks for updates at 08:00 UTC every Wednesday - - cron: '0 6 1 * *' # Builds the app on the 1st of every month at 06:00 UTC - env: UPSTREAM_REPO: Artificial-Pancreas/iAPS UPSTREAM_BRANCH: ${{ github.ref_name }} # branch on upstream repository to sync from (replace with specific branch name if needed) @@ -18,8 +19,31 @@ env: ALIVE_BRANCH: alive jobs: + auto_build_check: + name: Check Auto Build Status + runs-on: ubuntu-latest + outputs: + AUTO_BUILD_ENABLED: ${{ steps.auto-build-enabled.outputs.auto_build }} + + steps: + - name: Is Auto Build Branch + id: auto-build-enabled + run: | + echo "auto_build=false" >> $GITHUB_OUTPUT + if [ ! -z "${{ vars.AUTO_BUILD_BRANCHES }}" ]; then + if echo ",${{ vars.AUTO_BUILD_BRANCHES }}," | grep -q ",${{ github.ref_name }},"; then + echo "auto_build=true" >> $GITHUB_OUTPUT + fi + fi + + - name: Show Auto Build Status + run: | + echo "Auto Build Status: ${{ steps.auto-build-enabled.outputs.auto_build }}" + validate: name: Validate + needs: auto_build_check + if: needs.auto_build_check.outputs.AUTO_BUILD_ENABLED == 'true' || github.event_name == 'workflow_dispatch' uses: ./.github/workflows/validate_secrets.yml secrets: inherit @@ -44,7 +68,7 @@ jobs: if [[ $PERMISSIONS =~ "workflow" || $PERMISSIONS == "" ]]; then echo "GH_PAT holds workflow permissions or is fine-grained PAT." - echo "has_permission=true" >> $GITHUB_OUTPUT # Set WORKFLOW_PERMISSION to false. + echo "has_permission=true" >> $GITHUB_OUTPUT # Set WORKFLOW_PERMISSION to true. else echo "GH_PAT lacks workflow permissions." echo "Automated build features will be skipped!" @@ -128,13 +152,13 @@ jobs: runs-on: macos-14 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 - github.event_name == 'workflow_dispatch' || - (needs.check_alive_and_permissions.outputs.WORKFLOW_PERMISSION == 'true' && - (vars.SCHEDULED_BUILD != 'false' && github.event.schedule == '0 6 1 * *') || - (vars.SCHEDULED_SYNC == 'true' && needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' ) - ) steps: + - name: Set special variables + run: | + if [ ! -z ${{ vars.APP_IDENTIFIER }} ]; then + echo "APP_IDENTIFIER=${{ vars.APP_IDENTIFIER }}" >> $GITHUB_ENV + fi + - name: Select Xcode version run: "sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer" diff --git a/.github/workflows/syncUpstreamRepo.yml b/.github/workflows/syncUpstreamRepo.yml new file mode 100644 index 0000000000..6d1e6729c4 --- /dev/null +++ b/.github/workflows/syncUpstreamRepo.yml @@ -0,0 +1,40 @@ + +name: 5. Sync Upstream +run-name: Sync Upstream (${{ github.ref_name }}) + +env: + UPSTREAM_URL: "https://github.com/Artificial-Pancreas/iAPS.git" + WORKFLOW_TOKEN: ${{ secrets.GH_PAT }} + UPSTREAM_BRANCH: "${{ github.ref_name }}" + DOWNSTREAM_BRANCH: "${{ github.ref_name }}" + # Optional fetch arguments + FETCH_ARGS: "" + # Optional merge arguments + MERGE_ARGS: "" + # Optional push arguments + PUSH_ARGS: "" + # Optional toggle to spawn time logs (keeps action active) + SPAWN_LOGS: "false" # "true" or "false" + +on: + + schedule: + - cron: '0 * * * *' # scheduled to run hourly + + workflow_dispatch: # trigger manually + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: GitHub Sync to Upstream Repository + uses: Artificial-Pancreas/sync-upstream-repo@master + with: + upstream_repo: ${{ env.UPSTREAM_URL }} + upstream_branch: ${{ env.UPSTREAM_BRANCH }} + downstream_branch: ${{ env.DOWNSTREAM_BRANCH }} + token: ${{ env.WORKFLOW_TOKEN }} + fetch_args: ${{ env.FETCH_ARGS }} + merge_args: ${{ env.MERGE_ARGS }} + push_args: ${{ env.PUSH_ARGS }} + spawn_logs: ${{ env.SPAWN_LOGS }} diff --git a/Config.xcconfig b/Config.xcconfig index 79907c6181..36375c1c81 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -1,5 +1,5 @@ APP_DISPLAY_NAME = iAPS -APP_VERSION = 5.0.4 +APP_VERSION = 5.2.0 APP_BUILD_NUMBER = 1 COPYRIGHT_NOTICE = DEVELOPER_TEAM = ##TEAM_ID## diff --git a/FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json b/FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json index 55ed5f35b5..b6c45ba0bd 100644 --- a/FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json +++ b/FreeAPS/Resources/json/defaults/freeaps/freeaps_settings.json @@ -61,7 +61,7 @@ "minumimPrediction": true, "minimumSMB": 0.3, "useInsulinBars": false, - "uploadVersion": true, "birthDate": Date.distantPast, - "displayDelta": false + "displayDelta": false, + "profileID": "Hypo Treatment" } diff --git a/FreeAPS/Sources/APS/APSManager.swift b/FreeAPS/Sources/APS/APSManager.swift index b66221fc4c..9427ae2e03 100644 --- a/FreeAPS/Sources/APS/APSManager.swift +++ b/FreeAPS/Sources/APS/APSManager.swift @@ -1247,7 +1247,7 @@ final class BaseAPSManager: APSManager, Injectable { ) storage.save(dailystat, as: file) nightscout.uploadStatistics(dailystat: dailystat) - } else if settingsManager.settings.uploadVersion { + } else { let json = BareMinimum( id: getIdentifier(), created_at: Date.now, diff --git a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings index 899b1a7f99..f3a8d873ea 100644 --- a/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ar.lproj/Localizable.strings @@ -642,6 +642,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "العلاجات"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " د"; diff --git a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings index e24d575e1c..e60b534147 100644 --- a/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/da.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Behandlinger"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; @@ -2521,15 +2524,12 @@ Enact a temp Basal or a temp target */ /* UI/UX option */ "Never display the small glucose chart when scrolling" = "Never display the small glucose chart when scrolling"; -<<<<<<< HEAD -======= /* UI/UX option */ "Disable Hypo Treatments" = "Disable Hypo Treatments"; /* UI/UX option */ "Display Glucose Delta" = "Display Glucose Delta"; ->>>>>>> dev /* Setting title */ "Bolus Calculator" = "Bolus Lommeregner"; diff --git a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings index 2452c2a48e..0adfb4f129 100644 --- a/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/de.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Behandlungen"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " Min"; diff --git a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings index b04354872d..ab1ec8425a 100644 --- a/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/es.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Tratamientos"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings index b743542340..e41b8b9b92 100644 --- a/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fi.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Treatments"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings index b8f5be3999..95adb1959a 100644 --- a/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/fr.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Traitements"; +/* Hypo Treatment Preset */ +"Treatment" = "Traitement"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings index 768904eeb1..0f09194335 100644 --- a/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/he.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Treatments"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings index ea5777a9e2..1fa531e7d4 100644 --- a/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/hu.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Kezelések"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " perc"; diff --git a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings index ce29e5c547..dcebbe8847 100644 --- a/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/it.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Trattamenti"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings index e1e28545a9..738dbe52fc 100644 --- a/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nb.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Behandlinger"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings index 79aef53abc..e3da57c5d8 100644 --- a/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/nl.lproj/Localizable.strings @@ -92,7 +92,7 @@ "Suggested at" = "Voorgesteld op"; /* Headline in enacted pop up (at: at what time) */ -"Status at" = "Status at"; +"Status at" = "Status op"; /* Bolus View Meal Summary Header */ "Meal Summary" = "Maaltijd overzicht"; @@ -149,7 +149,7 @@ "No suggestion" = "Geen suggestie"; /* Replace pod text in Header */ -"Replace pod" = "Vervang Pod"; +"Replace pod" = "Vervang pod"; /* Add carbs screen */ "Add Carbs" = "Koolhydraten toevoegen"; @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Behandelingen"; +/* Hypo Treatment Preset */ +"Treatment" = "Behandeling"; + /* " min" in Treatments list */ " min" = "min"; @@ -1249,7 +1252,7 @@ Enact a temp Basal or a temp target */ "Can't enact the new loop cycle recommendation, because a Bolus is in progress. Wait for next loop cycle" = "Kan het nieuwe loopcyclus advies niet uitvoeren, omdat er een bolus bezig is. Wacht op de volgende cyclus"; /* Pump Error */ -"Pump is Busy." = "Pump is Busy."; +"Pump is Busy." = "Je pomp is bezig."; /* -------------- Developer settings ---------------------- */ /* Debug options */ diff --git a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings index ca19bbd88b..a2748773b9 100644 --- a/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pl.lproj/Localizable.strings @@ -643,6 +643,9 @@ Połączono z Nightscout!"; /* Treatments list */ "Treatments" = "Treatments"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings index ab970c0880..31234e67f6 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-BR.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Tratamentos"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings index 975d77bb16..dca6375f05 100644 --- a/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/pt-PT.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Treatments"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings index 29f779a168..7a0b6a453b 100644 --- a/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/ru.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "События"; +/* Hypo Treatment Preset */ +"Treatment" = "Терапия"; + /* " min" in Treatments list */ " min" = " мин"; diff --git a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings index 07c354e57d..b1727e58c7 100644 --- a/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sk.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Ošetrenia"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings index f78b6dc1df..75c1d6dae8 100644 --- a/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/sv.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Behandlingar"; +/* Hypo Treatment Preset */ +"Treatment" = "Behandling"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings index b2521fa3b5..26c0a1abc3 100644 --- a/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/tr.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Tedaviler"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " dk"; diff --git a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings index 8428dad542..09f1bd229b 100644 --- a/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/uk.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Події"; +/* Hypo Treatment Preset */ +"Treatment" = "Лікування"; + /* " min" in Treatments list */ " min" = " хв"; @@ -2525,7 +2528,7 @@ Enact a temp Basal or a temp target */ "Disable Hypo Treatments" = "Вимкнути гіпотерапію"; /* UI/UX option */ -"Display Glucose Delta" = "Display Glucose Delta"; +"Display Glucose Delta" = "Відображати дельту Глюкози"; /* Setting title */ "Bolus Calculator" = "Калькулятор Болюса"; diff --git a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings index 5ff702b3b4..9cdd064863 100644 --- a/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/vi.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "Đã xử lý"; +/* Hypo Treatment Preset */ +"Treatment" = "Biện pháp xử lý"; + /* " min" in Treatments list */ " min" = " min"; diff --git a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings index e3bd18e11c..8aa8799316 100644 --- a/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings +++ b/FreeAPS/Sources/Localizations/Main/zh-Hans.lproj/Localizable.strings @@ -641,6 +641,9 @@ Enact a temp Basal or a temp target */ /* Treatments list */ "Treatments" = "治疗"; +/* Hypo Treatment Preset */ +"Treatment" = "Treatment"; + /* " min" in Treatments list */ " min" = " 分钟"; diff --git a/FreeAPS/Sources/Models/FreeAPSSettings.swift b/FreeAPS/Sources/Models/FreeAPSSettings.swift index 82cad45cee..5620b134b5 100644 --- a/FreeAPS/Sources/Models/FreeAPSSettings.swift +++ b/FreeAPS/Sources/Models/FreeAPSSettings.swift @@ -63,7 +63,6 @@ struct FreeAPSSettings: JSON, Equatable { var minimumSMB: Decimal = 0.3 var useInsulinBars: Bool = false var disableCGMError: Bool = true - var uploadVersion: Bool = true var skipGlucoseChart: Bool = false var birthDate = Date.distantPast // var sex: Sex = .secret @@ -331,10 +330,6 @@ extension FreeAPSSettings: Decodable { settings.disableCGMError = disableCGMError } - if let uploadVersion = try? container.decode(Bool.self, forKey: .uploadVersion) { - settings.uploadVersion = uploadVersion - } - if let skipGlucoseChart = try? container.decode(Bool.self, forKey: .skipGlucoseChart) { settings.skipGlucoseChart = skipGlucoseChart } @@ -343,6 +338,10 @@ extension FreeAPSSettings: Decodable { settings.birthDate = birthDate } + if let birthDate = try? container.decode(Date.self, forKey: .birthDate) { + settings.birthDate = birthDate + } + if let sexSetting = try? container.decode(Int.self, forKey: .sexSetting) { settings.sexSetting = sexSetting } diff --git a/FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift b/FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift index ecc10d0940..3a3e20c734 100644 --- a/FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift +++ b/FreeAPS/Sources/Modules/Home/View/Header/CurrentGlucoseView.swift @@ -9,6 +9,7 @@ struct CurrentGlucoseView: View { @Binding var highGlucose: Decimal @Binding var alwaysUseColors: Bool @Binding var displayDelta: Bool + @Binding var scrolling: Bool @Environment(\.colorScheme) var colorScheme @Environment(\.sizeCategory) private var fontSize @@ -76,7 +77,7 @@ struct CurrentGlucoseView: View { var glucoseView: some View { ZStack { if let recent = recentGlucose { - if displayDelta, let deltaInt = delta, + if displayDelta, !scrolling, let deltaInt = delta, !(units == .mmolL && abs(deltaInt) <= 1) { deltaView(deltaInt) } VStack(spacing: 15) { let formatter = recent.type == GlucoseType.manual.rawValue ? manualGlucoseFormatter : glucoseFormatter @@ -86,15 +87,17 @@ struct CurrentGlucoseView: View { { glucoseText(string).asAny() .background { glucoseDrop } - let minutesAgo = -1 * recent.dateString.timeIntervalSinceNow / 60 - let text = timaAgoFormatter.string(for: Double(minutesAgo)) ?? "" - Text( - minutesAgo <= 1 ? "Now" : - (text + " " + NSLocalizedString("min", comment: "Short form for minutes") + " ") - ) - .font(.caption) - .foregroundStyle(.secondary) - .offset(x: 1, y: fontSize >= .extraLarge ? -3 : 0) + if !scrolling { + let minutesAgo = -1 * recent.dateString.timeIntervalSinceNow / 60 + let text = timaAgoFormatter.string(for: Double(minutesAgo)) ?? "" + Text( + minutesAgo <= 1 ? "Now" : + (text + " " + NSLocalizedString("min", comment: "Short form for minutes") + " ") + ) + .font(.caption) + .foregroundStyle(.secondary) + .offset(x: 1, y: fontSize >= .extraLarge ? -3 : 0) + } } } } @@ -165,20 +168,21 @@ struct CurrentGlucoseView: View { let decimal = string.components(separatedBy: decimalString) if decimal.count > 1 { HStack(spacing: 0) { - Text(decimal[0]).font(.glucoseFont) - Text(decimalString).font(.system(size: 28).weight(.semibold)).baselineOffset(-10) - Text(decimal[1]).font(.system(size: 28)).baselineOffset(-10) + Text(decimal[0]).font(scrolling ? .glucoseSmallFont : .glucoseFont) + Text(decimalString).font(.system(size: !scrolling ? 28 : 14).weight(.semibold)).baselineOffset(-10) + Text(decimal[1]).font(.system(size: !scrolling ? 28 : 18)).baselineOffset(!scrolling ? -10 : -4) } .tracking(-1) .offset(x: -2, y: 14) .foregroundColor(alwaysUseColors ? colorOfGlucose : alarm == nil ? .primary : .loopRed) } else { Text(string) - .font(.glucoseFontMdDl.width(.condensed)) // .tracking(-2) + .font(scrolling ? .glucoseSmallFont : .glucoseFontMdDl.width(.condensed)) // .tracking(-2) .foregroundColor(alwaysUseColors ? colorOfGlucose : alarm == nil ? .primary : .loopRed) - .offset(x: string.count > 2 ? -2 : -1, y: 16) + .offset(x: string.count > 2 ? -1 : -1, y: 16) } } + .offset(y: scrolling ? 3 : 0) } private var glucoseDrop: some View { @@ -187,7 +191,7 @@ struct CurrentGlucoseView: View { let shadowDirection = direction(degree: degree) return Image("glucoseDrops") .resizable() - .frame(width: 140, height: 140).rotationEffect(.degrees(degree)) + .frame(width: !scrolling ? 140 : 80, height: !scrolling ? 140 : 80).rotationEffect(.degrees(degree)) .animation(.bouncy(duration: 1, extraBounce: 0.2), value: degree) .offset(x: adjust.x, y: adjust.y) .shadow(radius: 3, x: shadowDirection.x, y: shadowDirection.y) diff --git a/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift b/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift index c703704710..efa9e499e9 100644 --- a/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift +++ b/FreeAPS/Sources/Modules/Home/View/HomeRootView.swift @@ -97,7 +97,8 @@ extension Home { lowGlucose: $state.lowGlucose, highGlucose: $state.highGlucose, alwaysUseColors: $state.alwaysUseColors, - displayDelta: $state.displayDelta + displayDelta: $state.displayDelta, + scrolling: $displayGlucose ) .onTapGesture { if state.alarm == nil { @@ -396,8 +397,8 @@ extension Home { } var chart: some View { - let ratio = 1.76 - let ratio2 = 1.80 + let ratio = 1.96 + let ratio2 = 2.0 return addColouredBackground().shadow(radius: 3, y: 3) .overlay { @@ -437,6 +438,7 @@ extension Home { Text(NSLocalizedString(" g", comment: "gram of carbs")).font(.statusFont).foregroundStyle(.secondary) }.offset(x: 0, y: 5) } + // Insulin on Board HStack { let substance = Double(state.suggestion?.iob ?? 0) @@ -481,6 +483,19 @@ extension Home { } } + var infoPanelView: some View { + addBackground() + .frame(height: 30) + .overlay { + HStack { + info + } + } + .clipShape(RoundedRectangle(cornerRadius: 15)) + .addShadows() + .padding(.horizontal, 10) + } + var activeIOBView: some View { addBackground() .frame(minHeight: 405) @@ -589,48 +604,49 @@ extension Home { } } - @ViewBuilder private func headerView(_ geo: GeometryProxy, extra: CGFloat) -> some View { - let scrolling: Bool = extra > 0 - let height: CGFloat = scrolling ? 170 : 170 + @ViewBuilder private func headerView(_ geo: GeometryProxy) -> some View { + let height: CGFloat = displayGlucose ? 140 : 210 addHeaderBackground() .frame( - height: fontSize < .extraExtraLarge ? height + geo.safeAreaInsets.top + extra : height + 10 + geo - .safeAreaInsets.top + extra + height: fontSize < .extraExtraLarge ? height + geo.safeAreaInsets.top : height + 10 + geo + .safeAreaInsets.top ) .clipShape(Rectangle()) .overlay { VStack { ZStack { - glucoseView.frame(maxHeight: .infinity, alignment: .center).offset(y: -5) - loopView.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading) - .padding(.leading, 32).padding(.top, 20) - HStack { - carbsAndInsulinView - .frame(maxHeight: .infinity, alignment: .bottom) - Spacer() - pumpView - .frame(maxHeight: .infinity, alignment: .bottom) + if !displayGlucose { + glucoseView.frame(maxHeight: .infinity, alignment: .center).offset(y: -10) + loopView.frame(maxWidth: .infinity, alignment: .leading).offset(x: 40, y: -30) + } + if displayGlucose { + glucoseView.frame(maxHeight: .infinity, alignment: .center).offset(y: -10) + } else { + HStack { + carbsAndInsulinView + .frame(maxHeight: .infinity, alignment: .bottom) + Spacer() + pumpView + .frame(maxHeight: .infinity, alignment: .bottom) + } + .dynamicTypeSize(...DynamicTypeSize.xLarge) + .padding(.horizontal, 10) + .padding(.bottom, 5) } - .dynamicTypeSize(...DynamicTypeSize.xLarge) - .padding(.horizontal, 10) } - // Small glucose View, past 24 hours. - if displayGlucose { glucoseHeaderView() } - if !scrolling { - infoPanel + if displayGlucose { + glucosePreview + } else { + infoPanelView } + + Divider() + }.padding(.top, geo.safeAreaInsets.top) } } - @ViewBuilder private func glucoseHeaderView() -> some View { - ZStack { - glucosePreview - .dynamicTypeSize(...DynamicTypeSize.medium) - } - } - var glucosePreview: some View { let data = state.glucose let minimum = data.compactMap(\.glucose).min() ?? 0 @@ -652,28 +668,22 @@ extension Home { ) .symbolSize(5) } - .chartXAxis { - AxisMarks(values: .stride(by: .hour, count: 2)) { _ in - AxisValueLabel( - format: .dateTime.hour(.defaultDigits(amPM: .omitted)) - .locale(Locale(identifier: "sv")) - ) - AxisGridLine() - } - } + .chartXAxis(.hidden) .chartYAxis { AxisMarks(values: .automatic(desiredCount: 3)) } .chartYScale( - domain: minimumRange * (state.units == .mmolL ? 0.0555 : 1.0) ... maximum * (state.units == .mmolL ? 0.0555 : 1.0) + domain: minimumRange * (state.units == .mmolL ? 0.0555 : 1.0) ... maximum * + (state.units == .mmolL ? 0.0555 : 1.0) ) .chartXScale( domain: Date.now.addingTimeInterval(-1.days.timeInterval) ... Date.now ) - .frame(height: 70) + .frame(height: 50) .padding(.leading, 30) .padding(.trailing, 32) .padding(.top, 15) + .dynamicTypeSize(DynamicTypeSize.medium ... DynamicTypeSize.large) } var timeSetting: some View { @@ -681,6 +691,7 @@ extension Home { return Menu(string) { Button("3 " + NSLocalizedString("hours", comment: ""), action: { state.hours = 3 }) Button("6 " + NSLocalizedString("hours", comment: ""), action: { state.hours = 6 }) + Button("9 " + NSLocalizedString("hours", comment: ""), action: { state.hours = 9 }) Button("12 " + NSLocalizedString("hours", comment: ""), action: { state.hours = 12 }) Button("24 " + NSLocalizedString("hours", comment: ""), action: { state.hours = 24 }) Button("UI/UX Settings", action: { state.showModal(for: .statisticsConfig) }) @@ -696,32 +707,35 @@ extension Home { GeometryReader { geo in VStack(spacing: 0) { // Header View - headerView(geo, extra: (displayGlucose && !state.skipGlucoseChart) ? 59 : 0) + headerView(geo) + ScrollView { VStack { // Main Chart chart // Adjust hours visible (X-Axis) - if !displayGlucose { timeSetting } + timeSetting // TIR Chart if !state.glucose.isEmpty { - preview.padding(.top, !displayGlucose ? 5 : 15) + preview.padding(.top, 15) } // Loops Chart loopPreview.padding(.vertical, 15) - // COB Chart + if state.carbData > 0 { activeCOBView } + // IOB Chart if state.iobs > 0 { - activeIOBView.padding(.top, state.carbData > 0 ? viewPadding : 0) + activeIOBView } + }.background { // Track vertical scroll GeometryReader { proxy in let scrollPosition = proxy.frame(in: .named("HomeScrollView")).minY - let yThreshold: CGFloat = -500 + let yThreshold: CGFloat = -550 Color.clear .onChange(of: scrollPosition) { y in if y < yThreshold, state.iobs > 0 || state.carbData > 0, !state.skipGlucoseChart { @@ -737,6 +751,7 @@ extension Home { // Buttons buttonPanel(geo) } + .background( colorScheme == .light ? .gray.opacity(IAPSconfig.backgroundOpacity * 2) : .white .opacity(IAPSconfig.backgroundOpacity * 2) diff --git a/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift b/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift index 9c4c67896c..76fe12e4bb 100644 --- a/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift +++ b/FreeAPS/Sources/Modules/Sharing/SharingStateModel.swift @@ -8,14 +8,12 @@ extension Sharing { @Published var uploadStats: Bool = false @Published var identfier: String = "" @Published var birthDate = Date.distantPast - @Published var uploadVersion: Bool = true @Published var sexSetting: Int = 3 @Published var sex: Sex = .secret override func subscribe() { uploadStats = settingsManager.settings.uploadStats subscribeSetting(\.uploadStats, on: $uploadStats) { uploadStats = $0 } - subscribeSetting(\.uploadVersion, on: $uploadVersion) { uploadVersion = $0 } subscribeSetting(\.birthDate, on: $birthDate) { birthDate = $0 } subscribeSetting(\.sexSetting, on: $sexSetting) { sexSetting = $0 } identfier = getIdentifier() diff --git a/FreeAPS/Sources/Modules/Sharing/View/SharingRootView.swift b/FreeAPS/Sources/Modules/Sharing/View/SharingRootView.swift index e3b4fe812f..f15d9dfe95 100644 --- a/FreeAPS/Sources/Modules/Sharing/View/SharingRootView.swift +++ b/FreeAPS/Sources/Modules/Sharing/View/SharingRootView.swift @@ -53,12 +53,6 @@ extension Sharing { ) } - if !state.uploadStats { - Section { - Toggle("Just iAPS version number", isOn: $state.uploadVersion) - } header: { Text("Share Bare Minimum") } - } - Section {} footer: { Text( diff --git a/FreeAPS/Sources/Services/Network/NightscoutManager.swift b/FreeAPS/Sources/Services/Network/NightscoutManager.swift index 7d4bb63890..4dce324d90 100644 --- a/FreeAPS/Sources/Services/Network/NightscoutManager.swift +++ b/FreeAPS/Sources/Services/Network/NightscoutManager.swift @@ -62,10 +62,6 @@ final class BaseNightscoutManager: NightscoutManager, Injectable { settingsManager.settings.uploadStats } - private var isVersionUploadEnabled: Bool { - settingsManager.settings.uploadVersion - } - private var isUploadGlucoseEnabled: Bool { settingsManager.settings.uploadGlucose } @@ -183,7 +179,7 @@ final class BaseNightscoutManager: NightscoutManager, Injectable { } func fetchVersion() { - guard isStatsUploadEnabled || isVersionUploadEnabled, isNetworkReachable else { + guard isStatsUploadEnabled || isNetworkReachable else { return } let nightscout = NightscoutAPI(url: IAPSconfig.statURL) @@ -899,85 +895,97 @@ final class BaseNightscoutManager: NightscoutManager, Injectable { } // UPLOAD PREFERNCES WHEN CHANGED - if let uploadedPreferences = storage.retrieveFile(OpenAPS.Nightscout.uploadedPreferences, as: Preferences.self), - let unWrappedPreferences = preferences - { - if uploadedPreferences.rawJSON.sorted() != unWrappedPreferences.rawJSON.sorted() || - force + if isStatsUploadEnabled || force { + if let uploadedPreferences = storage.retrieveFile(OpenAPS.Nightscout.uploadedPreferences, as: Preferences.self), + let unWrappedPreferences = preferences { - let prefs = NightscoutPreferences(preferences: unWrappedPreferences, enteredBy: token, profile: name) + if uploadedPreferences.rawJSON.sorted() != unWrappedPreferences.rawJSON.sorted() || + force + { + let prefs = NightscoutPreferences(preferences: unWrappedPreferences, enteredBy: token, profile: name) + uploadPreferences(prefs) + } else { + NSLog("NightscoutManager Preferences, preferences unchanged") + } + } else if loaded.preferences { + let prefs = NightscoutPreferences(preferences: preferences, enteredBy: token, profile: name) uploadPreferences(prefs) - } else { - NSLog("NightscoutManager Preferences, preferences unchanged") } - } else if loaded.preferences { - let prefs = NightscoutPreferences(preferences: preferences, enteredBy: token, profile: name) - uploadPreferences(prefs) } // UPLOAD FreeAPS Settings WHEN CHANGED - if let uploadedSettings = storage.retrieve(OpenAPS.Nightscout.uploadedSettings, as: FreeAPSSettings.self), - let unwrappedSettings = settings, uploadedSettings.rawJSON.sorted() == unwrappedSettings.rawJSON.sorted(), !force - { - NSLog("NightscoutManager Settings, settings unchanged") - } else { - let sets = NightscoutSettings( - settings: settingsManager.settings, enteredBy: getIdentifier(), profile: name - ) - uploadSettings(sets) + if isStatsUploadEnabled || force { + if let uploadedSettings = storage.retrieve(OpenAPS.Nightscout.uploadedSettings, as: FreeAPSSettings.self), + let unwrappedSettings = settings, uploadedSettings.rawJSON.sorted() == unwrappedSettings.rawJSON.sorted(), !force + { + NSLog("NightscoutManager Settings, settings unchanged") + } else { + let sets = NightscoutSettings( + settings: settingsManager.settings, enteredBy: getIdentifier(), profile: name + ) + uploadSettings(sets) + } } // UPLOAD PumpSettings WHEN CHANGED - if let pumpSettings = storage.retrieveFile(OpenAPS.Settings.settings, as: PumpSettings.self) { - if let uploadedSettings = storage.retrieve(OpenAPS.Nightscout.uploadedPumpSettings, as: PumpSettings.self), - uploadedSettings.rawJSON.sorted() == pumpSettings.rawJSON.sorted(), !force - { - NSLog("PumpSettings unchanged") - } else { uploadPumpSettingsToDatabase(pumpSettings, token: token, name: name) } + if isStatsUploadEnabled || force { + if let pumpSettings = storage.retrieveFile(OpenAPS.Settings.settings, as: PumpSettings.self) { + if let uploadedSettings = storage.retrieve(OpenAPS.Nightscout.uploadedPumpSettings, as: PumpSettings.self), + uploadedSettings.rawJSON.sorted() == pumpSettings.rawJSON.sorted(), !force + { + NSLog("PumpSettings unchanged") + } else { uploadPumpSettingsToDatabase(pumpSettings, token: token, name: name) } - } else { - debug(.nightscout, "UploadPumpSettings: error opening pump settings") + } else { + debug(.nightscout, "UploadPumpSettings: error opening pump settings") + } } // UPLOAD Temp Targets WHEN CHANGED - if let tempTargets = storage.retrieveFile(OpenAPS.FreeAPS.tempTargetsPresets, as: [TempTarget].self) { - if let uploadedTempTargets = storage.retrieve( - OpenAPS.Nightscout.uploadedTempTargetsDatabase, - as: [TempTarget].self - ), - uploadedTempTargets.rawJSON.sorted() == tempTargets.rawJSON.sorted(), !force - { - NSLog("Temp targets unchanged") - } else { uploadTempTargetsToDatabase(tempTargets, token: token, name: name) } + if isStatsUploadEnabled || force { + if let tempTargets = storage.retrieveFile(OpenAPS.FreeAPS.tempTargetsPresets, as: [TempTarget].self) { + if let uploadedTempTargets = storage.retrieve( + OpenAPS.Nightscout.uploadedTempTargetsDatabase, + as: [TempTarget].self + ), + uploadedTempTargets.rawJSON.sorted() == tempTargets.rawJSON.sorted(), !force + { + NSLog("Temp targets unchanged") + } else { uploadTempTargetsToDatabase(tempTargets, token: token, name: name) } - } else { - debug(.nightscout, "UploadPumpSettings: error opening pump settings") + } else { + debug(.nightscout, "UploadPumpSettings: error opening pump settings") + } } // Upload Meal Presets when needed - let mealPresets = Database(token: token).mealPresetDatabaseUpload(profile: name, token: token) - if !mealPresets.presets.isEmpty { - if let uploadedMealPresets = storage.retrieveFile(OpenAPS.Nightscout.uploadedMealPresets, as: MealDatabase.self), - mealPresets.rawJSON.sorted() == uploadedMealPresets.rawJSON.sorted(), !force - { - NSLog("Meal Presets unchanged") - } else { - uploadMealPresetsToDatabase(mealPresets, token: token) + if isStatsUploadEnabled || force { + let mealPresets = Database(token: token).mealPresetDatabaseUpload(profile: name, token: token) + if !mealPresets.presets.isEmpty { + if let uploadedMealPresets = storage.retrieveFile(OpenAPS.Nightscout.uploadedMealPresets, as: MealDatabase.self), + mealPresets.rawJSON.sorted() == uploadedMealPresets.rawJSON.sorted(), !force + { + NSLog("Meal Presets unchanged") + } else { + uploadMealPresetsToDatabase(mealPresets, token: token) + } } } // Upload Override Presets when needed - let overridePresets = Database(token: token).overridePresetDatabaseUpload(profile: name, token: token) - if !overridePresets.presets.isEmpty { - if let uploadedOverridePresets = storage.retrieveFile( - OpenAPS.Nightscout.uploadedOverridePresets, - as: OverrideDatabase.self - ), - overridePresets.rawJSON.sorted() == uploadedOverridePresets.rawJSON.sorted(), !force - { - NSLog("Override Presets unchanged") - } else { - uploadOverridePresetsToDatabase(overridePresets, token: token) + if isStatsUploadEnabled || force { + let overridePresets = Database(token: token).overridePresetDatabaseUpload(profile: name, token: token) + if !overridePresets.presets.isEmpty { + if let uploadedOverridePresets = storage.retrieveFile( + OpenAPS.Nightscout.uploadedOverridePresets, + as: OverrideDatabase.self + ), + overridePresets.rawJSON.sorted() == uploadedOverridePresets.rawJSON.sorted(), !force + { + NSLog("Override Presets unchanged") + } else { + uploadOverridePresetsToDatabase(overridePresets, token: token) + } } } } diff --git a/FreeAPS/Sources/Views/ViewModifiers.swift b/FreeAPS/Sources/Views/ViewModifiers.swift index 25862ffe0f..b66e776da2 100644 --- a/FreeAPS/Sources/Views/ViewModifiers.swift +++ b/FreeAPS/Sources/Views/ViewModifiers.swift @@ -182,7 +182,10 @@ struct HeaderBackground: View { @Environment(\.colorScheme) var colorScheme var body: some View { Rectangle() - .fill(colorScheme == .light ? .gray.opacity(IAPSconfig.backgroundOpacity) : Color.header2.opacity(1)) + .fill( + colorScheme == .light ? .gray.opacity(IAPSconfig.backgroundOpacity) : Color.header2.opacity(1) +// Color(.systemGray5) + ) } } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index aa3541aaca..9b9c8f87b3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -22,13 +22,18 @@ FASTLANE_KEY = ENV["FASTLANE_KEY"] DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" -APP_IDENTIFIER = "ru.artpancreas.#{TEAMID}.FreeAPS" + +APP_IDENTIFIER = ENV.fetch('APP_IDENTIFIER') { "ru.artpancreas.#{TEAMID}.FreeAPS" } + +if #{APP_IDENTIFIER} != "ru.artpancreas.#{TEAMID}.FreeAPS" + File.write('../ConfigOverride.xcconfig', "BUNDLE_IDENTIFIER = #{APP_IDENTIFIER}", mode: 'a') +end platform :ios do desc "Build iAPS" lane :build_iAPS do setup_ci if ENV['CI'] - + update_project_team( path: "#{GITHUB_WORKSPACE}/FreeAPS.xcodeproj", teamid: "#{TEAMID}" diff --git a/fastlane/docs/github.md b/fastlane/docs/github.md new file mode 100644 index 0000000000..1967ebf5eb --- /dev/null +++ b/fastlane/docs/github.md @@ -0,0 +1,44 @@ +## Setup Github iAPS repository + +### Generate Personal Access Token + +> If you have previously created a Personal Access Token ( PAT ), you can re-use it, +> and skip this step. +> +> **NOTE:** GitHub doesn't provide a means to view a previously created token, it only +> allows you to regenerate it. Regenerating the token invalidates the old one, so +> if you already have one in use and do not know what it is, create a new one. +> +> * Enter a name for your token. Something like "FastLane Access Token". +> * The default Expiration time is 30 days - but you should select `No Expiration` +> * Select the `repo` permission scope. +> * Click "Generate token". +> * Copy the token and record it. It will be used below as `GH_PAT`. + +### Fork iAPS Repository + +> **NOTE:** If you already have a fork of iAPS in GitHub, you can't make another one. You can continue to work with your existing fork, or delete that from GitHub and fork a new > copy. +> +> 1. Fork https://github.com/Artificial-Pancreas/iAPS into your account. +> 2. In the forked iAPS repo, go to Settings -> Secrets and Variables -> Actions +> 3. For each of the following secrets, tap on "New repository secret", then add the name of the secret, along with the value you recorded for it: +> * `TEAMID` +> * `FASTLANE_KEY_ID` +> * `FASTLANE_ISSUER_ID` +> * `FASTLANE_KEY` +> * `GH_PAT` +> * `MATCH_PASSWORD` - just make up a password for this +> + +### Keep Fork Up to Date + +> 1. Click on the "Actions" tab of your iAPS repository. +> 2. Select "5. Sync Upstream". +> 3. Click "Run Workflow", Select Branch to Maintain, and tap the green button. +> +> Although most people will only need to sync one branch, the above can be repeated +> on any branch where these workflows are available. +> +> Currently the Action is scheduled to run at midnight daily, but can be manually +> triggered at any time. + diff --git a/fastlane/testflight.md b/fastlane/testflight.md index 4e0cdffe58..7e2ecb841f 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -35,23 +35,8 @@ This is also a common step for all "browser builds", do this step only once 1. Create a [new empty repository](https://github.com/new) titled `Match-Secrets`. It should be private. ## Setup Github iAPS repository -1. Fork https://github.com/Artificial-Pancreas/iAPS into your account. If you already have a fork of iAPS in GitHub, you can't make another one. You can continue to work with your existing fork, or delete that from GitHub and then and fork https://github.com/Artificial-Pancreas/iAPS. - -If you have previously built Loop or another app using the "browser build" method, you can can re-use your previous personal access token (`GH_PAT`) and skip ahead to `step 2`. -1. Create a [new personal access token](https://github.com/settings/tokens/new): - * Enter a name for your token. Something like "FastLane Access Token". - * The default Expiration time is 30 days - but you should select `No Expiration` - * Select the `repo` permission scope. - * Click "Generate token". - * Copy the token and record it. It will be used below as `GH_PAT`. -1. In the forked iAPS repo, go to Settings -> Secrets -> Actions. -1. For each of the following secrets, tap on "New repository secret", then add the name of the secret, along with the value you recorded for it: - * `TEAMID` - * `FASTLANE_KEY_ID` - * `FASTLANE_ISSUER_ID` - * `FASTLANE_KEY` - * `GH_PAT` - * `MATCH_PASSWORD` - just make up a password for this + +> [Click here](docs/github.md) ## Validate repository secrets