From 3ab2ec08a9967ab37a45e798bc8291189c83e7c3 Mon Sep 17 00:00:00 2001 From: budsterblue Date: Mon, 25 Jul 2022 18:13:33 -0500 Subject: [PATCH 01/25] Add Github Actions building with Fastlane --- .github/workflows/add_device.yml | 33 +++++ .github/workflows/build_loop.yml | 44 +++++++ .github/workflows/certs.yml | 31 +++++ .github/workflows/nuke_certs.yml | 44 +++++++ Gemfile | 3 + Gemfile.lock | 214 +++++++++++++++++++++++++++++++ fastlane/Fastfile | 127 ++++++++++++++++++ fastlane/Matchfile | 9 ++ 8 files changed, 505 insertions(+) create mode 100644 .github/workflows/add_device.yml create mode 100644 .github/workflows/build_loop.yml create mode 100644 .github/workflows/certs.yml create mode 100644 .github/workflows/nuke_certs.yml create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 fastlane/Fastfile create mode 100644 fastlane/Matchfile diff --git a/.github/workflows/add_device.yml b/.github/workflows/add_device.yml new file mode 100644 index 0000000000..baa2f8cf27 --- /dev/null +++ b/.github/workflows/add_device.yml @@ -0,0 +1,33 @@ +name: Add Device +on: + workflow_dispatch: + inputs: + deviceName: + description: 'Device Name' + required: true + deviceID: + description: 'Device ID' + required: true + +jobs: + build: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # Add device to Apple developer account + - name: Fastlane Add Device + run: fastlane add_device + env: + DEVICE_NAME: ${{ github.event.inputs.deviceName }} + DEVICE_ID: ${{ github.event.inputs.deviceID }} + FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} + FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} + FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} + FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml new file mode 100644 index 0000000000..b1e3875f19 --- /dev/null +++ b/.github/workflows/build_loop.yml @@ -0,0 +1,44 @@ +name: Build Loop +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + with: + submodules: recursive + + # 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" + + # Build signed Loop IPA file + - name: Fastlane Build & Archive + run: fastlane build_loop + env: + TEAMID: ${{ secrets.TEAMID }} + GH_PAT: ${{ secrets.GH_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" + + # Encrypt output with GPG + - name: Encrypt Artifact + run: 'gpg -c -o "Loop.ipa.gpg" --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" "Loop.ipa"' + env: + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + + + # Upload encrypted output as artifact + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: Loop + path: "Loop.ipa.gpg" diff --git a/.github/workflows/certs.yml b/.github/workflows/certs.yml new file mode 100644 index 0000000000..32d091f0a2 --- /dev/null +++ b/.github/workflows/certs.yml @@ -0,0 +1,31 @@ +name: Generate Certificates +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # 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" + + # Create or update certificates for app + - name: Fastlane Create/Update Certificates + run: fastlane certs + env: + TEAMID: ${{ secrets.TEAMID }} + GH_PAT: ${{ secrets.GH_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} + FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} + FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} + FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/.github/workflows/nuke_certs.yml b/.github/workflows/nuke_certs.yml new file mode 100644 index 0000000000..903775317a --- /dev/null +++ b/.github/workflows/nuke_certs.yml @@ -0,0 +1,44 @@ +name: Nuke Certificates +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # 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" + + # Patch Fastlane Match nuke to not print tables + - name: Patch Nuke Tables + run: find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" "/ print_tables/d" + + # Patch Fastlane Match nuke to not print other misc messages + - name: Patch Other Nuke Info + run: | + find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Deleting profile /d' + find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Certificate /d' + find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Revoking certificate /d' + find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Deleting file /d' + + # Remove all development certificates for Loop from Apple developer account + - name: Fastlane Nuke Certificates + run: fastlane nuke_certs + env: + TEAMID: ${{ secrets.TEAMID }} + GH_PAT: ${{ secrets.GH_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_USER: ${{ secrets.FASTLANE_USER }} + FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} + FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} + FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} + FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..7a118b49be --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..49abdc7acb --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,214 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.4) + rexml + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.2.0) + aws-partitions (1.516.0) + aws-sdk-core (3.121.2) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.239.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.50.0) + aws-sdk-core (~> 3, >= 3.121.2) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.104.0) + aws-sdk-core (~> 3, >= 3.121.2) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.4.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.0.3) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.6) + emoji_regex (3.2.3) + excon (0.87.0) + faraday (1.8.0) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + multipart-post (>= 1.2, < 3) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.5) + fastlane (2.196.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (~> 2.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.12.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-core (0.4.1) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.7.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-playcustomapp_v1 (0.5.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-storage_v1 (0.8.0) + google-apis-core (>= 0.4, < 2.a) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.5.0) + faraday (>= 0.17.3, < 2.0) + google-cloud-errors (1.2.0) + google-cloud-storage (1.34.1) + addressable (~> 2.5) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.0.0) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.4) + domain_name (~> 0.5) + httpclient (2.8.3) + jmespath (1.4.0) + json (2.6.0) + jwt (2.3.0) + memoist (0.16.2) + mini_magick (4.11.0) + mini_mime (1.1.2) + multi_json (1.15.0) + multipart-post (2.0.0) + nanaimo (0.3.0) + naturally (2.2.1) + optparse (0.1.1) + os (1.1.1) + plist (3.6.0) + public_suffix (4.0.6) + rake (13.0.6) + representable (3.1.1) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.5) + rouge (2.0.7) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.16.0) + addressable (~> 2.8) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.8) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + trailblazer-option (0.1.1) + tty-cursor (0.7.1) + tty-screen (0.8.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8) + unicode-display_width (1.8.0) + webrick (1.7.0) + word_wrap (1.0.0) + xcodeproj (1.21.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + x86_64-darwin-19 + +DEPENDENCIES + fastlane + +BUNDLED WITH + 2.2.22 diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000000..71ecb7b47f --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,127 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +default_platform(:ios) + +TEAMID = ENV["TEAMID"] +GH_PAT = ENV["GH_PAT"] +GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"] +GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] +FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"] +FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] +FASTLANE_KEY = ENV["FASTLANE_KEY"] +DEVICE_NAME = ENV["DEVICE_NAME"] +DEVICE_ID = ENV["DEVICE_ID"] + +platform :ios do + desc "Build Loop" + lane :build_loop do + setup_ci if ENV['CI'] + + update_project_team( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + teamid: "#{TEAMID}" + ) + + match( + type: "development", + git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), + app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch"] + ) + + mapping = Actions.lane_context[ + SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING + ] + + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop"], + targets: ["Loop"] + ) + + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop.statuswidget"], + targets: ["Loop Status Extension"] + ) + + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension"], + targets: ["WatchApp Extension"] + ) + + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch"], + targets: ["WatchApp"] + ) + + gym( + export_method: "development", + scheme: "Loop (Workspace)", + output_name: "Loop.ipa" + ) + end + desc "Create/Update Certs" + lane :certs do + setup_ci if ENV['CI'] + ENV["MATCH_READONLY"] = false.to_s + + app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) + + match( + type: "development", + force: true, + git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), + app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch"] + ) + end + desc "Nuke Certs" + lane :nuke_certs do + setup_ci if ENV['CI'] + ENV["MATCH_READONLY"] = false.to_s + + app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) + + match_nuke( + type: "development", + team_id: "#{TEAMID}", + skip_confirmation: true, + git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}") + ) + end + desc "Add Device" + lane :add_device do + setup_ci if ENV['CI'] + + app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) + + register_devices( + devices: { + "#{DEVICE_NAME}" => "#{DEVICE_ID}" + } + ) + end +end diff --git a/fastlane/Matchfile b/fastlane/Matchfile new file mode 100644 index 0000000000..5a6dff5104 --- /dev/null +++ b/fastlane/Matchfile @@ -0,0 +1,9 @@ +GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] + +git_url("https://github.com/#{GITHUB_REPOSITORY_OWNER}/Match-Secrets.git") + +storage_mode("git") + +type("development") + +# The docs are available on https://docs.fastlane.tools/actions/match From e3c4c762605e699f4a6836e529a88bf0e7ca8c15 Mon Sep 17 00:00:00 2001 From: budsterblue <32053124+budsterblue@users.noreply.github.com> Date: Tue, 26 Jul 2022 00:25:44 -0500 Subject: [PATCH 02/25] Add Loop Intent Extension to code signing --- fastlane/Fastfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 71ecb7b47f..95a67829ac 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -35,7 +35,7 @@ platform :ios do match( type: "development", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), - app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch"] + app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] ) mapping = Actions.lane_context[ @@ -66,6 +66,12 @@ platform :ios do targets: ["WatchApp"] ) + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"], + targets: ["Loop Intent Extension"] + ) + gym( export_method: "development", scheme: "Loop (Workspace)", @@ -87,7 +93,7 @@ platform :ios do type: "development", force: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), - app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch"] + app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] ) end desc "Nuke Certs" From 2829290de09bce764c741c37c909b9431cbbc18f Mon Sep 17 00:00:00 2001 From: budsterblue <32053124+budsterblue@users.noreply.github.com> Date: Sat, 26 Nov 2022 18:53:39 -0600 Subject: [PATCH 03/25] Switch to Xcode 14.1 --- .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 b1e3875f19..856154ab74 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -7,8 +7,8 @@ jobs: runs-on: macos-12 steps: # Uncomment to manually select latest Xcode if needed - #- name: Select Latest Xcode - # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + - name: Select Latest Xcode + run: "sudo xcode-select --switch /Applications/Xcode_14.1.app/Contents/Developer" # Checks-out the repo - name: Checkout Repo From b336ebf95bf38c2a0b2e3a3558fd60fa01049d5f Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 10:54:40 -0600 Subject: [PATCH 04/25] Appstore certs for testflight --- fastlane/Matchfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 5a6dff5104..571920d4c9 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -4,6 +4,6 @@ git_url("https://github.com/#{GITHUB_REPOSITORY_OWNER}/Match-Secrets.git") storage_mode("git") -type("development") +type("appstore") # The docs are available on https://docs.fastlane.tools/actions/match From d3f996149111a7af9e63378658937a3b0b10ca10 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 16:24:37 -0600 Subject: [PATCH 05/25] Update for testflight build --- fastlane/Fastfile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 95a67829ac..38e5deffa7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -31,9 +31,15 @@ platform :ios do path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", teamid: "#{TEAMID}" ) + + app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) match( - type: "development", + type: "appstore", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] ) @@ -73,11 +79,14 @@ platform :ios do ) gym( - export_method: "development", + export_method: "app-store", scheme: "Loop (Workspace)", - output_name: "Loop.ipa" + output_name: "Loop.ipa", + configuration: "Release", + destination: 'generic/platform=iOS' ) end + desc "Create/Update Certs" lane :certs do setup_ci if ENV['CI'] @@ -96,6 +105,7 @@ platform :ios do app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] ) end + desc "Nuke Certs" lane :nuke_certs do setup_ci if ENV['CI'] @@ -114,6 +124,7 @@ platform :ios do git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}") ) end + desc "Add Device" lane :add_device do setup_ci if ENV['CI'] From 0416f131d7dcd0ca1eda57918578e99d9fe318b8 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 16:29:24 -0600 Subject: [PATCH 06/25] Use appstore type on other steps --- fastlane/Fastfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 38e5deffa7..05c9f6d1b5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -99,7 +99,7 @@ platform :ios do ) match( - type: "development", + type: "appstore", force: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] @@ -118,7 +118,7 @@ platform :ios do ) match_nuke( - type: "development", + type: "appstore", team_id: "#{TEAMID}", skip_confirmation: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}") From 506dde6d254f8da1f28b294a2f32b805495e306c Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 16:35:28 -0600 Subject: [PATCH 07/25] Handle newline issue in fastlane key --- fastlane/Fastfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 05c9f6d1b5..f416a6d179 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,7 +18,9 @@ GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"] GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"] FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] -FASTLANE_KEY = ENV["FASTLANE_KEY"] +puts "ENV[FASTLANE_KEY] == #{ENV["FASTLANE_KEY"]}" +FASTLANE_KEY = ENV["FASTLANE_KEY"].gsub('\n', '\\n') +puts "FASTLANE_KEY == #{FASTLANE_KEY}" DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] From af7fda959bde16715447edc46b3d80ca7b4007f0 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 20:56:04 -0600 Subject: [PATCH 08/25] Update prints --- fastlane/Fastfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f416a6d179..e90d94c97a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,9 +18,10 @@ GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"] GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"] FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] -puts "ENV[FASTLANE_KEY] == #{ENV["FASTLANE_KEY"]}" -FASTLANE_KEY = ENV["FASTLANE_KEY"].gsub('\n', '\\n') -puts "FASTLANE_KEY == #{FASTLANE_KEY}" +FASTLANE_KEY = ENV["FASTLANE_KEY"] +puts "FASTLANE_KEY = #{FASTLANE_KEY}" +FASTLANE_KEY = FASTLANE_KEY.gsub('\n', '\\n') +puts "FASTLANE_KEY gsub = #{FASTLANE_KEY}" DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] From a880525f8523c6b8e9205553070c6a586e0f5991 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 21:02:41 -0600 Subject: [PATCH 09/25] Update prints --- fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e90d94c97a..72e089210f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,6 +18,7 @@ GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"] GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"] FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] +puts "FASTLANE_ISSUER_ID = #{FASTLANE_ISSUER_ID}" FASTLANE_KEY = ENV["FASTLANE_KEY"] puts "FASTLANE_KEY = #{FASTLANE_KEY}" FASTLANE_KEY = FASTLANE_KEY.gsub('\n', '\\n') From 4d8736e75a1ecbd675ca35e98cd0beab5a8888e8 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 21:17:21 -0600 Subject: [PATCH 10/25] Update prints --- .github/workflows/build_loop.yml | 3 +++ fastlane/Fastfile | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 856154ab74..043548c782 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -26,6 +26,9 @@ jobs: 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 }} FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 72e089210f..d1414d8b1a 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -21,8 +21,8 @@ FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] puts "FASTLANE_ISSUER_ID = #{FASTLANE_ISSUER_ID}" FASTLANE_KEY = ENV["FASTLANE_KEY"] puts "FASTLANE_KEY = #{FASTLANE_KEY}" -FASTLANE_KEY = FASTLANE_KEY.gsub('\n', '\\n') -puts "FASTLANE_KEY gsub = #{FASTLANE_KEY}" +# FASTLANE_KEY = FASTLANE_KEY.gsub('\n', '\\n') +# puts "FASTLANE_KEY gsub = #{FASTLANE_KEY}" DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] From adcee3a8b5e33d8e98c06a4fe33dd1a1a17b1a22 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 21:51:17 -0600 Subject: [PATCH 11/25] Update code_sign_identity for distribution --- fastlane/Fastfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d1414d8b1a..53490773e3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -55,30 +55,35 @@ platform :ios do update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop"], + code_sign_identity: "iPhone Distribution", targets: ["Loop"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop.statuswidget"], + code_sign_identity: "iPhone Distribution", targets: ["Loop Status Extension"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension"], + code_sign_identity: "iPhone Distribution", targets: ["WatchApp Extension"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop.LoopWatch"], + code_sign_identity: "iPhone Distribution", targets: ["WatchApp"] ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"], + code_sign_identity: "iPhone Distribution", targets: ["Loop Intent Extension"] ) From ea58426b19535b560327dfa66dc3c5af89df1516 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Sun, 11 Dec 2022 22:47:44 -0600 Subject: [PATCH 12/25] Up timeout, and force identity for gym --- fastlane/Fastfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 53490773e3..ffc759c53d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -25,6 +25,7 @@ puts "FASTLANE_KEY = #{FASTLANE_KEY}" # puts "FASTLANE_KEY gsub = #{FASTLANE_KEY}" DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] +ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" platform :ios do desc "Build Loop" @@ -92,6 +93,7 @@ platform :ios do scheme: "Loop (Workspace)", output_name: "Loop.ipa", configuration: "Release", + codesigning_identity: "iPhone Distribution", destination: 'generic/platform=iOS' ) end From 80dfb8795e57937e22d28487bb4488997af5aa1d Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 12:57:36 -0600 Subject: [PATCH 13/25] Remove toplevel codesigning identity as it was trying to sign all frameworks --- Gemfile.lock | 3 ++- fastlane/Fastfile | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 49abdc7acb..95b509e742 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -205,10 +205,11 @@ GEM xcpretty (~> 0.2, >= 0.0.7) PLATFORMS + arm64-darwin-21 x86_64-darwin-19 DEPENDENCIES fastlane BUNDLED WITH - 2.2.22 + 2.3.26 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index ffc759c53d..7bce7bb29f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -93,7 +93,6 @@ platform :ios do scheme: "Loop (Workspace)", output_name: "Loop.ipa", configuration: "Release", - codesigning_identity: "iPhone Distribution", destination: 'generic/platform=iOS' ) end From 044404f3f9cccaf287d4fd5d1911467e723c86cc Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 13:04:50 -0600 Subject: [PATCH 14/25] Add small status widget extension --- fastlane/Fastfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7bce7bb29f..9d421da1f5 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -88,6 +88,13 @@ platform :ios do targets: ["Loop Intent Extension"] ) + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + profile_name: mapping["com.#{TEAMID}.loopkit.Loop.SmallStatusWidget"], + code_sign_identity: "iPhone Distribution", + targets: ["SmallStatusWidgetExtension"] + ) + gym( export_method: "app-store", scheme: "Loop (Workspace)", From 80118ac7b3ebb00cfb971da5def3b90cf1e3e69c Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 13:06:05 -0600 Subject: [PATCH 15/25] Add small status widget extension --- fastlane/Fastfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9d421da1f5..c3ad18e6f2 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -46,7 +46,14 @@ platform :ios do match( type: "appstore", git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), - app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] + app_identifier: [ + "com.#{TEAMID}.loopkit.Loop", + "com.#{TEAMID}.loopkit.Loop.statuswidget", + "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", + "com.#{TEAMID}.loopkit.Loop.LoopWatch", + "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", + "com.#{TEAMID}.loopkit.Loop.SmallStatusWidget" + ] ) mapping = Actions.lane_context[ From f19de1b4da5aca67eba44a4378e1ffdfc162ce12 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 13:36:24 -0600 Subject: [PATCH 16/25] Add small status widget extension --- fastlane/Fastfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index c3ad18e6f2..2aa5c8c305 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -126,7 +126,14 @@ platform :ios do type: "appstore", force: true, git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"), - app_identifier: ["com.#{TEAMID}.loopkit.Loop", "com.#{TEAMID}.loopkit.Loop.statuswidget", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", "com.#{TEAMID}.loopkit.Loop.LoopWatch", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension"] + app_identifier: [ + "com.#{TEAMID}.loopkit.Loop", + "com.#{TEAMID}.loopkit.Loop.statuswidget", + "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", + "com.#{TEAMID}.loopkit.Loop.LoopWatch", + "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", + "com.#{TEAMID}.loopkit.Loop.SmallStatusWidget", + ] ) end From a8b899ce393da5d231650e53ba87cfe88dadb3a3 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 16:40:55 -0600 Subject: [PATCH 17/25] Upload to testflight --- fastlane/Fastfile | 40 +++++++++++++++++++++++++++++++++++----- fastlane/Matchfile | 2 +- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2aa5c8c305..7bbcc6bd7c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,11 +18,7 @@ GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"] GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"] FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"] -puts "FASTLANE_ISSUER_ID = #{FASTLANE_ISSUER_ID}" FASTLANE_KEY = ENV["FASTLANE_KEY"] -puts "FASTLANE_KEY = #{FASTLANE_KEY}" -# FASTLANE_KEY = FASTLANE_KEY.gsub('\n', '\\n') -# puts "FASTLANE_KEY gsub = #{FASTLANE_KEY}" DEVICE_NAME = ENV["DEVICE_NAME"] DEVICE_ID = ENV["DEVICE_ID"] ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" @@ -37,11 +33,23 @@ platform :ios do teamid: "#{TEAMID}" ) - app_store_connect_api_key( + api_key = app_store_connect_api_key( key_id: "#{FASTLANE_KEY_ID}", issuer_id: "#{FASTLANE_ISSUER_ID}", key_content: "#{FASTLANE_KEY}" ) + + previous_build_number = latest_testflight_build_number( + app_identifier: "com.#{TEAMID}.loopkit.Loop", + api_key: api_key, + ) + + current_build_number = previous_build_number + 1 + + increment_build_number( + xcodeproj: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + build_number: current_build_number + ) match( type: "appstore", @@ -66,6 +74,12 @@ platform :ios do code_sign_identity: "iPhone Distribution", targets: ["Loop"] ) + + update_code_signing_settings( + path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + code_sign_identity: "iPhone Distribution", + targets: ["LoopCore", "LoopCore-watchOS", "LoopUI"] + ) update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", @@ -111,6 +125,22 @@ platform :ios do ) end + desc "Push to TestFlight" + lane :release do + api_key = app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) + + upload_to_testflight( + api_key: api_key, + skip_submission: false, + ipa: "Loop.ipa", + skip_waiting_for_build_processing: true, + ) + end + desc "Create/Update Certs" lane :certs do setup_ci if ENV['CI'] diff --git a/fastlane/Matchfile b/fastlane/Matchfile index 571920d4c9..fd7d086b12 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -1,4 +1,4 @@ -GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"] +GITHUB_REPOSITORY_OWNER ||= ENV["GITHUB_REPOSITORY_OWNER"] git_url("https://github.com/#{GITHUB_REPOSITORY_OWNER}/Match-Secrets.git") From ce04acff703b194f60bba5edab9dd8309112f589 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 16:42:56 -0600 Subject: [PATCH 18/25] Update G7 --- G7SensorKit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G7SensorKit b/G7SensorKit index 11d9ce9fd5..27c84efbdf 160000 --- a/G7SensorKit +++ b/G7SensorKit @@ -1 +1 @@ -Subproject commit 11d9ce9fd5daa6bf311e7dfb8a7e34e7e3ea7bc5 +Subproject commit 27c84efbdf3a4aa99431e89ef96fdcfa6ad99e53 From c6e13824f498f8fd85fde706a9523fb161c43912 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 17:04:22 -0600 Subject: [PATCH 19/25] Update github action to publish to testflight --- .github/workflows/build_loop.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_loop.yml b/.github/workflows/build_loop.yml index 043548c782..781f4e6850 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -30,18 +30,14 @@ jobs: FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" - - # Encrypt output with GPG - - name: Encrypt Artifact - run: 'gpg -c -o "Loop.ipa.gpg" --pinentry-mode=loopback --passphrase "$GPG_PASSWORD" "Loop.ipa"' - env: - GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - # Upload encrypted output as artifact - - name: Upload Artifact - uses: actions/upload-artifact@v2 - with: - name: Loop - path: "Loop.ipa.gpg" + - name: Fastlane Build & Archive + 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 }} From 2bfc3fc3f4c318e4174ed21399c171c453db6f22 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 17:06:35 -0600 Subject: [PATCH 20/25] Remove unused actions --- .github/workflows/add_device.yml | 33 ------------------------ .github/workflows/certs.yml | 31 ---------------------- .github/workflows/nuke_certs.yml | 44 -------------------------------- 3 files changed, 108 deletions(-) delete mode 100644 .github/workflows/add_device.yml delete mode 100644 .github/workflows/certs.yml delete mode 100644 .github/workflows/nuke_certs.yml diff --git a/.github/workflows/add_device.yml b/.github/workflows/add_device.yml deleted file mode 100644 index baa2f8cf27..0000000000 --- a/.github/workflows/add_device.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Add Device -on: - workflow_dispatch: - inputs: - deviceName: - description: 'Device Name' - required: true - deviceID: - description: 'Device ID' - required: true - -jobs: - build: - runs-on: macos-12 - steps: - # Uncomment to manually select latest Xcode if needed - #- name: Select Latest Xcode - # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" - - # Checks-out the repo - - name: Checkout Repo - uses: actions/checkout@v2 - - # Add device to Apple developer account - - name: Fastlane Add Device - run: fastlane add_device - env: - DEVICE_NAME: ${{ github.event.inputs.deviceName }} - DEVICE_ID: ${{ github.event.inputs.deviceID }} - FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} - FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} - FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} - FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/.github/workflows/certs.yml b/.github/workflows/certs.yml deleted file mode 100644 index 32d091f0a2..0000000000 --- a/.github/workflows/certs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Generate Certificates -on: - workflow_dispatch: - -jobs: - build: - runs-on: macos-12 - steps: - # Uncomment to manually select latest Xcode if needed - #- name: Select Latest Xcode - # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" - - # Checks-out the repo - - name: Checkout Repo - uses: actions/checkout@v2 - - # 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" - - # Create or update certificates for app - - name: Fastlane Create/Update Certificates - run: fastlane certs - env: - TEAMID: ${{ secrets.TEAMID }} - GH_PAT: ${{ secrets.GH_PAT }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} - FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} - FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} - FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" diff --git a/.github/workflows/nuke_certs.yml b/.github/workflows/nuke_certs.yml deleted file mode 100644 index 903775317a..0000000000 --- a/.github/workflows/nuke_certs.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Nuke Certificates -on: - workflow_dispatch: - -jobs: - build: - runs-on: macos-12 - steps: - # Uncomment to manually select latest Xcode if needed - #- name: Select Latest Xcode - # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" - - # Checks-out the repo - - name: Checkout Repo - uses: actions/checkout@v2 - - # 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" - - # Patch Fastlane Match nuke to not print tables - - name: Patch Nuke Tables - run: find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" "/ print_tables/d" - - # Patch Fastlane Match nuke to not print other misc messages - - name: Patch Other Nuke Info - run: | - find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Deleting profile /d' - find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Certificate /d' - find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Revoking certificate /d' - find /usr/local/lib/ruby/gems -name nuke.rb | xargs sed -i "" '/UI.message("Deleting file /d' - - # Remove all development certificates for Loop from Apple developer account - - name: Fastlane Nuke Certificates - run: fastlane nuke_certs - env: - TEAMID: ${{ secrets.TEAMID }} - GH_PAT: ${{ secrets.GH_PAT }} - MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} - FASTLANE_USER: ${{ secrets.FASTLANE_USER }} - FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} - FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} - FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} - FASTLANE_SKIP_ALL_LANE_SUMMARIES: "true" From 7f8d3d1b224bbd682884fab5101897cfa5a984a2 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 17:53:25 -0600 Subject: [PATCH 21/25] Better name for upload action --- .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 781f4e6850..1afc8a9077 100644 --- a/.github/workflows/build_loop.yml +++ b/.github/workflows/build_loop.yml @@ -32,7 +32,7 @@ jobs: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} # Upload encrypted output as artifact - - name: Fastlane Build & Archive + - name: Fastlane upload to TestFlight run: fastlane release env: TEAMID: ${{ secrets.TEAMID }} From 8987bcabfa6a379964a5d1a826d5d48ce980bc1b Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 22:25:47 -0600 Subject: [PATCH 22/25] Adding docs --- fastlane/testflight.md | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 fastlane/testflight.md diff --git a/fastlane/testflight.md b/fastlane/testflight.md new file mode 100644 index 0000000000..f36ea0d9ca --- /dev/null +++ b/fastlane/testflight.md @@ -0,0 +1,47 @@ +# Using Github Actions + FastLane to deploy to TestFlight + +These instructions allow you to build Loop without having access to a Mac. They also allow you to easily install Loop on phones that are not connected to your computer. So you can send builds and updates to those you care for easily, or have an easy to access backup if you run Loop for yourself. You do not need to worry about correct Xcode/Mac versions either. An app built using this method can easily be deployed to newer versions of iOS, as soon as they are available. + +## Prerequisites. + +You don't need much! + +* A github account. The free level comes with plenty of storage and free compute time to build loop, multiple times a week, if you wanted to. +* A paid Apple Developer account. You may be able to use the free version, but that has not been tested. + + +## Apple Developer Steps + +1. Sign in to the [Apple developer portal page](https://developer.apple.com/account/resources/certificates/list) +1. Copy the team id from the upper right of the screen. This will be your `TEAMID` +1. Go to the [App Store Connect](https://appstoreconnect.apple.com/access/api) interface, click the "Keys" tab, and create a new key with "Admin" access. +1. Copy the key id; this will be used for `FASTLANE_KEY_ID` +1. Copy the issuer id; this will be used for `FASTLANE_ISSUER_ID` +1. Download the API key itself, and open it in an editor. The contents of this file will be used for `FASTLANE_KEY` + +## GitHub Configuration Steps + +1. Create a new empty repository titled `Match-Secrets` +1. Fork https://github.com/LoopKit/LoopWorkspace into your account. +1. Create a [new personal access token](https://github.com/settings/tokens/new) + * Enter a name for your token. Something like "FastLane Access Token". + * 30 days is fine, or you can select longer if you'd like. + * 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 LoopWorkspace 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 recorded above: + * `TEAMID` + * `FASTLANE_KEY_ID` + * `FASTLANE_ISSUER_ID` + * `FASTLANE_KEY` + * `GH_PAT` + * `MATCH_PASSWORD` - just make up a password for this + +## Build Loop! + +1. Click on the "Actions" tab of your LoopWorkspace repository. +1. Select "Build Loop" +1. Click "Run Workflow", select your branch, and tap the green button. +1. Wait, and your app should eventually appear on [App Store Connect](https://appstoreconnect.apple.com/apps) +1. For each phone/person you would like to support Loop on, send an invite to using the TestFlight \ No newline at end of file From ed0e5279f1de213014f98d103c87b4c573f58bd1 Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Dec 2022 23:38:04 -0600 Subject: [PATCH 23/25] Updates --- .github/workflows/create_certs.yml | 30 +++++++++++++++++++++++++ fastlane/Fastfile | 17 -------------- fastlane/testflight.md | 36 +++++++++++++++++++++--------- 3 files changed, 55 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/create_certs.yml diff --git a/.github/workflows/create_certs.yml b/.github/workflows/create_certs.yml new file mode 100644 index 0000000000..4c81119403 --- /dev/null +++ b/.github/workflows/create_certs.yml @@ -0,0 +1,30 @@ +name: Generate Certificates +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # 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" + + # Create or update certificates for app + - name: Fastlane Create/Update Certificates + run: fastlane certs + env: + TEAMID: ${{ secrets.TEAMID }} + GH_PAT: ${{ secrets.GH_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} + FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} + FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7bbcc6bd7c..17a1bc97ce 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -185,21 +185,4 @@ platform :ios do git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}") ) end - - desc "Add Device" - lane :add_device do - setup_ci if ENV['CI'] - - app_store_connect_api_key( - key_id: "#{FASTLANE_KEY_ID}", - issuer_id: "#{FASTLANE_ISSUER_ID}", - key_content: "#{FASTLANE_KEY}" - ) - - register_devices( - devices: { - "#{DEVICE_NAME}" => "#{DEVICE_ID}" - } - ) - end end diff --git a/fastlane/testflight.md b/fastlane/testflight.md index f36ea0d9ca..6539a4f88f 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -13,24 +13,38 @@ You don't need much! ## Apple Developer Steps 1. Sign in to the [Apple developer portal page](https://developer.apple.com/account/resources/certificates/list) -1. Copy the team id from the upper right of the screen. This will be your `TEAMID` -1. Go to the [App Store Connect](https://appstoreconnect.apple.com/access/api) interface, click the "Keys" tab, and create a new key with "Admin" access. -1. Copy the key id; this will be used for `FASTLANE_KEY_ID` -1. Copy the issuer id; this will be used for `FASTLANE_ISSUER_ID` -1. Download the API key itself, and open it in an editor. The contents of this file will be used for `FASTLANE_KEY` +1. Copy the team id from the upper right of the screen. Record this as your `TEAMID` +1. Go to the [App Store Connect](https://appstoreconnect.apple.com/access/api) interface, click the "Keys" tab, and create a new key with "Admin" access. Give it a name like "FastLane API Key" +1. Record the key id; this will be used for `FASTLANE_KEY_ID` +1. Record the issuer id; this will be used for `FASTLANE_ISSUER_ID` +1. Download the API key itself, and open it in a text editor. The contents of this file will be used for `FASTLANE_KEY` +1. At the [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/bundleId/add/bundle) page, add a new app identifier. + * Description: Loop + * The Bundle ID will be explicit and in the form `com.TEAMID.loopkit.Loop`, where `TEAMID` is your the value you recorded above. + * For capabilities, check "App Groups, "HealthKit", "SiriKit", and "Time Sensitive Notifications" + * Then click "Continue", and "Register". +1. Go to the [apps list](https://appstoreconnect.apple.com/apps) on App Store Connect and create a New App. + * Select "iOS" + * Select a name: this will have to be unique, so you may have to try a few different names here, but it will not be the name you see on your phone, so it's not that important. + * Select your primary language + * Select the Bundle Id you created above. + * SKU can be anything; e.g. "123" + * Select "Full Access" + * Click Create + * You do not need to fill out the next form. That is for submitting to the app store. ## GitHub Configuration Steps 1. Create a new empty repository titled `Match-Secrets` 1. Fork https://github.com/LoopKit/LoopWorkspace into your account. 1. Create a [new personal access token](https://github.com/settings/tokens/new) - * Enter a name for your token. Something like "FastLane Access Token". - * 30 days is fine, or you can select longer if you'd like. - * Select the `repo` permission scope. - * Click "Generate token" - * Copy the token and record it. It will be used below as `GH_PAT` + * Enter a name for your token. Something like "FastLane Access Token". + * 30 days is fine, or you can select longer if you'd like. + * 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 LoopWorkspace 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 recorded above: +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` From 2b15d2f9668cb454896a4a00fed97e501deefaba Mon Sep 17 00:00:00 2001 From: ps2builder <120440767+ps2builder@users.noreply.github.com> Date: Tue, 13 Dec 2022 16:50:27 -0600 Subject: [PATCH 24/25] Updates from testing (#1) Updates from testing --- .github/workflows/add_identifiers.yml | 30 +++++++ .github/workflows/create_certs.yml | 6 +- fastlane/Fastfile | 66 ++++++++++++++- fastlane/Matchfile | 1 + fastlane/testflight.md | 115 ++++++++++++++++++-------- 5 files changed, 178 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/add_identifiers.yml diff --git a/.github/workflows/add_identifiers.yml b/.github/workflows/add_identifiers.yml new file mode 100644 index 0000000000..a20b3cb249 --- /dev/null +++ b/.github/workflows/add_identifiers.yml @@ -0,0 +1,30 @@ +name: Add Identifiers +on: + workflow_dispatch: + +jobs: + identifiers: + runs-on: macos-12 + steps: + # Uncomment to manually select latest Xcode if needed + #- name: Select Latest Xcode + # run: "sudo xcode-select --switch /Applications/Xcode_13.0.app/Contents/Developer" + + # Checks-out the repo + - name: Checkout Repo + uses: actions/checkout@v2 + + # 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" + + # Create or update identifiers for app + - name: Fastlane Provision + run: fastlane identifiers + env: + TEAMID: ${{ secrets.TEAMID }} + GH_PAT: ${{ secrets.GH_PAT }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + FASTLANE_KEY_ID: ${{ secrets.FASTLANE_KEY_ID }} + FASTLANE_ISSUER_ID: ${{ secrets.FASTLANE_ISSUER_ID }} + FASTLANE_KEY: ${{ secrets.FASTLANE_KEY }} diff --git a/.github/workflows/create_certs.yml b/.github/workflows/create_certs.yml index 4c81119403..235fd967fd 100644 --- a/.github/workflows/create_certs.yml +++ b/.github/workflows/create_certs.yml @@ -1,9 +1,9 @@ -name: Generate Certificates +name: Create Certificates on: workflow_dispatch: jobs: - build: + certificates: runs-on: macos-12 steps: # Uncomment to manually select latest Xcode if needed @@ -19,7 +19,7 @@ jobs: run: find /usr/local/lib/ruby/gems -name table_printer.rb | xargs sed -i "" "/puts(Terminal::Table.new(params))/d" # Create or update certificates for app - - name: Fastlane Create/Update Certificates + - name: Create Certificates run: fastlane certs env: TEAMID: ${{ secrets.TEAMID }} diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 17a1bc97ce..a036301e5c 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -63,11 +63,23 @@ platform :ios do "com.#{TEAMID}.loopkit.Loop.SmallStatusWidget" ] ) + + previous_build_number = latest_testflight_build_number( + app_identifier: "com.#{TEAMID}.loopkit.Loop", + api_key: api_key, + ) + + current_build_number = previous_build_number + 1 + + increment_build_number( + xcodeproj: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", + build_number: current_build_number + ) mapping = Actions.lane_context[ SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING ] - + update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop"], @@ -80,7 +92,7 @@ platform :ios do code_sign_identity: "iPhone Distribution", targets: ["LoopCore", "LoopCore-watchOS", "LoopUI"] ) - + update_code_signing_settings( path: "#{GITHUB_WORKSPACE}/Loop/Loop.xcodeproj", profile_name: mapping["com.#{TEAMID}.loopkit.Loop.statuswidget"], @@ -140,8 +152,54 @@ platform :ios do skip_waiting_for_build_processing: true, ) end - - desc "Create/Update Certs" + + desc "Provision Identifiers and Certificates" + lane :identifiers do + setup_ci if ENV['CI'] + ENV["MATCH_READONLY"] = false.to_s + + app_store_connect_api_key( + key_id: "#{FASTLANE_KEY_ID}", + issuer_id: "#{FASTLANE_ISSUER_ID}", + key_content: "#{FASTLANE_KEY}" + ) + + def configure_bundle_id(name, identifier, capabilities) + bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier) || Spaceship::ConnectAPI::BundleId.create(name: name, identifier: identifier) + capabilities.each { |capability| + bundle_id.create_capability(capability) + } + end + + configure_bundle_id("Loop", "com.#{TEAMID}.loopkit.Loop", [ + Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS, + Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT, + Spaceship::ConnectAPI::BundleIdCapability::Type::PUSH_NOTIFICATIONS, + Spaceship::ConnectAPI::BundleIdCapability::Type::SIRIKIT + ]) + + configure_bundle_id("Loop Intent Extension", "com.#{TEAMID}.loopkit.Loop.Loop-Intent-Extension", [ + Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS + ]) + + configure_bundle_id("Loop Status Extension", "com.#{TEAMID}.loopkit.Loop.statuswidget", [ + Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS + ]) + + configure_bundle_id("WatchApp", "com.#{TEAMID}.loopkit.Loop.LoopWatch", []) + + configure_bundle_id("WatchApp Extension", "com.#{TEAMID}.loopkit.Loop.LoopWatch.watchkitextension", [ + Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT, + Spaceship::ConnectAPI::BundleIdCapability::Type::SIRIKIT + ]) + + configure_bundle_id("Small Status Widget", "com.#{TEAMID}.loopkit.Loop.SmallStatusWidget", [ + Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS + ]) + + end + + desc "Provision Certificates" lane :certs do setup_ci if ENV['CI'] ENV["MATCH_READONLY"] = false.to_s diff --git a/fastlane/Matchfile b/fastlane/Matchfile index fd7d086b12..0892d1d54b 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -1,3 +1,4 @@ + GITHUB_REPOSITORY_OWNER ||= ENV["GITHUB_REPOSITORY_OWNER"] git_url("https://github.com/#{GITHUB_REPOSITORY_OWNER}/Match-Secrets.git") diff --git a/fastlane/testflight.md b/fastlane/testflight.md index 6539a4f88f..e9b79573af 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -2,15 +2,18 @@ These instructions allow you to build Loop without having access to a Mac. They also allow you to easily install Loop on phones that are not connected to your computer. So you can send builds and updates to those you care for easily, or have an easy to access backup if you run Loop for yourself. You do not need to worry about correct Xcode/Mac versions either. An app built using this method can easily be deployed to newer versions of iOS, as soon as they are available. +The setup steps are somewhat involved, but nearly all are one time steps. Subsequent builds are trivial. + ## Prerequisites. You don't need much! -* A github account. The free level comes with plenty of storage and free compute time to build loop, multiple times a week, if you wanted to. -* A paid Apple Developer account. You may be able to use the free version, but that has not been tested. +* A [github account](https://github.com/signup). The free level comes with plenty of storage and free compute time to build loop, multiple times a week, if you wanted to. +* A paid [Apple Developer account](https://developer.apple.com). You may be able to use the free version, but that has not been tested. +* Some time. Set aside a couple of hours to perform the setup. -## Apple Developer Steps +## Generate App Store Connect API Key 1. Sign in to the [Apple developer portal page](https://developer.apple.com/account/resources/certificates/list) 1. Copy the team id from the upper right of the screen. Record this as your `TEAMID` @@ -18,44 +21,90 @@ You don't need much! 1. Record the key id; this will be used for `FASTLANE_KEY_ID` 1. Record the issuer id; this will be used for `FASTLANE_ISSUER_ID` 1. Download the API key itself, and open it in a text editor. The contents of this file will be used for `FASTLANE_KEY` -1. At the [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/bundleId/add/bundle) page, add a new app identifier. - * Description: Loop - * The Bundle ID will be explicit and in the form `com.TEAMID.loopkit.Loop`, where `TEAMID` is your the value you recorded above. - * For capabilities, check "App Groups, "HealthKit", "SiriKit", and "Time Sensitive Notifications" - * Then click "Continue", and "Register". -1. Go to the [apps list](https://appstoreconnect.apple.com/apps) on App Store Connect and create a New App. - * Select "iOS" - * Select a name: this will have to be unique, so you may have to try a few different names here, but it will not be the name you see on your phone, so it's not that important. - * Select your primary language - * Select the Bundle Id you created above. - * SKU can be anything; e.g. "123" - * Select "Full Access" - * Click Create - * You do not need to fill out the next form. That is for submitting to the app store. - -## GitHub Configuration Steps +## Setup Github 1. Create a new empty repository titled `Match-Secrets` 1. Fork https://github.com/LoopKit/LoopWorkspace into your account. -1. Create a [new personal access token](https://github.com/settings/tokens/new) - * Enter a name for your token. Something like "FastLane Access Token". - * 30 days is fine, or you can select longer if you'd like. - * Select the `repo` permission scope. - * Click "Generate token" - * Copy the token and record it. It will be used below as `GH_PAT` +1. Create a [new personal access token](https://github.com/settings/tokens/new): + * Enter a name for your token. Something like "FastLane Access Token". + * 30 days is fine, or you can select longer if you'd like. + * 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 LoopWorkspace 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 + * `TEAMID` + * `FASTLANE_KEY_ID` + * `FASTLANE_ISSUER_ID` + * `FASTLANE_KEY` + * `GH_PAT` + * `MATCH_PASSWORD` - just make up a password for this + +## Add Identifiers for Loop App + +1. Click on the "Actions" tab of your LoopWorkspace repository. +1. Select "Add Identifiers" +1. Click "Run Workflow", and tap the green button. +1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded. + +## Create App Group + +1. Go to [Register an App Group](https://developer.apple.com/account/resources/identifiers/applicationGroup/add/) on the apple developer site. +1. For Description, use "Loop App Group" +1. For Identifier, enter "group.com.TEAMID.loopkit.LoopGroup", subsituting your team id for `TEAMID` +1. Click "Continue" and then "Register" + +## Add App Group to Bundle Identifiers + +1. Go to [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) on the apple developer site. +1. For each of the following identifiers: + * Loop + * Loop Intent Extension + * Loop Status Extension + * Small Status Widget +1. Click on the identifier's name. +1. On the "App Groups" capabilies, click on the "Configure" button. +1. Select the "Loop App Group" +1. Click "Continue". +1. Click "Save". +1. Click "Confirm". +1. Remember to do this for each of the identifiers above. + +## Add Time Sensitive Notifications to Loop App ID +1. Go to [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) on the apple developer site. +1. Click on the "Loop" identifier +1. Scroll down to "Time Sensitive Notifications" +1. Tap the check box to enable Time Sensitive Notifications. +1. Click "Save". +1. Click "Confirm". +1. Remember to do this for each of the identifiers above. + +## Create Loop App in App Store Connect + +1. Go to the [apps list](https://appstoreconnect.apple.com/apps) on App Store Connect and click the blue "plus" icon to create a New App. + * Select "iOS" + * Select a name: this will have to be unique, so you may have to try a few different names here, but it will not be the name you see on your phone, so it's not that important. + * Select your primary language + * Choose the bundle ID that matches `com.TEAMID.loopkit.Loop`, with TEAMID matching your team id. + * SKU can be anything; e.g. "123" + * Select "Full Access" + * Click Create + * You do not need to fill out the next form. That is for submitting to the app store. + +## Create Building Certficates + +1. Go back to the "Actions" tab of your LoopWorkspace repository in github. +1. Select "Create Certificates" +1. Click "Run Workflow", and tap the green button. +1. Wait, and within a minute or two you should see a green checkmark indicating the workflow succeeded. ## Build Loop! 1. Click on the "Actions" tab of your LoopWorkspace repository. 1. Select "Build Loop" 1. Click "Run Workflow", select your branch, and tap the green button. -1. Wait, and your app should eventually appear on [App Store Connect](https://appstoreconnect.apple.com/apps) -1. For each phone/person you would like to support Loop on, send an invite to using the TestFlight \ No newline at end of file +1. You have some time now. Go enjoy a coffee. The build should take about 20-30 minutes. +1. Your app should eventually appear on [App Store Connect](https://appstoreconnect.apple.com/apps) +1. For each phone/person you would like to support Loop on + * Add them in [Users and Access](https://appstoreconnect.apple.com/access/users) on App Store Connect + * Add them to your TestFlight Internal Testing group. From 37ddc159ccf0f23908cf90f87d34caf0b301749e Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Wed, 14 Dec 2022 09:39:43 -0600 Subject: [PATCH 25/25] Update testflight.md --- fastlane/testflight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/testflight.md b/fastlane/testflight.md index e9b79573af..b21495b246 100644 --- a/fastlane/testflight.md +++ b/fastlane/testflight.md @@ -8,7 +8,7 @@ The setup steps are somewhat involved, but nearly all are one time steps. Subseq You don't need much! -* A [github account](https://github.com/signup). The free level comes with plenty of storage and free compute time to build loop, multiple times a week, if you wanted to. +* A [github account](https://github.com/signup). The free level comes with plenty of storage and free compute time to build loop, multiple times a day, if you wanted to. * A paid [Apple Developer account](https://developer.apple.com). You may be able to use the free version, but that has not been tested. * Some time. Set aside a couple of hours to perform the setup.