diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a6f684..34bc105 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,9 +18,30 @@ jobs: with: ssh-private-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} - - uses: actions/checkout@v4.1.1 + - name: Git authentication + run: | + echo "This step is required to bypass `git credential-luci login`" + git config --global credential.helper store + echo "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com" > ~/.git-credentials + + - name: Checkout release pipeline + uses: actions/checkout@v5 + with: + repository: GetStream/stream-webrtc-release-pipeline + ref: main + token: ${{ secrets.GITHUB_TOKEN }} + ssh-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} + persist-credentials: false + + - name: Checkout WebRTC branch + uses: actions/checkout@v5 with: - fetch-depth: 0 + repository: GetStream/webrtc + ref: ${{ inputs.webrtc_branch }} + path: src + token: ${{ secrets.GITHUB_TOKEN }} + ssh-key: ${{ secrets.BOT_SSH_PRIVATE_KEY }} + persist-credentials: false - name: Set up Ruby uses: ruby/setup-ruby@v1 @@ -33,29 +54,44 @@ jobs: with: python-version: '3.x' - - name: Git authentication + - name: Cache WebRTC build output + uses: actions/cache@v4 + with: + path: src/.output + key: ${{ runner.os }}-webrtc-output-${{ inputs.webrtc_branch }}-${{ hashFiles('src/.gclient', 'src/DEPS') }} + restore-keys: | + ${{ runner.os }}-webrtc-output-${{ inputs.webrtc_branch }}- + ${{ runner.os }}-webrtc-output- + + - name: Ensure gclient is available run: | - echo "This step is required to bypass `git credential-luci login`" - git config --global credential.helper store - echo "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com" > ~/.git-credentials + if ! command -v gclient &> /dev/null; then + current_dir=$(pwd) + mkdir -p "$HOME/webrtc" + cd "$HOME/webrtc" + git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git + export PATH="$PATH:$HOME/webrtc/depot_tools" + cd "$current_dir" + fi + if [ -d "$HOME/webrtc/depot_tools" ]; then + echo "$HOME/webrtc/depot_tools" >> "$GITHUB_PATH" + fi - name: "Build" env: MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} APPSTORE_API_KEY: ${{ secrets.APPSTORE_API_KEY }} - run: bundle exec fastlane build webrtc_branch:${{ inputs.webrtc_branch }} --verbose + run: cd fastlane && bundle install && bundle exec fastlane ios build root:../src verbose:true maccatalyst_support:true timeout-minutes: 120 - uses: actions/upload-artifact@v4 - if: always() with: name: StreamWebRTC.xcframework.zip - path: fastlane/StreamWebRTC.xcframework.zip + path: .products/StreamWebRTC.xcframework.zip retention-days: 7 - uses: actions/upload-artifact@v4 - if: always() with: name: WebRTC.xcframework.zip - path: fastlane/WebRTC.xcframework.zip + path: .products/WebRTC.xcframework.zip retention-days: 7 diff --git a/.gitignore b/.gitignore index 1d1fe94..829caab 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ fastlane/report.xml .gclient* fastlane/src .bundle +.build diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index bf1c07c..0000000 --- a/.rubocop.yml +++ /dev/null @@ -1,168 +0,0 @@ ---- -require: -- rubocop/require_tools -- rubocop-performance -AllCops: - TargetRubyVersion: 2.4 - NewCops: enable - Include: - - "**/*.rb" - - "**/*file" -Style/MultipleComparison: - Enabled: false -Style/PercentLiteralDelimiters: - Enabled: false -Style/ClassCheck: - EnforcedStyle: kind_of? -Style/FrozenStringLiteralComment: - Enabled: false -Style/SafeNavigation: - Enabled: false -Performance/RegexpMatch: - Enabled: false -Performance/StringReplacement: - Enabled: false -Style/NumericPredicate: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Naming/VariableNumber: - Enabled: false -Style/MissingRespondToMissing: - Enabled: false -Style/MultilineBlockChain: - Enabled: false -Style/NumericLiteralPrefix: - Enabled: false -Style/TernaryParentheses: - Enabled: false -Style/EmptyMethod: - Enabled: false -Lint/UselessAssignment: - Exclude: - - "**/spec/**/*" -Require/MissingRequireStatement: - Enabled: false -Layout/FirstHashElementIndentation: - Enabled: false -Layout/HashAlignment: - Enabled: false -Layout/DotPosition: - Enabled: false -Style/DoubleNegation: - Enabled: false -Style/SymbolArray: - Enabled: false -Layout/HeredocIndentation: - Enabled: false -Style/MixinGrouping: - Exclude: - - "**/spec/**/*" -Lint/SuppressedException: - Enabled: false -Lint/UnusedBlockArgument: - Enabled: false -Lint/AmbiguousBlockAssociation: - Enabled: false -Style/GlobalVars: - Enabled: false -Style/ClassAndModuleChildren: - Enabled: false -Style/SpecialGlobalVars: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Style/WordArray: - MinSize: 19 -Style/SignalException: - Enabled: false -Style/RedundantReturn: - Enabled: false -Style/IfUnlessModifier: - Enabled: false -Style/AndOr: - Enabled: true - EnforcedStyle: conditionals -Metrics/ClassLength: - Max: 320 -Layout/LineLength: - Max: 370 -Metrics/ParameterLists: - Max: 17 -Metrics/PerceivedComplexity: - Max: 20 -Style/GuardClause: - Enabled: false -Style/StringLiterals: - Enabled: false -Style/ConditionalAssignment: - Enabled: false -Style/RedundantSelf: - Enabled: false -Lint/UnusedMethodArgument: - Enabled: false -Lint/ParenthesesAsGroupedExpression: - Exclude: - - "**/spec/**/*" -Naming/PredicateName: - Enabled: false -Style/PerlBackrefs: - Enabled: false -Naming/FileName: - Exclude: - - "**/Dangerfile" - - "**/Brewfile" - - "**/Gemfile" - - "**/Podfile" - - "**/Rakefile" - - "**/Fastfile" - - "**/Scanfile" - - "**/Matchfile" - - "**/Appfile" - - "**/Allurefile" - - "**/Sonarfile" - - "**/Deliverfile" - - "**/Snapfile" - - "**/Pluginfile" - - "**/*.gemspec" -Style/Documentation: - Enabled: false -Style/MutableConstant: - Enabled: false -Style/ZeroLengthPredicate: - Enabled: false -Style/IfInsideElse: - Enabled: false -Style/CollectionMethods: - Enabled: false -Style/MethodCallWithArgsParentheses: - Enabled: true - IgnoredMethods: - - require - - require_relative - - fastlane_require - - gem - - program - - command - - raise - - attr_accessor - - attr_reader - - desc - - lane - - private_lane - - platform - - to - - not_to - - describe - - it - - be - - context - - before - - after - - and diff --git a/Gemfile b/Gemfile deleted file mode 100644 index c7f6b13..0000000 --- a/Gemfile +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } - -gem 'cocoapods' -gem 'fastlane' -gem 'json' -gem 'plist' -gem 'rubocop', '1.38' -gem 'rubocop-performance' -gem 'rubocop-require_tools' - -plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') -eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 10444a2..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,340 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.7) - base64 - nkf - rexml - activesupport (7.2.2.1) - base64 - benchmark (>= 0.3) - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - algoliasearch (1.27.5) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - artifactory (3.0.17) - ast (2.4.3) - atomos (0.1.3) - aws-eventstream (1.3.2) - aws-partitions (1.1084.0) - aws-sdk-core (3.222.1) - aws-eventstream (~> 1, >= 1.3.0) - aws-partitions (~> 1, >= 1.992.0) - aws-sigv4 (~> 1.9) - base64 - jmespath (~> 1, >= 1.6.1) - logger - aws-sdk-kms (1.99.0) - aws-sdk-core (~> 3, >= 3.216.0) - aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.183.0) - aws-sdk-core (~> 3, >= 3.216.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.5) - aws-sigv4 (1.11.0) - aws-eventstream (~> 1, >= 1.0.2) - babosa (1.0.4) - base64 (0.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) - claide (1.1.0) - cocoapods (1.16.2) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.16.2) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 2.1, < 3.0) - cocoapods-plugins (>= 1.0.0, < 2.0) - cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.6.0, < 2.0) - cocoapods-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 2.3.0, < 3.0) - xcodeproj (>= 1.27.0, < 2.0) - cocoapods-core (1.16.2) - activesupport (>= 5.0, < 8) - addressable (~> 2.8) - algoliasearch (~> 1.0) - concurrent-ruby (~> 1.1) - fuzzy_match (~> 2.0.4) - nap (~> 1.0) - netrc (~> 0.11) - public_suffix (~> 4.0) - typhoeus (~> 1.0) - cocoapods-deintegrate (1.0.5) - cocoapods-downloader (2.1) - cocoapods-plugins (1.0.0) - nap - cocoapods-search (1.0.1) - cocoapods-trunk (1.6.0) - nap (>= 0.8, < 2.0) - netrc (~> 0.11) - cocoapods-try (1.2.0) - colored (1.2) - colored2 (3.1.2) - commander (4.6.0) - highline (~> 2.0.0) - concurrent-ruby (1.3.5) - connection_pool (2.5.0) - declarative (0.0.20) - digest-crc (0.7.0) - rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20240107) - dotenv (2.8.1) - drb (2.2.1) - emoji_regex (3.2.3) - escape (0.0.4) - ethon (0.16.0) - ffi (>= 1.15.0) - excon (0.112.0) - faraday (1.10.4) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - 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-multipart (1.1.0) - multipart-post (~> 2.0) - faraday-net_http (1.0.2) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.1) - faraday (~> 1.0) - fastimage (2.4.0) - fastlane (2.227.1) - 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 (~> 1.2) - 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) - fastlane-sirp (>= 1.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) - google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-env (>= 1.6.0, < 2.0.0) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - http-cookie (~> 1.0.5) - json (< 3.0.0) - jwt (>= 2.1.0, < 3) - mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (>= 2.0.0, < 3.0.0) - naturally (~> 2.2) - optparse (>= 0.1.1, < 1.0.0) - plist (>= 3.1.0, < 4.0.0) - rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.5) - simctl (~> 1.6.3) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (~> 3) - 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.4.1) - xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) - fastlane-plugin-stream_actions (0.3.76) - xctest_list (= 1.2.1) - fastlane-sirp (1.0.0) - sysrandom (~> 1.0) - ffi (1.17.1-arm64-darwin) - fourflusher (2.3.1) - fuzzy_match (2.0.4) - gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.54.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.3) - 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 - google-apis-iamcredentials_v1 (0.17.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-playcustomapp_v1 (0.13.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.31.0) - google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.8.0) - google-cloud-env (>= 1.0, < 3.a) - google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.5.0) - google-cloud-storage (1.47.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.31.0) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.8.1) - faraday (>= 0.17.3, < 3.a) - jwt (>= 1.4, < 3.0) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.0.3) - http-cookie (1.0.8) - domain_name (~> 0.5) - httpclient (2.9.0) - mutex_m - i18n (1.14.7) - concurrent-ruby (~> 1.0) - jmespath (1.6.2) - json (2.10.2) - jwt (2.10.1) - base64 - logger (1.7.0) - mini_magick (4.13.2) - mini_mime (1.1.5) - minitest (5.25.5) - molinillo (0.8.0) - multi_json (1.15.0) - multipart-post (2.4.1) - mutex_m (0.3.0) - nanaimo (0.4.0) - nap (1.1.0) - naturally (2.2.1) - netrc (0.11.0) - nkf (0.2.0) - optparse (0.6.0) - os (1.1.4) - parallel (1.26.3) - parser (3.3.7.4) - ast (~> 2.4.1) - racc - plist (3.7.2) - prism (1.4.0) - public_suffix (4.0.7) - racc (1.8.1) - rainbow (3.1.1) - rake (13.2.1) - regexp_parser (2.10.0) - representable (3.2.0) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.4.1) - rouge (3.28.0) - rubocop (1.38.0) - json (~> 2.3) - parallel (~> 1.10) - parser (>= 3.1.2.1) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.44.0) - parser (>= 3.3.7.2) - prism (~> 1.4) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-require_tools (0.1.2) - rubocop (>= 0.49.1) - ruby-macho (2.5.1) - ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - rubyzip (2.4.1) - securerandom (0.4.1) - security (0.1.5) - signet (0.19.0) - addressable (~> 2.8) - faraday (>= 0.17.5, < 3.a) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.10) - CFPropertyList - naturally - sysrandom (1.0.5) - terminal-notifier (2.0.0) - terminal-table (3.0.2) - unicode-display_width (>= 1.1.1, < 3) - trailblazer-option (0.1.2) - tty-cursor (0.7.1) - tty-screen (0.8.2) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - typhoeus (1.4.1) - ethon (>= 0.9.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - uber (0.1.0) - unicode-display_width (2.6.0) - word_wrap (1.0.0) - xcodeproj (1.27.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.4.0) - rexml (>= 3.3.6, < 4.0) - xcpretty (0.4.1) - rouge (~> 3.28.0) - xcpretty-travis-formatter (1.0.1) - xcpretty (~> 0.2, >= 0.0.7) - xctest_list (1.2.1) - -PLATFORMS - arm64-darwin-21 - arm64-darwin-23 - -DEPENDENCIES - cocoapods - fastlane - fastlane-plugin-stream_actions (= 0.3.76) - json - plist - rubocop (= 1.38) - rubocop-performance - rubocop-require_tools - -BUNDLED WITH - 2.5.10 diff --git a/fastlane/Fastfile b/fastlane/Fastfile deleted file mode 100644 index 6bc3a2d..0000000 --- a/fastlane/Fastfile +++ /dev/null @@ -1,188 +0,0 @@ -default_platform :ios -skip_docs - -require 'json' -require 'net/http' - -github_repo = ENV['GITHUB_REPOSITORY'] || 'GetStream/stream-video-swift-webrtc' -sdk_name = 'WebRTC' -modified_sdk_name = 'StreamWebRTC' -swift_package_path = '../Package.swift' -podspec_path = 'StreamWebRTC.podspec' - -before_all do |lane| - if is_ci - setup_ci - setup_git_config - end -end - -lane :code_review do - sh('bundle exec rubocop Fastfile') -end - -lane :build do |options| - code_review - - ['*.zip', '*.xcframework'].each { |f| sh("rm -rf #{f}") } - xcframework_path = build_xcframework(branch: options[:webrtc_branch]) - modified_xcframework_path = clone_and_modify_xcframework(file_path: xcframework_path) - - match_me - - [xcframework_path, modified_xcframework_path].each { |path| sign_xcframework(file_path: path) } - - zip_xcframework_path = zip_xcframework(file_path: xcframework_path) - zip_modified_xcframework_path = zip_xcframework(file_path: modified_xcframework_path) - sh("swift package compute-checksum #{zip_xcframework_path}").strip - sh("swift package compute-checksum #{zip_modified_xcframework_path}").strip -end - -# Available options: -# - version: The version number for the release (required) -# - webrtc_branch: The branch of WebRTC to build from (optional) -# -# Example usage: -# bundle exec fastlane release version:125.6422.065 webrtc_branch:"patch/m125" -lane :release do |options| - UI.user_error!("You must specify an xcframework version") unless options[:version] - UI.user_error!("Tag for version #{options[:version]} already exists!") if git_tag_exists(tag: options[:version]) - UI.success("Ignore the red warning above. Tag for version #{options[:version]} is alright!") - - code_review - - ['*.zip', '*.xcframework'].each { |f| sh("rm -rf #{f}") } - xcframework_path = build_xcframework(branch: options[:webrtc_branch]) - modified_xcframework_path = clone_and_modify_xcframework(file_path: xcframework_path) - - match_me - - [xcframework_path, modified_xcframework_path].each { |path| sign_xcframework(file_path: path) } - - zip_xcframework_path = zip_xcframework(file_path: xcframework_path) - zip_modified_xcframework_path = zip_xcframework(file_path: modified_xcframework_path) - - sh("swift package compute-checksum #{zip_xcframework_path}").strip - checksum = sh("swift package compute-checksum #{zip_modified_xcframework_path}").strip - - version_bump_podspec(path: podspec_path, version_number: options[:version]) - - file_data = '' - File.readlines(swift_package_path).each do |line| - checksum_pattern = /(checksum: ")[a-z0-9]+(")/ - url_pattern = %r{(releases/download/)[.0-9]+(/)} - - formatted_line = - if line.match(checksum_pattern) - line.gsub(checksum_pattern, "\\1#{checksum}\\2") - elsif line.match(url_pattern) - line.gsub(url_pattern, "\\1#{options[:version]}\\2") - else - line - end - - file_data << formatted_line - end - - File.open(swift_package_path, 'w') { |file| file << file_data } - - sh('git add -A') - sh("git commit -m 'Bump #{options[:version]}'") - sh('git push') - - publish_ios_sdk( - skip_pods: options[:skip_pods], - skip_git_status_check: false, - github_repo: github_repo, - sdk_names: [modified_sdk_name], - version: options[:version], - changelog: "Upgrade to WebRTC v#{options[:version]}\n\nChecksum: #{checksum}", - upload_assets: [zip_xcframework_path, zip_modified_xcframework_path] - ) -end - -private_lane :build_xcframework do |options| - sh("./build_xcframework.sh #{options[:branch]}") - current_path = File.expand_path('src/out_ios_libs/WebRTC.xcframework') - new_path = "./#{File.basename(current_path)}" - FileUtils.mv(current_path, new_path) - File.expand_path(new_path) -end - -private_lane :clone_and_modify_xcframework do |options| - old_framework_path = File.expand_path(options[:file_path]) - new_framework_path = old_framework_path.gsub(/#{sdk_name}/, modified_sdk_name) - - # Rename the framework itself - sh("cp -R #{old_framework_path} #{new_framework_path}") - - # Rename all files with the old framework name with the new one - ["#{sdk_name}.framework", "#{sdk_name}.h", sdk_name].each do |file_name| - Dir.glob("#{new_framework_path}/**/*").each do |old_file_path| - next unless File.basename(old_file_path) == file_name - - new_file_path = old_file_path.reverse.sub(sdk_name.reverse, modified_sdk_name.reverse).reverse - File.rename(old_file_path, new_file_path) - end - end - - # Replace all occurrences of the old framework name with the new one in the plist and modulemap files - Dir.glob(["#{new_framework_path}/**/Info.plist", "#{new_framework_path}/**/module.modulemap"]).each do |file| - sh("plutil -convert xml1 #{file}") if file.include?('Info.plist') - old_text = File.read(file) - new_text = old_text.gsub(/#{sdk_name}/, modified_sdk_name) - File.open(file, 'w') { |f| f.puts(new_text) } if old_text != new_text - end - - # Replace all imports of the old framework with the new one - Dir.glob("#{new_framework_path}/**/*.h").each do |file| - old_text = File.read(file) - new_text = old_text.gsub(/import <#{sdk_name}/, "import <#{modified_sdk_name}") - File.open(file, 'w') { |f| f.puts(new_text) } if old_text != new_text - end - - # Rename the rpath for all the frameworks and update symlinks if required - framework_paths = new_framework_path.include?('.xcframework') ? Dir.glob("#{new_framework_path}/**/*.framework") : [new_framework_path] - framework_paths.each do |path| - Dir.chdir(path) do - if File.symlink?(modified_sdk_name) - old_symlink = File.readlink(modified_sdk_name) - new_symlink = old_symlink.reverse.sub(sdk_name.reverse, modified_sdk_name.reverse).reverse - - File.delete(modified_sdk_name) - File.symlink(new_symlink, modified_sdk_name) - end - - sh("install_name_tool -id @rpath/#{modified_sdk_name}.framework/#{modified_sdk_name} #{modified_sdk_name}") - end - end - new_framework_path -end - -private_lane :sign_xcframework do |options| - team_id = File.read('Matchfile').match(/team_id\("(.*)"\)/)[1] - sh("codesign --force --timestamp -v --sign 'Apple Distribution: Stream.io Inc (#{team_id})' #{options[:file_path]}") -end - -private_lane :zip_xcframework do |options| - zip_path = "#{options[:file_path]}.zip" - sh("ditto -c -k --sequesterRsrc --keepParent #{options[:file_path]} #{zip_path}") - zip_path -end - -private_lane :appstore_api_key do - @appstore_api_key ||= app_store_connect_api_key( - key_id: 'MT3PRT8TB7', - issuer_id: '69a6de96-0738-47e3-e053-5b8c7c11a4d1', - key_content: ENV.fetch('APPSTORE_API_KEY', nil), - in_house: false - ) -end - -private_lane :match_me do - custom_match( - api_key: appstore_api_key, - app_identifier: ['io.getstream.iOS.VideoDemoApp'], # dummy app to get the certificates - readonly: true - ) -end diff --git a/fastlane/Matchfile b/fastlane/Matchfile deleted file mode 100644 index f26ef45..0000000 --- a/fastlane/Matchfile +++ /dev/null @@ -1,5 +0,0 @@ -git_url("git@github.com:GetStream/ios-certificates.git") - -storage_mode("git") - -team_id("EHV7XZLAHA") diff --git a/fastlane/Pluginfile b/fastlane/Pluginfile deleted file mode 100644 index b19e588..0000000 --- a/fastlane/Pluginfile +++ /dev/null @@ -1,5 +0,0 @@ -# Autogenerated by fastlane -# -# Ensure this file is checked in to source control! - -gem 'fastlane-plugin-stream_actions', '0.3.76' diff --git a/fastlane/build_xcframework.sh b/fastlane/build_xcframework.sh deleted file mode 100755 index b948f1c..0000000 --- a/fastlane/build_xcframework.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash - -if ! command -v gclient &> /dev/null; then - current_dir=$(pwd) - mkdir $HOME/webrtc - cd $HOME/webrtc - git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git - export PATH=$PATH:$HOME/webrtc/depot_tools - cd $current_dir -fi - -rm -rf src -rm -rf .cipd -rm -rf .gcs_entries - -if [ -n "$1" ]; then - git clone -b "$1" https://github.com/GetStream/webrtc.git src -else - git clone https://github.com/GetStream/webrtc.git src -fi - -gclient root -gclient config --spec 'solutions = [ -{ - "name": "src", - "url": "git@github.com:GetStream/webrtc.git", - "deps_file": "DEPS", - "managed": False, - "custom_deps": {}, -}, -] -target_os = ["ios", "mac"] -' -gclient sync - -cd src -./tools_webrtc/ios/build_ios_libs.py \ - --deployment-target 13.0 \ - --extra-gn-args \ - is_debug=false \ - use_goma=false \ - use_rtti=true \ - rtc_libvpx_build_vp9=true