diff --git a/.github/workflows/promote_testflight.yml b/.github/workflows/promote_testflight.yml new file mode 100644 index 0000000000..641c945ad7 --- /dev/null +++ b/.github/workflows/promote_testflight.yml @@ -0,0 +1,33 @@ +name: Promote TestFlight to App Store + +on: + workflow_dispatch: {} + +jobs: + promote-testflight-to-appstore: + runs-on: macos-14 + + steps: + - name: Check out the code + uses: actions/checkout@v4 + with: + ref: ${{ github.ref_name }} + sparse-checkout: | + .github + Gemfile + Gemfile.lock + fastlane + scripts + + - name: Set up fastlane + run: bundle install + + - name: Promote TestFlight to App Store + 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 }} + run: | + git config --global user.name "Dax the Duck" + git config --global user.email "dax@duckduckgo.com" + bundle exec fastlane promote_latest_testflight_to_appstore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 525a57ddcf..50a4fefb6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: destination: description: "Upload destination (App Store or TestFlight)" required: true - default: appstore + default: testflight type: choice options: - appstore @@ -36,10 +36,9 @@ jobs: id: destination run: | INPUT_DESTINATION=${{ github.event.inputs.destination }} - echo "destination=${INPUT_DESTINATION:-"appstore"}" >> $GITHUB_OUTPUT + echo "destination=${INPUT_DESTINATION:-"testflight"}" >> $GITHUB_OUTPUT - name: Assert release branch - if: steps.destination.outputs.destination == 'appstore' run: | case "${{ github.ref }}" in *release/*) ;; diff --git a/fastlane/Fastfile b/fastlane/Fastfile index f18657fd83..0cadad0296 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -168,6 +168,32 @@ lane :alpha_adhoc do |options| end end + + +desc 'Promotes the latest TestFlight build to App Store without submitting for review' +lane :promote_latest_testflight_to_appstore do |options| + + app_identifier = options[:alpha] ? "com.duckduckgo.mobile.ios.alpha" : "com.duckduckgo.mobile.ios" + + latest_testflight_build_number( + api_key: get_api_key, + username: get_username(options), + platform: 'ios', + app_identifier: app_identifier + ) + + latest_build_number = lane_context[SharedValues::LATEST_TESTFLIGHT_BUILD_NUMBER] + latest_build_version = lane_context[SharedValues::LATEST_TESTFLIGHT_VERSION] + + UI.message("The latest build number #{latest_build_number} of the latest version: #{latest_build_version} for app identifier: #{app_identifier}") + + upload_metadata({ + build_number: latest_build_number.to_s, + app_version: latest_build_version.to_s, + app_identifier: app_identifier + }) +end + desc 'Makes App Store release build and uploads it to App Store Connect' lane :release_appstore do |options| build_release(options) @@ -194,7 +220,8 @@ desc 'Updates App Store metadata' lane :upload_metadata do |options| deliver(common_deliver_arguments.merge(options).merge({ skip_binary_upload: true, - skip_metadata: false + skip_metadata: false, + version_check_wait_retry_limit: 0 })) end