From 8717ecee777faeb4b83e1e5c3d87b597003983aa Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 16:03:43 +0200 Subject: [PATCH 01/28] Add a DuckDuckGo-Alpha scheme --- .../xcschemes/DuckDuckGo-Alpha.xcscheme | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGo-Alpha.xcscheme diff --git a/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGo-Alpha.xcscheme b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGo-Alpha.xcscheme new file mode 100644 index 0000000000..ab41c0e9a0 --- /dev/null +++ b/DuckDuckGo.xcodeproj/xcshareddata/xcschemes/DuckDuckGo-Alpha.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9dcc9411c8cd69455a0fe54a0c27481e0b4755aa Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 16:12:51 +0200 Subject: [PATCH 02/28] Create alphaExportOptions.plist --- alphaExportOptions.plist | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 alphaExportOptions.plist diff --git a/alphaExportOptions.plist b/alphaExportOptions.plist new file mode 100644 index 0000000000..9f949f40ac --- /dev/null +++ b/alphaExportOptions.plist @@ -0,0 +1,23 @@ + + + + + teamID + HKE973VLUW + method + app-store + provisioningProfiles + + com.duckduckgo.mobile.ios.alpha + match AppStore com.duckduckgo.mobile.ios.alpha + com.duckduckgo.mobile.ios.alpha.ShareExtension + match AppStore com.duckduckgo.mobile.ios.alpha.ShareExtension + com.duckduckgo.mobile.ios.alpha.OpenAction2 + match AppStore com.duckduckgo.mobile.ios.alpha.OpenAction2 + com.duckduckgo.mobile.ios.alpha.Widgets + match AppStore com.duckduckgo.mobile.ios.alpha.Widgets + com.duckduckgo.mobile.ios.alpha.NetworkExtension + match AppStore com.duckduckgo.mobile.ios.alpha.NetworkExtension + + + From 11abc9af0c3fc7e47c01b79b1c99ac337d404c60 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 16:17:42 +0200 Subject: [PATCH 03/28] Adds build_alpha to Fastfile --- fastlane/Fastfile | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index be82b0b85f..43859f0944 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,6 +18,7 @@ lane :sync_signing_adhoc do |options| do_sync_signing(options) end +desc 'Fetches and updates certificates and provisioning profiles for Alpha distribution' lane :sync_signing_alpha do |options| do_sync_signing(options) end @@ -88,11 +89,6 @@ lane :adhoc do |options| end end -desc 'Makes Alpha release build and uploads it to App Store Connect (TestFlight)' -lane :alpha do |options| -# TODO -end - desc 'Makes App Store release build and uploads it to App Store Connect' lane :release_appstore do |options| build_release(options) @@ -132,6 +128,16 @@ lane :release_testflight do ) end +desc 'Makes Alpha release build and uploads it to TestFlight' +lane :release_alpha do |options| + build_alpha(options) + + upload_to_testflight( + api_key: get_api_key, + groups: options[:groups] + ) +end + desc 'Increment build number based on version in App Store Connect' lane :increment_build_number_for_version do |options| increment_build_number({ @@ -172,6 +178,18 @@ private_lane :build_release do |options| ) end +private_lane :build_alpha do |options| + sync_signing_alpha(options) + + build_app( + export_method: "app-store", + configuration: "Alpha", + scheme: "DuckDuckGo-Alpha", + export_options: "alphaExportOptions.plist", + derived_data_path: "DerivedData" + ) +end + private_lane :get_api_key do has_api_key = [ "APPLE_API_KEY_ID", @@ -209,7 +227,7 @@ private_lane :do_sync_signing do |options| sync_code_signing( api_key: get_api_key, username: get_username(options), - readonly: is_ci && !is_adhoc + readonly: is_ci && !is_adhoc ) end From 2bd566a7a83c7e62ab4f37e9435ab0e80d4e6b34 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 16:18:12 +0200 Subject: [PATCH 04/28] Update Matchfile to have correct lane modifier --- fastlane/Matchfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fastlane/Matchfile b/fastlane/Matchfile index de59777a19..400b1ffebc 100644 --- a/fastlane/Matchfile +++ b/fastlane/Matchfile @@ -19,11 +19,9 @@ for_lane :adhoc do end for_lane :sync_signing_alpha do - type "appstore" app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"] end -for_lane :alpha do - type "appstore" +for_lane :release_alpha do app_identifier ["com.duckduckgo.mobile.ios.alpha", "com.duckduckgo.mobile.ios.alpha.ShareExtension", "com.duckduckgo.mobile.ios.alpha.OpenAction2", "com.duckduckgo.mobile.ios.alpha.Widgets", "com.duckduckgo.mobile.ios.alpha.NetworkExtension"] end From 865031e215de45dba57637d83ef108fbac5ad2a5 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 17:19:22 +0200 Subject: [PATCH 05/28] Add the alpha GHA workflow --- .github/workflows/alpha.yml | 104 ++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 .github/workflows/alpha.yml diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml new file mode 100644 index 0000000000..52fcd14441 --- /dev/null +++ b/.github/workflows/alpha.yml @@ -0,0 +1,104 @@ +name: Make TestFlight Alpha Build + +on: + workflow_dispatch: + branches: + - develop + - graeme/ios-nightly-alphas # TODO: Remove this before merging + #- '!develop' # filter out PRs matching that pattern + inputs: + destination: + description: "TestFlight Group" + required: true + default: "Latest Alpha Group" + type: string + + push: + branches: [ graeme/ios-nightly-alphas ] + +jobs: + make-alpha: + if: github.event.action == 0 || github.event.pull_request.merged == true # empty string returns 0; for case when workflow is triggered manually + runs-on: macos-13 + name: Make TestFlight Alpha Build + + steps: + + - name: Set destination output + id: destination + run: | + INPUT_DESTINATION=${{ github.event.inputs.destination }} + echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT + + # - name: Assert develop branch TODO: Uncomment before merging + # run: | + # case "${{ github.ref }}" in + # *develop/*) ;; + # *) echo "👎 Not develop branch"; exit 1 ;; + # esac + + - name: Register SSH keys for access to certificates + uses: webfactory/ssh-agent@v0.7.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }} + + - name: Check out the code + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set cache key hash + run: | + has_only_tags=$(jq '[ .object.pins[].state | has("version") ] | all' DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved) + if [[ "$has_only_tags" == "true" ]]; then + echo "cache_key_hash=${{ hashFiles('DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}" >> $GITHUB_ENV + else + echo "Package.resolved contains dependencies specified by branch or commit, skipping cache." + fi + + - name: Cache SPM + if: env.cache_key_hash + uses: actions/cache@v3 + with: + path: DerivedData/SourcePackages + key: ${{ runner.os }}-spm-${{ env.cache_key_hash }} + restore-keys: | + ${{ runner.os }}-spm- + + - name: Select Xcode + run: sudo xcode-select -s /Applications/Xcode_$(<.xcode-version).app/Contents/Developer + + - name: Prepare fastlane + run: bundle install + + - name: Archive and upload the app + env: + APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} + APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} + APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + run: | + app_version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)" + bundle exec fastlane increment_build_number_for_version:app_version + bundle exec fastlane release_alpha groups:"${{ steps.destination.outputs.destination }}" + build_version="cat DuckDuckGo.xcodeproj/project.pbxproj | grep -m1 'CURRENT_PROJ ECT_VERSION' | cut -d'=' -f2 | tr -d ';' | tr -d ' '" + echo "dsyms_path=${{ github.workspace }}/DuckDuckGo.app.dSYM.zip" >> $GITHUB_ENV + echo "app_version=${app_version}" >> $GITHUB_ENV + echo "build_version=${build_version}" >> $GITHUB_ENV + + - name: Upload dSYMs artifact + uses: actions/upload-artifact@v3 + with: + name: DuckDuckGo-Alpha-dSYM-${{ env.app_version }} + path: ${{ env.dsyms_path }} + + - name: Upload debug symbols to Asana + env: + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} + run: | + asana_dsyms_path="${{ github.workspace }}/DuckDuckGo-Alpha-${{ env.app_version }}(${{ env.build_version }})-dSYM.zip" + mv -f "${{ env.dsyms_path }}" "$asana_dsyms_path" + + curl -s "https://app.asana.com/0/0/1205344386326139/f/attachments" \ + -H "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \ + --form "file=@${asana_dsyms_path};type=application/zip" From d86299edacba32c9c1086579ff62f2028c2d7722 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 8 Sep 2023 18:12:37 +0200 Subject: [PATCH 06/28] Pass version and app_identifier to increment_build_number --- .github/workflows/alpha.yml | 2 +- fastlane/Fastfile | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 52fcd14441..af52828437 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -79,7 +79,7 @@ jobs: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} run: | app_version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)" - bundle exec fastlane increment_build_number_for_version:app_version + bundle exec fastlane increment_build_number_for_version version:$app_version app_identifier:"com.duckduckgo.mobile.ios.alpha" bundle exec fastlane release_alpha groups:"${{ steps.destination.outputs.destination }}" build_version="cat DuckDuckGo.xcodeproj/project.pbxproj | grep -m1 'CURRENT_PROJ ECT_VERSION' | cut -d'=' -f2 | tr -d ';' | tr -d ' '" echo "dsyms_path=${{ github.workspace }}/DuckDuckGo.app.dSYM.zip" >> $GITHUB_ENV diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 43859f0944..fd8c8ffaaf 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -140,11 +140,15 @@ end desc 'Increment build number based on version in App Store Connect' lane :increment_build_number_for_version do |options| + app_identifier = "com.duckduckgo.mobile.ios" + if options[:app_identifier] + app_identifier = options[:app_identifier] + end increment_build_number({ build_number: latest_testflight_build_number( version: options[:version], - app_identifier: "com.duckduckgo.mobile.ios", + app_identifier: app_identifier, initial_build_number: -1, username: get_username(options)) + 1, skip_info_plist: "true" From a7c3b2d5d19d47c588da6f2924ad184ab6edbdfa Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Mon, 11 Sep 2023 15:05:20 +0200 Subject: [PATCH 07/28] Get API key for fetching version --- fastlane/Fastfile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fd8c8ffaaf..e18483a8d9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -147,6 +147,7 @@ lane :increment_build_number_for_version do |options| increment_build_number({ build_number: latest_testflight_build_number( + api_key: get_api_key, version: options[:version], app_identifier: app_identifier, initial_build_number: -1, From c8e1360b5f917747552c3a6a3c5861cddae6019c Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 10:58:30 +0200 Subject: [PATCH 08/28] Skip waiting for build processing --- fastlane/Fastfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e18483a8d9..dcc1b3745d 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -134,7 +134,8 @@ lane :release_alpha do |options| upload_to_testflight( api_key: get_api_key, - groups: options[:groups] + groups: options[:groups], + skip_waiting_for_build_processing: true ) end From e83a6c737e8d6167040d01a3e5e7cdcde47cfb75 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 11:18:04 +0200 Subject: [PATCH 09/28] Add deploy-alpha step to nightly.yml --- .github/workflows/nightly.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ad5c8bec9d..6e5d77bf08 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -94,3 +94,8 @@ jobs: with: report_paths: unittests.xml + deploy-alpha: + name: Deploy Nightly Alpha Build + uses: ./.github/workflows/alpha.yml + with: + destination: "Nightly Alpha Group" From 2c075fb203a8b345804ff76510608a2512011fdc Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 11:18:19 +0200 Subject: [PATCH 10/28] Update README --- fastlane/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/fastlane/README.md b/fastlane/README.md index b0375dd0f9..452c9fec13 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -35,7 +35,7 @@ Fetches and updates certificates and provisioning profiles for Ad-Hoc distributi [bundle exec] fastlane sync_signing_alpha ``` - +Fetches and updates certificates and provisioning profiles for Alpha distribution ### adhoc @@ -45,14 +45,6 @@ Fetches and updates certificates and provisioning profiles for Ad-Hoc distributi Makes Ad-Hoc build with a specified name in a given directory -### alpha - -```sh -[bundle exec] fastlane alpha -``` - -Makes Alpha release build and uploads it to App Store Connect (TestFlight) - ### release_appstore ```sh @@ -77,6 +69,14 @@ Updates App Store metadata Makes App Store release build and uploads it to TestFlight +### release_alpha + +```sh +[bundle exec] fastlane release_alpha +``` + +Makes Alpha release build and uploads it to TestFlight + ### increment_build_number_for_version ```sh From 45a0960dfeb43e91b71f2e483f4e9283b634761e Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 15:17:18 +0200 Subject: [PATCH 11/28] Fix dSym paths --- .github/workflows/alpha.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index af52828437..feedab022f 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -81,8 +81,8 @@ jobs: app_version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)" bundle exec fastlane increment_build_number_for_version version:$app_version app_identifier:"com.duckduckgo.mobile.ios.alpha" bundle exec fastlane release_alpha groups:"${{ steps.destination.outputs.destination }}" - build_version="cat DuckDuckGo.xcodeproj/project.pbxproj | grep -m1 'CURRENT_PROJ ECT_VERSION' | cut -d'=' -f2 | tr -d ';' | tr -d ' '" - echo "dsyms_path=${{ github.workspace }}/DuckDuckGo.app.dSYM.zip" >> $GITHUB_ENV + build_version="$(cat DuckDuckGo.xcodeproj/project.pbxproj | grep -m1 'CURRENT_PROJ ECT_VERSION' | cut -d'=' -f2 | tr -d ';' | tr -d ' ')" + echo "dsyms_path=${{ github.workspace }}/DuckDuckGo-Alpha.app.dSYM.zip" >> $GITHUB_ENV echo "app_version=${app_version}" >> $GITHUB_ENV echo "build_version=${build_version}" >> $GITHUB_ENV From 63e149d974912efc70160e8373d27b21c1d1db4d Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 16:55:13 +0200 Subject: [PATCH 12/28] Fix build version reading --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index feedab022f..ddf1fae18a 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -81,7 +81,7 @@ jobs: app_version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)" bundle exec fastlane increment_build_number_for_version version:$app_version app_identifier:"com.duckduckgo.mobile.ios.alpha" bundle exec fastlane release_alpha groups:"${{ steps.destination.outputs.destination }}" - build_version="$(cat DuckDuckGo.xcodeproj/project.pbxproj | grep -m1 'CURRENT_PROJ ECT_VERSION' | cut -d'=' -f2 | tr -d ';' | tr -d ' ')" + build_version="$(xcodebuild -configuration Alpha -showBuildSettings | grep CURRENT_PROJECT_VERSION | tr -d 'CURRENT_PROJECT_VERSION =')" echo "dsyms_path=${{ github.workspace }}/DuckDuckGo-Alpha.app.dSYM.zip" >> $GITHUB_ENV echo "app_version=${app_version}" >> $GITHUB_ENV echo "build_version=${build_version}" >> $GITHUB_ENV From 648cb272c44eb7c114c31f51dc4bf29acec8f4de Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 12 Sep 2023 19:28:57 +0200 Subject: [PATCH 13/28] Fix asana task --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index ddf1fae18a..3d993ce2f0 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -99,6 +99,6 @@ jobs: asana_dsyms_path="${{ github.workspace }}/DuckDuckGo-Alpha-${{ env.app_version }}(${{ env.build_version }})-dSYM.zip" mv -f "${{ env.dsyms_path }}" "$asana_dsyms_path" - curl -s "https://app.asana.com/0/0/1205344386326139/f/attachments" \ + curl -s "https://app.asana.com/api/1.0/tasks/1205344386326139/attachments" \ -H "Authorization: Bearer ${{ secrets.ASANA_ACCESS_TOKEN }}" \ --form "file=@${asana_dsyms_path};type=application/zip" From 1bcd657017f5820475dbd1525e3cdc2a5d3b9911 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 13 Sep 2023 11:59:52 +0200 Subject: [PATCH 14/28] Fix workflow dispatch --- .github/workflows/alpha.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 3d993ce2f0..4f42934966 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -2,10 +2,6 @@ name: Make TestFlight Alpha Build on: workflow_dispatch: - branches: - - develop - - graeme/ios-nightly-alphas # TODO: Remove this before merging - #- '!develop' # filter out PRs matching that pattern inputs: destination: description: "TestFlight Group" @@ -14,7 +10,7 @@ on: type: string push: - branches: [ graeme/ios-nightly-alphas ] + branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging jobs: make-alpha: From cf6ffc10b029593d7172ca2191056edd49bd9625 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 13 Sep 2023 12:01:16 +0200 Subject: [PATCH 15/28] Remove unneeded condition --- .github/workflows/alpha.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 4f42934966..4da5d18ca3 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -14,7 +14,6 @@ on: jobs: make-alpha: - if: github.event.action == 0 || github.event.pull_request.merged == true # empty string returns 0; for case when workflow is triggered manually runs-on: macos-13 name: Make TestFlight Alpha Build From 73cc79ca0bded179185f8f67f5fe742d4ebe1e6e Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 13 Sep 2023 12:22:34 +0200 Subject: [PATCH 16/28] Make code merge-ready (won't trigger build) --- .github/workflows/alpha.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 4da5d18ca3..afffe3d98a 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -9,9 +9,6 @@ on: default: "Latest Alpha Group" type: string - push: - branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging - jobs: make-alpha: runs-on: macos-13 @@ -25,12 +22,12 @@ jobs: INPUT_DESTINATION=${{ github.event.inputs.destination }} echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT - # - name: Assert develop branch TODO: Uncomment before merging - # run: | - # case "${{ github.ref }}" in - # *develop/*) ;; - # *) echo "👎 Not develop branch"; exit 1 ;; - # esac + - name: Assert develop branch TODO: Uncomment before merging + run: | + case "${{ github.ref }}" in + *develop/*) ;; + *) echo "👎 Not develop branch"; exit 1 ;; + esac - name: Register SSH keys for access to certificates uses: webfactory/ssh-agent@v0.7.0 From 19597fd75fa688a0c0aaf2d1c79ee40d3db0a356 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Mon, 18 Sep 2023 14:45:39 +0200 Subject: [PATCH 17/28] Handle nightly workflow_call properly --- .github/workflows/alpha.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index afffe3d98a..ebdfbd9f5e 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -8,6 +8,13 @@ on: required: true default: "Latest Alpha Group" type: string + workflow_call: + inputs: + destination: + description: "TestFlight Group" + required: true + default: "Latest Alpha Group" + type: string jobs: make-alpha: From 2e6c93770e835b99e6b375ee8ade0291ee916139 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 19 Sep 2023 11:47:35 +0200 Subject: [PATCH 18/28] Pass secrets from nightly --- .github/workflows/alpha.yml | 13 +++++++++++++ .github/workflows/nightly.yml | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index ebdfbd9f5e..349db27da5 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -15,6 +15,19 @@ on: required: true default: "Latest Alpha Group" type: string + secrets: + SSH_PRIVATE_KEY_FASTLANE_MATCH: + required: true + APPLE_API_KEY_BASE64: + required: true + APPLE_API_KEY_ID: + required: true + APPLE_API_KEY_ISSUER: + required: true + MATCH_PASSWORD: + required: true + ASANA_ACCESS_TOKEN: + required: true jobs: make-alpha: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6e5d77bf08..7c4392699d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -99,3 +99,10 @@ jobs: uses: ./.github/workflows/alpha.yml with: destination: "Nightly Alpha Group" + secrets: + APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }} + APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} + APPLE_API_KEY_ISSUER: ${{ secrets.APPLE_API_KEY_ISSUER }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + SSH_PRIVATE_KEY_FASTLANE_MATCH: ${{ secrets.SSH_PRIVATE_KEY_FASTLANE_MATCH }} + ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }} From e9603b6cc99e355841ac12508422aa7aa53bfd93 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 19 Sep 2023 11:53:45 +0200 Subject: [PATCH 19/28] Schedule nighty on push just for testing --- .github/workflows/nightly.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 7c4392699d..e1ff8f23e4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,6 +3,8 @@ name: Nightly Integration Tests on: schedule: - cron: '0 2 * * *' # Run at 2 AM UTC + push: + branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging jobs: atb-ui-tests: From b9e25bba2d1d17676672a84c7d47114919d63500 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 19 Sep 2023 12:55:41 +0200 Subject: [PATCH 20/28] Comment out branch assert --- .github/workflows/alpha.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 349db27da5..8b7b98d72f 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -42,12 +42,12 @@ jobs: INPUT_DESTINATION=${{ github.event.inputs.destination }} echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT - - name: Assert develop branch TODO: Uncomment before merging - run: | - case "${{ github.ref }}" in - *develop/*) ;; - *) echo "👎 Not develop branch"; exit 1 ;; - esac + # - name: Assert develop branch TODO: Uncomment before merging + # run: | + # case "${{ github.ref }}" in + # *develop/*) ;; + # *) echo "👎 Not develop branch"; exit 1 ;; + # esac - name: Register SSH keys for access to certificates uses: webfactory/ssh-agent@v0.7.0 From 22cca857f27512386ce526c219fddbcfcf66efe2 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 19 Sep 2023 13:10:58 +0200 Subject: [PATCH 21/28] Update nightly name --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index e1ff8f23e4..8f1a2b0c35 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,4 +1,4 @@ -name: Nightly Integration Tests +name: Nightly Test and Deploy on: schedule: From 50caa67ed65fb7faa9101fc6760a2c6b7087fa59 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Tue, 19 Sep 2023 13:14:29 +0200 Subject: [PATCH 22/28] Remove pull trigger etc added for testing --- .github/workflows/alpha.yml | 12 ++++++------ .github/workflows/nightly.yml | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 8b7b98d72f..7daa78624d 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -42,12 +42,12 @@ jobs: INPUT_DESTINATION=${{ github.event.inputs.destination }} echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT - # - name: Assert develop branch TODO: Uncomment before merging - # run: | - # case "${{ github.ref }}" in - # *develop/*) ;; - # *) echo "👎 Not develop branch"; exit 1 ;; - # esac + - name: Assert develop branch + run: | + case "${{ github.ref }}" in + *develop/*) ;; + *) echo "👎 Not develop branch"; exit 1 ;; + esac - name: Register SSH keys for access to certificates uses: webfactory/ssh-agent@v0.7.0 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8f1a2b0c35..5a67fdb265 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,8 +3,6 @@ name: Nightly Test and Deploy on: schedule: - cron: '0 2 * * *' # Run at 2 AM UTC - push: - branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging jobs: atb-ui-tests: From 32de4fa8bcc4a0310a5a3a50a86af374d348806b Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 11:29:32 +0200 Subject: [PATCH 23/28] Fix inputs for nightly job --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 7daa78624d..b3b37b8368 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -39,7 +39,7 @@ jobs: - name: Set destination output id: destination run: | - INPUT_DESTINATION=${{ github.event.inputs.destination }} + INPUT_DESTINATION=${{ github.event.inputs.destination || inputs.destination }} echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT - name: Assert develop branch From fbdf91c1b7886e931b85dbf1842fc385572af23c Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 11:30:43 +0200 Subject: [PATCH 24/28] Revert "Remove pull trigger etc added for testing" This reverts commit 50caa67ed65fb7faa9101fc6760a2c6b7087fa59. --- .github/workflows/alpha.yml | 12 ++++++------ .github/workflows/nightly.yml | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index b3b37b8368..869d93beeb 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -42,12 +42,12 @@ jobs: INPUT_DESTINATION=${{ github.event.inputs.destination || inputs.destination }} echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT - - name: Assert develop branch - run: | - case "${{ github.ref }}" in - *develop/*) ;; - *) echo "👎 Not develop branch"; exit 1 ;; - esac + # - name: Assert develop branch TODO: Uncomment before merging + # run: | + # case "${{ github.ref }}" in + # *develop/*) ;; + # *) echo "👎 Not develop branch"; exit 1 ;; + # esac - name: Register SSH keys for access to certificates uses: webfactory/ssh-agent@v0.7.0 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5a67fdb265..8f1a2b0c35 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,6 +3,8 @@ name: Nightly Test and Deploy on: schedule: - cron: '0 2 * * *' # Run at 2 AM UTC + push: + branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging jobs: atb-ui-tests: From 26b6ce73585c63c4386ea4a99d4afc2cd4413e69 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 11:49:07 +0200 Subject: [PATCH 25/28] Use env for destination --- .github/workflows/alpha.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 869d93beeb..f98825cb12 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -34,13 +34,15 @@ jobs: runs-on: macos-13 name: Make TestFlight Alpha Build + env: + destination: ${{ github.event.inputs.destination || inputs.destination }} + steps: - name: Set destination output id: destination run: | - INPUT_DESTINATION=${{ github.event.inputs.destination || inputs.destination }} - echo "destination=${INPUT_DESTINATION}" >> $GITHUB_OUTPUT + echo "destination=${{ env.destination }}" >> $GITHUB_OUTPUT # - name: Assert develop branch TODO: Uncomment before merging # run: | From 66bff4962388e5c4b5f44f62a6048feef76d342e Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 11:54:19 +0200 Subject: [PATCH 26/28] But like... do it properly this time --- .github/workflows/alpha.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index f98825cb12..a92ec06114 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -39,11 +39,6 @@ jobs: steps: - - name: Set destination output - id: destination - run: | - echo "destination=${{ env.destination }}" >> $GITHUB_OUTPUT - # - name: Assert develop branch TODO: Uncomment before merging # run: | # case "${{ github.ref }}" in From 2a721cd0b358a7349b152d4a194a3be383bbf3e9 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 12:15:54 +0200 Subject: [PATCH 27/28] Save my VS Code changes... --- .github/workflows/alpha.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index a92ec06114..13ec70f562 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -89,7 +89,7 @@ jobs: run: | app_version="$(cut -d ' ' -f 3 < Configuration/Version.xcconfig)" bundle exec fastlane increment_build_number_for_version version:$app_version app_identifier:"com.duckduckgo.mobile.ios.alpha" - bundle exec fastlane release_alpha groups:"${{ steps.destination.outputs.destination }}" + bundle exec fastlane release_alpha groups:"${{ env.destination }}" build_version="$(xcodebuild -configuration Alpha -showBuildSettings | grep CURRENT_PROJECT_VERSION | tr -d 'CURRENT_PROJECT_VERSION =')" echo "dsyms_path=${{ github.workspace }}/DuckDuckGo-Alpha.app.dSYM.zip" >> $GITHUB_ENV echo "app_version=${app_version}" >> $GITHUB_ENV From 7b1bbbaf67cef8eb065f3cafb5ddaed20faed224 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Wed, 20 Sep 2023 12:27:30 +0200 Subject: [PATCH 28/28] Revert "Revert "Remove pull trigger etc added for testing"" This reverts commit fbdf91c1b7886e931b85dbf1842fc385572af23c. --- .github/workflows/alpha.yml | 12 ++++++------ .github/workflows/nightly.yml | 2 -- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml index 13ec70f562..4110318550 100644 --- a/.github/workflows/alpha.yml +++ b/.github/workflows/alpha.yml @@ -39,12 +39,12 @@ jobs: steps: - # - name: Assert develop branch TODO: Uncomment before merging - # run: | - # case "${{ github.ref }}" in - # *develop/*) ;; - # *) echo "👎 Not develop branch"; exit 1 ;; - # esac + - name: Assert develop branch + run: | + case "${{ github.ref }}" in + *develop/*) ;; + *) echo "👎 Not develop branch"; exit 1 ;; + esac - name: Register SSH keys for access to certificates uses: webfactory/ssh-agent@v0.7.0 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8f1a2b0c35..5a67fdb265 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,8 +3,6 @@ name: Nightly Test and Deploy on: schedule: - cron: '0 2 * * *' # Run at 2 AM UTC - push: - branches: [ graeme/ios-nightly-alphas ] # TODO: Remove this before merging jobs: atb-ui-tests: