diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml deleted file mode 100644 index 1c8e26f11..000000000 --- a/.github/workflows/pr-build.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: PR Build - -on: - pull_request: - types: [ labeled, synchronize, opened, reopened ] - -jobs: - build: - # Only run for PRs that contain the trigger label. The action will fail for forks due to - # missing secrets, but there's no need to handle this as it won't run automatically. - if: contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build') - - name: Release - runs-on: macos-15 - - concurrency: - # Only allow a single run of this workflow on each branch, automatically cancelling older runs. - group: alpha-${{ github.head_ref }} - cancel-in-progress: true - - steps: - - uses: actions/checkout@v4 - - - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Setup environment - env: - CI_WORKFLOW: PR_BUILD - run: - source ci_scripts/ci_common.sh && setup_github_actions_environment - - - name: Import signing certificate - uses: apple-actions/import-codesign-certs@cfd6eb39a2c848ead8836bda6b56813585404ba7 # v5 - with: - p12-file-base64: ${{ secrets.ALPHA_CERTIFICATES_P12 }} - p12-password: ${{ secrets.ALPHA_CERTIFICATES_P12_PASSWORD }} - - - name: Build alpha - run: bundle exec fastlane build_alpha - env: - APPSTORECONNECT_KEY_ID: ${{ secrets.APPSTORECONNECT_KEY_ID }} - APPSTORECONNECT_KEY_ISSUER_ID: ${{ secrets.APPSTORECONNECT_KEY_ISSUER_ID }} - APPSTORECONNECT_KEY_CONTENT: ${{ secrets.APPSTORECONNECT_KEY_CONTENT }} - DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }} - GITHUB_PR_NUMBER: ${{ github.event.number }} - BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} - - - name: Add release notes and Diawi info - uses: NejcZdovc/comment-pr@a423635d183a8259308e80593c96fecf31539c26 #v2.1.0 - with: - message: | - :iphone: Scan the QR code below to install the build for this PR. - :lock: This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha. - - ![QR code](${{ env.DIAWI_QR_CODE_LINK }}) - - If you can't scan the QR code you can install the build via this link: ${{ env.DIAWI_FILE_LINK }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Gemfile.lock b/Gemfile.lock index 46c6a9cc0..6ceb36f3d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,3 @@ -GIT - remote: https://github.com/mhtranbn/fastlane-plugin-diawi.git - revision: 6ca982cd41e7c315290240cd4570d5d7b799db38 - specs: - fastlane-plugin-diawi (0.1.3) - GEM remote: https://rubygems.org/ specs: @@ -119,8 +113,6 @@ GEM xcpretty (~> 0.4.1) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-brew (0.1.1) - fastlane-plugin-browserstack (0.3.2) - rest-client (~> 2.0, >= 2.0.2) fastlane-plugin-sentry (1.20.0) os (~> 1.1, >= 1.1.4) fastlane-plugin-xcconfig (2.1.0) @@ -166,7 +158,6 @@ GEM os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) highline (2.0.3) - http-accept (1.7.0) http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.9.0) @@ -175,9 +166,6 @@ GEM json (2.10.2) jwt (2.10.1) base64 - mime-types (3.5.2) - mime-types-data (~> 3.2015) - mime-types-data (3.2024.0305) mini_magick (4.13.2) mini_mime (1.1.5) multi_json (1.15.0) @@ -185,7 +173,6 @@ GEM mutex_m (0.3.0) nanaimo (0.4.0) naturally (2.2.1) - netrc (0.11.0) nkf (0.2.0) optparse (0.6.0) os (1.1.4) @@ -197,11 +184,6 @@ GEM declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - rest-client (2.1.0) - http-accept (>= 1.7.0, < 2.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) retriable (3.1.2) rexml (3.4.1) rouge (3.28.0) @@ -246,13 +228,12 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-24 x86_64-linux DEPENDENCIES abbrev fastlane - fastlane-plugin-browserstack - fastlane-plugin-diawi! fastlane-plugin-sentry fastlane-plugin-xcconfig fastlane-plugin-xcodegen diff --git a/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/AppIcon.png b/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/AppIcon.png deleted file mode 100644 index 2f5e49441..000000000 Binary files a/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/AppIcon.png and /dev/null differ diff --git a/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/Contents.json b/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/Contents.json deleted file mode 100644 index cefcc878e..000000000 --- a/Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/Contents.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "images" : [ - { - "filename" : "AppIcon.png", - "idiom" : "universal", - "platform" : "ios", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Variants/Alpha/Resources/Alpha.xcassets/Contents.json b/Variants/Alpha/Resources/Alpha.xcassets/Contents.json deleted file mode 100644 index 73c00596a..000000000 --- a/Variants/Alpha/Resources/Alpha.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/Variants/Alpha/alpha.yml b/Variants/Alpha/alpha.yml deleted file mode 100644 index dc7a87517..000000000 --- a/Variants/Alpha/alpha.yml +++ /dev/null @@ -1,11 +0,0 @@ -settings: - APP_GROUP_IDENTIFIER: group.io.element.pr - BASE_BUNDLE_IDENTIFIER: io.element.elementx.pr - -targets: - ElementX: - settings: - base: - ASSETCATALOG_COMPILER_APPICON_NAME: AlphaAppIcon - sources: - - path: Resources \ No newline at end of file diff --git a/fastlane/Fastfile b/fastlane/Fastfile index aa03017b6..207950369 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,71 +13,6 @@ before_all do ENV["SENTRY_LOG_LEVEL"] = "DEBUG" end -lane :build_alpha do - app_store_connect_api_key( - key_id: ENV["APPSTORECONNECT_KEY_ID"], - issuer_id: ENV["APPSTORECONNECT_KEY_ISSUER_ID"], - key_content: ENV["APPSTORECONNECT_KEY_CONTENT"] - ) - - config_alpha() - - code_signing_identity = "Apple Distribution: Vector Creations Limited (7J4U792NQT)" - - app_provisioning_profile_name = "ElementX PR Ad Hoc" - app_bundle_identifier = "io.element.elementx.pr" - - nse_provisioning_profile_name = "ElementX NSE PR Ad Hoc" - nse_bundle_identifier = "io.element.elementx.pr.nse" - - update_code_signing_settings( - targets: ["ElementX"], - use_automatic_signing: false, - bundle_identifier: app_bundle_identifier, - profile_name: app_provisioning_profile_name, - code_sign_identity: code_signing_identity - ) - - get_provisioning_profile( - app_identifier: app_bundle_identifier, - provisioning_name: app_provisioning_profile_name, - ignore_profiles_with_different_name: true, - adhoc: true - ) - - update_code_signing_settings( - targets: ["NSE"], - use_automatic_signing: false, - bundle_identifier: nse_bundle_identifier, - profile_name: nse_provisioning_profile_name, - code_sign_identity: code_signing_identity - ) - - get_provisioning_profile( - app_identifier: nse_bundle_identifier, - provisioning_name: nse_provisioning_profile_name, - ignore_profiles_with_different_name: true, - adhoc: true - ) - - build_ios_app( - scheme: "ElementX", - clean: true, - export_method: "ad-hoc", - output_directory: "build", - export_options: { - provisioningProfiles: { - app_bundle_identifier => app_provisioning_profile_name, - nse_bundle_identifier => nse_provisioning_profile_name - } - } - ) - - upload_to_diawi() - - upload_to_browserstack() -end - lane :unit_tests do |options| reset_simulator = ENV.key?('CI') @@ -352,67 +287,6 @@ private_lane :git_push do |options| sh("git push https://#{api_token}@#{repo_url}") end -lane :config_alpha do - target_file_path = "../project.yml" - data = YAML.load_file target_file_path - - # Check if the "path" already exists in the "include" array - if !data["include"].any? { |item| item["path"] == "Variants/Alpha/alpha.yml" } - data["include"].append({ "path" => "Variants/Alpha/alpha.yml" }) - end - - File.open(target_file_path, 'w') { |f| YAML.dump(data, f) } - - xcodegen(spec: "project.yml") - - version = ENV["GITHUB_PR_NUMBER"] - - Dir.chdir ".." do - sh("swift run tools app-icon-banner Variants/Alpha/Resources/Alpha.xcassets/AlphaAppIcon.appiconset/AppIcon.png --banner-text 'PR #{version}'") - end - - bump_build_number() -end - -private_lane :upload_to_diawi do - api_token = ENV["DIAWI_API_TOKEN"] - UI.user_error!("Invalid Diawi API token.") unless !api_token.to_s.empty? - - # Upload to Diawi - diawi( - token: api_token, - wall_of_apps: false, - file: lane_context[SharedValues::IPA_OUTPUT_PATH] - ) - - # Get the Diawi link from Diawi action shared value - diawi_link = lane_context[SharedValues::UPLOADED_FILE_LINK_TO_DIAWI] - UI.command_output("Diawi link: " + diawi_link.to_s) - - # Generate the Diawi QR code file link - diawi_app_id = URI(diawi_link).path.split('/').last - diawi_qr_code_link = "https://www.diawi.com/qrcode/link/#{diawi_app_id}" - - # Set "DIAWI_FILE_LINK" to GitHub environment variables for Github actions - sh("echo DIAWI_FILE_LINK=#{diawi_link} >> $GITHUB_ENV") - sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV") -end - -private_lane :upload_to_browserstack do - browserstack_username = ENV["BROWSERSTACK_USERNAME"] - UI.user_error!("Invalid BrowserStack username.") unless !browserstack_username.to_s.empty? - - browserstack_access_key = ENV["BROWSERSTACK_ACCESS_KEY"] - UI.user_error!("Invalid BrowserStack access key.") unless !browserstack_access_key.to_s.empty? - - upload_to_browserstack_app_automate( - browserstack_username: browserstack_username, - browserstack_access_key: browserstack_access_key, - file_path: lane_context[SharedValues::IPA_OUTPUT_PATH], - custom_id: "element-x-ios-pr" - ) -end - private_lane :bump_build_number do # Increment build number to current date build_number = Time.now.strftime("%Y%m%d%H%M") diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile index 6c4c24478..0718ea19d 100644 --- a/fastlane/Pluginfile +++ b/fastlane/Pluginfile @@ -2,10 +2,8 @@ # # Ensure this file is checked in to source control! -gem 'fastlane-plugin-diawi', git: 'https://github.com/mhtranbn/fastlane-plugin-diawi.git' gem 'fastlane-plugin-xcodegen' gem 'fastlane-plugin-sentry' -gem 'fastlane-plugin-browserstack' gem 'fastlane-plugin-xcconfig' # Until Fastlane includes them directly. diff --git a/fastlane/README.md b/fastlane/README.md index aebf3bc07..07a90a7b2 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -13,13 +13,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do # Available Actions -### build_alpha - -```sh -[bundle exec] fastlane build_alpha -``` - - ### unit_tests @@ -93,14 +86,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do -### config_alpha - -```sh -[bundle exec] fastlane config_alpha -``` - - - ### config_secrets ```sh