From d854e3b45d3a248e5c1487c4053f61dace8ec434 Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Tue, 27 Jun 2023 23:30:12 +0200 Subject: [PATCH 01/25] 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. --- .github/workflows/build_loop.yml | 81 ++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 77720d477a..7666ba5f45 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -6,16 +6,23 @@ on: ## 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 + ## Remove the "#" sign from the beginning of the two lines below to get automated builds every month #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. + +env: + UPSTREAM_REPO: LoopKit/LoopWorkspace + UPSTREAM_BRANCH: main + TARGET_BRANCH: main + SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository + CUSTOMIZE_APP: 'true' # apply code customizations from patch files in LoopWorkspace/patches/ and/or individual submodule patches specified under 'name: Customize Loop' ('false / 'true') jobs: secrets: uses: ./.github/workflows/validate_secrets.yml secrets: inherit - - build: + + upstream_sync_and_build: needs: secrets runs-on: macos-13 steps: @@ -28,7 +35,71 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + ref: ${{ env.TARGET_BRANCH }} + + # Run the sync action + - name: Sync upstream changes + if: ${{ env.SYNC_UPSTREAM == 'true' }} + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: ${{ env.TARGET_BRANCH }} + target_branch_checkout_args: --recurse-submodules + shallow_since: 6 months ago + # REQUIRED 'target_repo_token' exactly like this! + target_repo_token: ${{ secrets.GH_PAT }} + upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} + upstream_sync_repo: ${{ env.UPSTREAM_REPO }} + # upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }} + # Set test_mode true to run tests instead of the true action!! + test_mode: false + + # Step 3: Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + - 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 + with: + time_elapsed: 27 # Time elapsed from the previous commit to trigger a new automated commit (in days) + + # Customize Loop: Download and apply patches + - name: Customize Loop + if: ${{ env.CUSTOMIZE_APP == 'true'}} + + run: | + + # LoopWorkspace patches + # -applies any patches located in the LoopWorkspace/patches/ directory + if $(ls ./patches/* &> /dev/null); then + git apply ./patches/* --exclude=save_patches_here.md --allow-empty -v --whitespace=fix + fi + + # Submodule Loop patches: + # Template for customizing submodule Loop based on CustomTypeOne/LoopPatches (remove the "#" sign from the beginning of the line below to activate): + #wget -qO- https://raw.githubusercontent.com/CustomTypeOne/LoopPatches/main/LoopPatch.txt | git apply --directory=Loop -v --whitespace=fix + + # Submodule LoopKit patches: + # Template for customizing submodule LoopKit based on CustomTypeOne/LoopPatches (remove the "#" sign from the beginning of the line below to activate): + #wget -qO- https://raw.githubusercontent.com/CustomTypeOne/LoopPatches/main/LoopkitPatch.txt | git apply --directory=LoopKit -v --whitespace=fix + + + # Submodule xxxxx patches: + + # Add patches for customization of additional submodules by following the templates above, + # and make sure to specify the submodule by setting '--directory=(submodule_name)'. + # Several patches may be added per submodule. + # Adding comments (#) may be useful to easily tell the individual patches apart. + # All customizations can be disabled by setting env SYNC_UPSTREAM: 'false' + + # 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" @@ -63,4 +134,4 @@ jobs: name: build-artifacts path: | artifacts - buildlog + buildlog \ No newline at end of file From 0ad2bc152d5d36fb8fa52b145286c7ab8ae4e51b Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Wed, 15 Mar 2023 23:00:05 +0100 Subject: [PATCH 02/25] Add ./patches/save_patches_here.md --- patches/save_patches_here.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 patches/save_patches_here.md diff --git a/patches/save_patches_here.md b/patches/save_patches_here.md new file mode 100644 index 0000000000..f43951cfd7 --- /dev/null +++ b/patches/save_patches_here.md @@ -0,0 +1 @@ +LoopWorksspace-level patches can be saved in this directory (LoopWorkspace/patches/) \ No newline at end of file From f5ff351cdbdb480adbda0a143abca736dd519d78 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:36:46 +0100 Subject: [PATCH 03/25] build_loop.yml: update patch templates for submodules --- .github/workflows/build_loop.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 7666ba5f45..c2b5c67947 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -83,14 +83,15 @@ jobs: fi # Submodule Loop patches: - # Template for customizing submodule Loop based on CustomTypeOne/LoopPatches (remove the "#" sign from the beginning of the line below to activate): - #wget -qO- https://raw.githubusercontent.com/CustomTypeOne/LoopPatches/main/LoopPatch.txt | git apply --directory=Loop -v --whitespace=fix + # Template for customizing submodule Loop (changes Loop app name to "MyCustomizedLoop") + # Remove the "#" sign from the beginning of the line below to activate: + wget -qO- https://github.com/loopnlearn/Loop/commit/1468358552babba21da44a4a5bb6ae679588bc66.patch | git apply --directory=Loop -v --whitespace=fix # Submodule LoopKit patches: - # Template for customizing submodule LoopKit based on CustomTypeOne/LoopPatches (remove the "#" sign from the beginning of the line below to activate): - #wget -qO- https://raw.githubusercontent.com/CustomTypeOne/LoopPatches/main/LoopkitPatch.txt | git apply --directory=LoopKit -v --whitespace=fix + # General template for customizing submodule LoopKit + # Copy url from a GitHub commit or pull request and insert below, and remove the "#" sign from the beginning of the line to activate: + #wget -qO- url_to_github_commit.patch | git apply --directory=LoopKit -v --whitespace=fix - # Submodule xxxxx patches: # Add patches for customization of additional submodules by following the templates above, @@ -134,4 +135,4 @@ jobs: name: build-artifacts path: | artifacts - buildlog \ No newline at end of file + buildlog From a62873b192adfbbf7029baebb7e6bae5663feec0 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:38:31 +0100 Subject: [PATCH 04/25] build_loop.yml: comment out patch template for submodule Loop --- .github/workflows/build_loop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index c2b5c67947..a03ed2fcdd 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -85,7 +85,7 @@ jobs: # Submodule Loop patches: # Template for customizing submodule Loop (changes Loop app name to "MyCustomizedLoop") # Remove the "#" sign from the beginning of the line below to activate: - wget -qO- https://github.com/loopnlearn/Loop/commit/1468358552babba21da44a4a5bb6ae679588bc66.patch | git apply --directory=Loop -v --whitespace=fix + #wget -qO- https://github.com/loopnlearn/Loop/commit/1468358552babba21da44a4a5bb6ae679588bc66.patch | git apply --directory=Loop -v --whitespace=fix # Submodule LoopKit patches: # General template for customizing submodule LoopKit From 3751219811bf5b8533ade86e3099c5d89bf90000 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 11:04:10 +0100 Subject: [PATCH 05/25] build_loop.yml: patch template app name = CustomLoop --- .github/workflows/build_loop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index a03ed2fcdd..a9d78330a2 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -83,9 +83,9 @@ jobs: fi # Submodule Loop patches: - # Template for customizing submodule Loop (changes Loop app name to "MyCustomizedLoop") + # Template for customizing submodule Loop (changes Loop app name to "CustomLoop") # Remove the "#" sign from the beginning of the line below to activate: - #wget -qO- https://github.com/loopnlearn/Loop/commit/1468358552babba21da44a4a5bb6ae679588bc66.patch | git apply --directory=Loop -v --whitespace=fix + #wget -qO- https://github.com/loopnlearn/Loop/commit/d206432b024279ef710df462b20bd464cd9682d4.patch | git apply --directory=Loop -v --whitespace=fix # Submodule LoopKit patches: # General template for customizing submodule LoopKit From d8a160f8ce9431d77e8af031966499797f97bc16 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 13:20:10 +0100 Subject: [PATCH 06/25] Update build_loop.yml: fix typo --- .github/workflows/build_loop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index a9d78330a2..234432bcb9 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -95,10 +95,10 @@ jobs: # Submodule xxxxx patches: # Add patches for customization of additional submodules by following the templates above, - # and make sure to specify the submodule by setting '--directory=(submodule_name)'. + # and make sure to specify the submodule by setting "--directory=(submodule_name)". # Several patches may be added per submodule. # Adding comments (#) may be useful to easily tell the individual patches apart. - # All customizations can be disabled by setting env SYNC_UPSTREAM: 'false' + # All customizations can be disabled by setting env CUSTOMIZE_APP: 'false' # Patch Fastlane Match to not print tables From c830f5dc31faaf5423450d4db301fa5794c40775 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:39:42 +0100 Subject: [PATCH 07/25] Update save_patches_here.md: fix typo --- patches/save_patches_here.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/save_patches_here.md b/patches/save_patches_here.md index f43951cfd7..3320e10411 100644 --- a/patches/save_patches_here.md +++ b/patches/save_patches_here.md @@ -1 +1 @@ -LoopWorksspace-level patches can be saved in this directory (LoopWorkspace/patches/) \ No newline at end of file +LoopWorkspace-level patches can be saved in this directory (LoopWorkspace/patches/) From 6ae3b1de47c4a07244cbd904701d3052efffe751 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 14:55:11 +0100 Subject: [PATCH 08/25] build_loop.yml: delete test_mode --- .github/workflows/build_loop.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 234432bcb9..e52a764860 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -51,8 +51,6 @@ jobs: upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} upstream_sync_repo: ${{ env.UPSTREAM_REPO }} # upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }} - # Set test_mode true to run tests instead of the true action!! - test_mode: false # Step 3: Display a sample message based on the sync output var 'has_new_commits' - name: New commits found From bbf5e11d99616a0d81f1736526ffd284ebad7b02 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:23:01 +0100 Subject: [PATCH 09/25] build_loop.yml: remove env CUSTOMIZE_APP --- .github/workflows/build_loop.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index e52a764860..b0dc97d02a 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -15,7 +15,6 @@ env: UPSTREAM_BRANCH: main TARGET_BRANCH: main SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository - CUSTOMIZE_APP: 'true' # apply code customizations from patch files in LoopWorkspace/patches/ and/or individual submodule patches specified under 'name: Customize Loop' ('false / 'true') jobs: secrets: @@ -96,7 +95,6 @@ jobs: # and make sure to specify the submodule by setting "--directory=(submodule_name)". # Several patches may be added per submodule. # Adding comments (#) may be useful to easily tell the individual patches apart. - # All customizations can be disabled by setting env CUSTOMIZE_APP: 'false' # Patch Fastlane Match to not print tables From c3870196f31d2684918296b8c8971dee0635eb73 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Thu, 16 Mar 2023 17:24:15 +0100 Subject: [PATCH 10/25] Update build_loop.yml: remove remaining env CUSTOMIZE_APP refs --- .github/workflows/build_loop.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index b0dc97d02a..187a3e1e9d 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -69,8 +69,6 @@ jobs: # Customize Loop: Download and apply patches - name: Customize Loop - if: ${{ env.CUSTOMIZE_APP == 'true'}} - run: | # LoopWorkspace patches From 175b0349805f3abfaa9775c134e99e31f9cd8275 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Fri, 17 Mar 2023 08:54:45 +0100 Subject: [PATCH 11/25] build_loop.yml: remove '--exclude=' from 'git apply' --- .github/workflows/build_loop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 187a3e1e9d..310bab92d6 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -74,7 +74,7 @@ jobs: # LoopWorkspace patches # -applies any patches located in the LoopWorkspace/patches/ directory if $(ls ./patches/* &> /dev/null); then - git apply ./patches/* --exclude=save_patches_here.md --allow-empty -v --whitespace=fix + git apply ./patches/* --allow-empty -v --whitespace=fix fi # Submodule Loop patches: From 66c59086bd35da3e975238e83ae8ca50c1212962 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:06:05 +0100 Subject: [PATCH 12/25] 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) --- .github/workflows/update.yml | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000000..78125b6348 --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,75 @@ +name: 'Auto-update' + +on: + schedule: + - cron: '0 7 * * 1,4' + # scheduled at 07:00 every Monday and Thursday + + workflow_dispatch: # click the button on Github repo! + +env: + UPSTREAM_REPO: LoopKit/LoopWorkspace + UPSTREAM_BRANCH: main + TARGET_BRANCH: main + +jobs: + check_latest_from_upstream: + runs-on: ubuntu-latest + name: Check latest commits from upstream repo + outputs: + NEW_COMMITS: ${{ steps.sync.outputs.has_new_commits }} + + steps: + # REQUIRED step + # Step 1: run a standard checkout action, provided by github + - name: Checkout target repo + uses: actions/checkout@v3 + with: + # optional: set the branch to checkout, + # sync action checks out your 'target_sync_branch' anyway + #submodules: recursive + ref: ${{ env.TARGET_BRANCH }} + + # REQUIRED step + # Step 2: run the sync action + - name: Sync upstream changes + if: (github.repository_owner != 'LoopKit') + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: ${{ env.TARGET_BRANCH }} + #target_branch_checkout_args: --recurse-submodules + shallow_since: 6 months ago + # REQUIRED 'target_repo_token' exactly like this! + target_repo_token: ${{ secrets.GH_PAT }} + upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} + upstream_sync_repo: ${{ env.UPSTREAM_REPO }} + + # Step 3: Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: | + echo ${{ steps.sync.outputs.has_new_commits }} + echo "NEW_COMMITS=${{ steps.sync.outputs.has_new_commits }}" >> $GITHUB_OUTPUT + + # Keep upstream repository "alive": add empty commits after "time_elapsed" days to avoid inactivation of scheduled workflows + - name: Keep alive + if: (github.ref == 'refs/heads/main' && github.repository_owner == 'LoopKit') + uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings + with: + time_elapsed: 27 # Time elapsed from the previous commit to trigger a new automated commit (in days) + + # Launch build workflow if new commits are found + launch_build_workflow: + if: needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' && (github.repository_owner != 'LoopKit') + needs: check_latest_from_upstream + name: Launch build workflow + uses: ./.github/workflows/build_loop.yml + secrets: inherit From da5de547f8371672b5116b5d16cdb1049e18b757 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Fri, 17 Mar 2023 14:08:03 +0100 Subject: [PATCH 13/25] Remove keepalive action from build_loop.yml - keepalive action moved to update.yml --- .github/workflows/build_loop.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 310bab92d6..dd96655b83 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -62,11 +62,7 @@ jobs: - 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 - with: - time_elapsed: 27 # Time elapsed from the previous commit to trigger a new automated commit (in days) - + # Customize Loop: Download and apply patches - name: Customize Loop run: | From 8ede04a1a46126ef56573d8d49243b0be99332ab Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Fri, 17 Mar 2023 22:51:44 +0100 Subject: [PATCH 14/25] 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. --- .github/workflows/build_loop.yml | 9 +++------ .github/workflows/update.yml | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index dd96655b83..0347d281cc 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -2,18 +2,15 @@ name: 4. Build Loop run-name: Build Loop ${{ github.ref_name }} on: workflow_dispatch: + workflow_call: ## 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 month - #schedule: - #- cron: '0 17 1 * *' # Runs at 17:00 UTC on the 1st in every month. - env: UPSTREAM_REPO: LoopKit/LoopWorkspace - UPSTREAM_BRANCH: main - TARGET_BRANCH: main + UPSTREAM_BRANCH: main # upstream branch to sync from + TARGET_BRANCH: main # branch on fork to build from SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository jobs: diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 78125b6348..603fb0e28a 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,16 +1,22 @@ name: 'Auto-update' +# Runs only on schedule for the default branch +# TARGET_BRANCH should be set as default +# Syncs the target branch with upstream +# Checks for activity and creates empty commits to TARGET_BRANCH as needed after 'time_elapsed' days of inactivity +# Launches the build workflow if new commits are found. +# The build workflow syncs and builds the main branch and uploads to TestFlight + on: + workflow_dispatch: schedule: - cron: '0 7 * * 1,4' # scheduled at 07:00 every Monday and Thursday - workflow_dispatch: # click the button on Github repo! - env: UPSTREAM_REPO: LoopKit/LoopWorkspace UPSTREAM_BRANCH: main - TARGET_BRANCH: main + TARGET_BRANCH: actions # target branch on fork to be kept "alive" for running scheduled workflows (repo activity required at least every 60 days for scheduled workflows to remain active) jobs: check_latest_from_upstream: @@ -33,7 +39,6 @@ jobs: # REQUIRED step # Step 2: run the sync action - name: Sync upstream changes - if: (github.repository_owner != 'LoopKit') id: sync uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 with: @@ -59,16 +64,16 @@ jobs: echo ${{ steps.sync.outputs.has_new_commits }} echo "NEW_COMMITS=${{ steps.sync.outputs.has_new_commits }}" >> $GITHUB_OUTPUT - # Keep upstream repository "alive": add empty commits after "time_elapsed" days to avoid inactivation of scheduled workflows + # Keep repository "alive": add empty commits to TARGET_BRANCH after "time_elapsed" days of inactivity to avoid inactivation of scheduled workflows - name: Keep alive - if: (github.ref == 'refs/heads/main' && github.repository_owner == 'LoopKit') + if: github.ref == 'refs/heads/${{ env.TARGET_BRANCH }}' uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings with: time_elapsed: 27 # Time elapsed from the previous commit to trigger a new automated commit (in days) # Launch build workflow if new commits are found launch_build_workflow: - if: needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' && (github.repository_owner != 'LoopKit') + if: needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' needs: check_latest_from_upstream name: Launch build workflow uses: ./.github/workflows/build_loop.yml From f4e6f5a86b987453123424c81a43ded60cdba4c0 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:21:50 +0200 Subject: [PATCH 15/25] build_loop.yml: Add job names for `secrets` and `upstream_sync_and_build` --- .github/workflows/build_loop.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 0347d281cc..1e20778c33 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -15,10 +15,12 @@ env: jobs: secrets: + name: Secrets uses: ./.github/workflows/validate_secrets.yml secrets: inherit upstream_sync_and_build: + name: Sync and build needs: secrets runs-on: macos-13 steps: From 277178ff56c8ff75a5070903acbc98ad24594084 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:36:23 +0200 Subject: [PATCH 16/25] update.yml: shorter job name for `check_latest_from_upstream`: Check upstream --- .github/workflows/update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 603fb0e28a..18b07daffa 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -21,7 +21,7 @@ env: jobs: check_latest_from_upstream: runs-on: ubuntu-latest - name: Check latest commits from upstream repo + name: Check upstream outputs: NEW_COMMITS: ${{ steps.sync.outputs.has_new_commits }} From 7874c0221bdaa3fb9b20a7210868368624fe59ff Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:54:25 +0200 Subject: [PATCH 17/25] build_loop.yml: use curl instead of wget for downloading patches --- .github/workflows/build_loop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 1e20778c33..c3e9f51f97 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -75,12 +75,12 @@ jobs: # Submodule Loop patches: # Template for customizing submodule Loop (changes Loop app name to "CustomLoop") # Remove the "#" sign from the beginning of the line below to activate: - #wget -qO- https://github.com/loopnlearn/Loop/commit/d206432b024279ef710df462b20bd464cd9682d4.patch | git apply --directory=Loop -v --whitespace=fix + #curl https://github.com/loopnlearn/Loop/commit/d206432b024279ef710df462b20bd464cd9682d4.patch | git apply --directory=Loop -v --whitespace=fix # Submodule LoopKit patches: # General template for customizing submodule LoopKit # Copy url from a GitHub commit or pull request and insert below, and remove the "#" sign from the beginning of the line to activate: - #wget -qO- url_to_github_commit.patch | git apply --directory=LoopKit -v --whitespace=fix + #curl url_to_github_commit.patch | git apply --directory=LoopKit -v --whitespace=fix # Submodule xxxxx patches: From 27b97a4c63ecc721804b4b55121aeeb5f71e0746 Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Thu, 25 May 2023 23:27:07 +0200 Subject: [PATCH 18/25] 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 --- .github/workflows/build_loop.yml | 41 ++++++-------------------------- .github/workflows/update.yml | 13 +++++----- 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index c3e9f51f97..950c8cc91e 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -7,11 +7,11 @@ on: ## Remove the "#" sign from the beginning of the line below to get automated builds on push (code changes in your repository) #push: + schedule: + - cron: '30 04 1 * *' # Runs at 04:30 UTC on the 1st every month + env: - UPSTREAM_REPO: LoopKit/LoopWorkspace - UPSTREAM_BRANCH: main # upstream branch to sync from - TARGET_BRANCH: main # branch on fork to build from - SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository + BUILD_BRANCH: ${{ github.ref_name }} # branch on fork to build from (relpace with specific branch name if needed) jobs: secrets: @@ -19,8 +19,8 @@ jobs: uses: ./.github/workflows/validate_secrets.yml secrets: inherit - upstream_sync_and_build: - name: Sync and build + build: + name: Build needs: secrets runs-on: macos-13 steps: @@ -33,34 +33,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - ref: ${{ env.TARGET_BRANCH }} - - # Run the sync action - - name: Sync upstream changes - if: ${{ env.SYNC_UPSTREAM == 'true' }} - id: sync - uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 - with: - target_sync_branch: ${{ env.TARGET_BRANCH }} - target_branch_checkout_args: --recurse-submodules - shallow_since: 6 months ago - # REQUIRED 'target_repo_token' exactly like this! - target_repo_token: ${{ secrets.GH_PAT }} - upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} - upstream_sync_repo: ${{ env.UPSTREAM_REPO }} - # upstream_repo_access_token: ${{ secrets.UPSTREAM_REPO_SECRET }} - - # Step 3: Display a sample message based on the sync output var 'has_new_commits' - - name: New commits found - if: steps.sync.outputs.has_new_commits == 'true' - run: echo "New commits were found to sync." - - - name: No new commits - if: steps.sync.outputs.has_new_commits == 'false' - run: echo "There were no new commits." - - - name: Show value of 'has_new_commits' - run: echo ${{ steps.sync.outputs.has_new_commits }} + ref: ${{ env.BUILD_BRANCH }} # Customize Loop: Download and apply patches - name: Customize Loop diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 18b07daffa..4411dd2c32 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -10,14 +10,14 @@ name: 'Auto-update' on: workflow_dispatch: schedule: - - cron: '0 7 * * 1,4' - # scheduled at 07:00 every Monday and Thursday + - cron: '0 04 * * *' + # scheduled at 04:00 every day env: UPSTREAM_REPO: LoopKit/LoopWorkspace - UPSTREAM_BRANCH: main - TARGET_BRANCH: actions # target branch on fork to be kept "alive" for running scheduled workflows (repo activity required at least every 60 days for scheduled workflows to remain active) - + UPSTREAM_BRANCH: ${{ github.ref_name }} # branch on upstream repository to sync from (relpace with specific branch name if needed) + TARGET_BRANCH: ${{ github.ref_name }} # target branch on fork to be kept in sync, and target branch on upstream to be kept alive (relpace with specific branch name if needed) + jobs: check_latest_from_upstream: runs-on: ubuntu-latest @@ -39,6 +39,7 @@ jobs: # REQUIRED step # Step 2: run the sync action - name: Sync upstream changes + if: github.repository_owner != 'LoopKit' # do not run the upstream sync action on the upstream repository id: sync uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 with: @@ -69,7 +70,7 @@ jobs: if: github.ref == 'refs/heads/${{ env.TARGET_BRANCH }}' uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings with: - time_elapsed: 27 # Time elapsed from the previous commit to trigger a new automated commit (in days) + time_elapsed: 50 # Time elapsed from the previous commit to trigger a new automated commit (in days) # Launch build workflow if new commits are found launch_build_workflow: From 52106bf1584cff68e15834028cfc610b64eded62 Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Fri, 26 May 2023 22:20:57 +0200 Subject: [PATCH 19/25] Add branch name to run-names - with round brackets around branch name for readability: (${{ github.ref_name }}) --- .github/workflows/build_loop.yml | 2 +- .github/workflows/update.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 950c8cc91e..0ca90a1ec3 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -1,5 +1,5 @@ name: 4. Build Loop -run-name: Build Loop ${{ github.ref_name }} +run-name: Build Loop (${{ github.ref_name }}) on: workflow_dispatch: workflow_call: diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 4411dd2c32..20f3ccdd78 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -1,4 +1,5 @@ name: 'Auto-update' +run-name: Auto-update (${{ github.ref_name }}) # Runs only on schedule for the default branch # TARGET_BRANCH should be set as default From c8d10dfcceaa2247d80ad71f83f166722b9542fc Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Thu, 25 May 2023 23:33:20 +0200 Subject: [PATCH 20/25] Remove mention of setting TARGET_BRANCH as default, since its not fixed --- .github/workflows/update.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 20f3ccdd78..f450d5e29b 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -2,7 +2,6 @@ name: 'Auto-update' run-name: Auto-update (${{ github.ref_name }}) # Runs only on schedule for the default branch -# TARGET_BRANCH should be set as default # Syncs the target branch with upstream # Checks for activity and creates empty commits to TARGET_BRANCH as needed after 'time_elapsed' days of inactivity # Launches the build workflow if new commits are found. From 7a83fa83ab97b138447fe95e50778d4ac0e67287 Mon Sep 17 00:00:00 2001 From: bjornoleh Date: Tue, 27 Jun 2023 23:23:08 +0200 Subject: [PATCH 21/25] 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 --- .github/workflows/build_loop.yml | 94 +++++++++++++++++++++++++++----- 1 file changed, 81 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 0ca90a1ec3..35516da0b6 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -2,39 +2,107 @@ name: 4. Build Loop run-name: Build Loop (${{ github.ref_name }}) on: workflow_dispatch: - workflow_call: ## Remove the "#" sign from the beginning of the line below to get automated builds on push (code changes in your repository) #push: schedule: - - cron: '30 04 1 * *' # Runs at 04:30 UTC on the 1st every month + - cron: '0 04 * * *' # Checks for updates at 04:00 UTC every day + - cron: '0 04 1 * *' # Builds the app on the 1th every month env: - BUILD_BRANCH: ${{ github.ref_name }} # branch on fork to build from (relpace with specific branch name if needed) + UPSTREAM_REPO: LoopKit/LoopWorkspace + UPSTREAM_BRANCH: ${{ github.ref_name }} # branch on upstream repository to sync from (relpace with specific branch name if needed) + TARGET_BRANCH: ${{ github.ref_name }} # target branch on fork to be kept in sync, and target branch on upstream to be kept alive (relpace with specific branch name if needed) + ALIVE_BRANCH: alive + SYNC_UPSTREAM: 'true' # set to 'false' or 'true' to disable / enable syncing of fork with upstream repository jobs: - secrets: - name: Secrets - uses: ./.github/workflows/validate_secrets.yml - secrets: inherit + check_latest_from_upstream: + runs-on: ubuntu-latest + name: Check upstream and keep alive + outputs: + NEW_COMMITS: ${{ steps.sync.outputs.has_new_commits }} + steps: + - name: Checkout target repo + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_PAT }} + ref: alive + + - name: Sync upstream changes + if: ${{ env.SYNC_UPSTREAM == 'true' }} && github.repository_owner != 'LoopKit' # do not run the upstream sync action on the upstream repository + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: ${{ env.ALIVE_BRANCH }} + shallow_since: 6 months ago + target_repo_token: ${{ secrets.GH_PAT }} + upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} + upstream_sync_repo: ${{ env.UPSTREAM_REPO }} + + # Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: | + echo ${{ steps.sync.outputs.has_new_commits }} + echo "NEW_COMMITS=${{ steps.sync.outputs.has_new_commits }}" >> $GITHUB_OUTPUT + + # Keep repository "alive": add empty commits to ALIVE_BRANCH after "time_elapsed" days of inactivity to avoid inactivation of scheduled workflows + - name: Keep alive + uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings + with: + time_elapsed: 20 # Time elapsed from the previous commit to trigger a new automated commit (in days) + build: name: Build - needs: secrets + needs: check_latest_from_upstream runs-on: macos-13 + if: ${{ github.event_name == 'workflow_dispatch' || github.event.schedule == '0 04 1 * *' || needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' }} # runs if started manually, or if scheduled on the first each month, or if new commits were found steps: - # Uncomment to manually select latest Xcode if needed - - name: Select Latest Xcode + - name: Select Xcode version run: "sudo xcode-select --switch /Applications/Xcode_14.3.1.app/Contents/Developer" - # Checks-out the repo - name: Checkout Repo uses: actions/checkout@v3 with: + token: ${{ secrets.GH_PAT }} submodules: recursive - ref: ${{ env.BUILD_BRANCH }} - + ref: ${{ env.TARGET_BRANCH }} + + - name: Sync upstream changes + if: ${{ env.SYNC_UPSTREAM == 'true' }} && github.repository_owner != 'LoopKit' # do not run the upstream sync action on the upstream repository + id: sync + uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 + with: + target_sync_branch: ${{ env.TARGET_BRANCH }} + shallow_since: 6 months ago + target_repo_token: ${{ secrets.GH_PAT }} + upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} + upstream_sync_repo: ${{ env.UPSTREAM_REPO }} + + # Display a sample message based on the sync output var 'has_new_commits' + - name: New commits found + if: steps.sync.outputs.has_new_commits == 'true' + run: echo "New commits were found to sync." + + - name: No new commits + if: steps.sync.outputs.has_new_commits == 'false' + run: echo "There were no new commits." + + - name: Show value of 'has_new_commits' + run: | + echo ${{ steps.sync.outputs.has_new_commits }} + echo "NEW_COMMITS=${{ steps.sync.outputs.has_new_commits }}" >> $GITHUB_OUTPUT + # Customize Loop: Download and apply patches - name: Customize Loop run: | From 42a73869a5213ed9f99edd8dfbb754d17b2af523 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:23:43 +0200 Subject: [PATCH 22/25] Delete update.yml --- .github/workflows/update.yml | 81 ------------------------------------ 1 file changed, 81 deletions(-) delete mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index f450d5e29b..0000000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: 'Auto-update' -run-name: Auto-update (${{ github.ref_name }}) - -# Runs only on schedule for the default branch -# Syncs the target branch with upstream -# Checks for activity and creates empty commits to TARGET_BRANCH as needed after 'time_elapsed' days of inactivity -# Launches the build workflow if new commits are found. -# The build workflow syncs and builds the main branch and uploads to TestFlight - -on: - workflow_dispatch: - schedule: - - cron: '0 04 * * *' - # scheduled at 04:00 every day - -env: - UPSTREAM_REPO: LoopKit/LoopWorkspace - UPSTREAM_BRANCH: ${{ github.ref_name }} # branch on upstream repository to sync from (relpace with specific branch name if needed) - TARGET_BRANCH: ${{ github.ref_name }} # target branch on fork to be kept in sync, and target branch on upstream to be kept alive (relpace with specific branch name if needed) - -jobs: - check_latest_from_upstream: - runs-on: ubuntu-latest - name: Check upstream - outputs: - NEW_COMMITS: ${{ steps.sync.outputs.has_new_commits }} - - steps: - # REQUIRED step - # Step 1: run a standard checkout action, provided by github - - name: Checkout target repo - uses: actions/checkout@v3 - with: - # optional: set the branch to checkout, - # sync action checks out your 'target_sync_branch' anyway - #submodules: recursive - ref: ${{ env.TARGET_BRANCH }} - - # REQUIRED step - # Step 2: run the sync action - - name: Sync upstream changes - if: github.repository_owner != 'LoopKit' # do not run the upstream sync action on the upstream repository - id: sync - uses: aormsby/Fork-Sync-With-Upstream-action@v3.4 - with: - target_sync_branch: ${{ env.TARGET_BRANCH }} - #target_branch_checkout_args: --recurse-submodules - shallow_since: 6 months ago - # REQUIRED 'target_repo_token' exactly like this! - target_repo_token: ${{ secrets.GH_PAT }} - upstream_sync_branch: ${{ env.UPSTREAM_BRANCH }} - upstream_sync_repo: ${{ env.UPSTREAM_REPO }} - - # Step 3: Display a sample message based on the sync output var 'has_new_commits' - - name: New commits found - if: steps.sync.outputs.has_new_commits == 'true' - run: echo "New commits were found to sync." - - - name: No new commits - if: steps.sync.outputs.has_new_commits == 'false' - run: echo echo "There were no new commits." - - - name: Show value of 'has_new_commits' - run: | - echo ${{ steps.sync.outputs.has_new_commits }} - echo "NEW_COMMITS=${{ steps.sync.outputs.has_new_commits }}" >> $GITHUB_OUTPUT - - # Keep repository "alive": add empty commits to TARGET_BRANCH after "time_elapsed" days of inactivity to avoid inactivation of scheduled workflows - - name: Keep alive - if: github.ref == 'refs/heads/${{ env.TARGET_BRANCH }}' - uses: gautamkrishnar/keepalive-workflow@v1 # using the workflow with default settings - with: - time_elapsed: 50 # Time elapsed from the previous commit to trigger a new automated commit (in days) - - # Launch build workflow if new commits are found - launch_build_workflow: - if: needs.check_latest_from_upstream.outputs.NEW_COMMITS == 'true' - needs: check_latest_from_upstream - name: Launch build workflow - uses: ./.github/workflows/build_loop.yml - secrets: inherit From 5705c01ad03c512a7acc47da694132d696f5a64c Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Wed, 21 Jun 2023 23:25:24 +0200 Subject: [PATCH 23/25] testflight.md: update GH_PAT instructions * Change the Expiration selection to `No expiration`. * Select the `repo` and `workflow` permission scopes. --- fastlane/testflight.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/testflight.md b/fastlane/testflight.md index 2a44847cc5..435db03cf9 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -48,8 +48,8 @@ Log into your GitHub account to create a personal access token; this is one of t 1. Create a [new personal access token](https://github.com/settings/tokens/new): * Enter a name for your token, use "FastLane Access Token". - * Change the selection to 90 days. - * Select the `repo` permission scope. + * Change the Expiration selection to `No expiration`. + * Select the `repo` and `workflow` permission scopes. * Click "Generate token". * Copy the token and record it. It will be used below as `GH_PAT`. From 86feb3e5c989f9a5dbe92d283c7e548987d7a1a2 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Mon, 10 Jul 2023 20:09:18 +0200 Subject: [PATCH 24/25] testflight.md instructions: Create a branch named "alive" --- fastlane/testflight.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fastlane/testflight.md b/fastlane/testflight.md index 435db03cf9..2e72015dd2 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -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. + +1. Go to the "Code" tab of your LoopWorkspace repository. +1. Click the branch selection dropdown button, and then `View all branches`. +1. Click the green "New branch" button (upper right). +1. Type `alive` in the "New branch name" field. +1. Select `LoopKit/LoopWorkspace` as "Source". +1. Select `dev` in the branch dropdown. +1. Click the green "Create new branch" button. + ## Build Loop 1. Click on the "Actions" tab of your LoopWorkspace repository. From 9ee263ed79874c19c0abb5d21c396e02b7456b53 Mon Sep 17 00:00:00 2001 From: bjornoleh <63544115+bjornoleh@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:40:23 +0200 Subject: [PATCH 25/25] =?UTF-8?q?testflight.md:=20rephrase=20section=20on?= =?UTF-8?q?=20=E2=80=98Create=20a=20branch=20named=20"alive"=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastlane/testflight.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastlane/testflight.md b/fastlane/testflight.md index 2e72015dd2..e763353d37 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -161,7 +161,9 @@ You do not need to fill out the next form. That is for submitting to the app sto ## 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. +TestFlight builds expire after 90 days. This process you are implementing here will update and rebuild Loop periodically, and requires that you create a branch named "alive" so that GitHub will not inactivate the scheduled rebuild if no code updates are made. + +The "alive" branch will only receive some additional commits to its history, and is not used for building the app. 1. Go to the "Code" tab of your LoopWorkspace repository. 1. Click the branch selection dropdown button, and then `View all branches`.