fastlane-plugin-stream_actions 0.1.13 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/stream_actions/actions/custom_match.rb +2 -2
- data/lib/fastlane/plugin/stream_actions/actions/is_check_required.rb +6 -5
- data/lib/fastlane/plugin/stream_actions/actions/read_changelog.rb +1 -3
- data/lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb +159 -0
- data/lib/fastlane/plugin/stream_actions/actions/testflight_build.rb +125 -0
- data/lib/fastlane/plugin/stream_actions/actions/update_testplan.rb +10 -7
- data/lib/fastlane/plugin/stream_actions/version.rb +1 -1
- metadata +9 -7
- data/lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb +0 -48
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: af1d94514c2d3fc5e6de1be36819a669dd210316016d6f1724722ef337e72603
         | 
| 4 | 
            +
              data.tar.gz: 1dd2ee983d552514d090a4f09900300fe8a5df4bac091123b7b4d097a9954d2b
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 347bd253d9443b5bb14683ac93fc4408ddf6e34bd43060db1699e18d2d5ceaf8eadb1eb6addfa970e69713c0302926c614b30315f3b0b3492b590a96803655ac
         | 
| 7 | 
            +
              data.tar.gz: 8e2e9b4ef242c8f3eff526fd212dac0f6fc99ae0231a6659bc526dddfed7130f54d7b89494a5eba6b3449635dd181aa7ef3417f8a8b2287d0c463f8092674e4f
         | 
| @@ -25,7 +25,7 @@ module Fastlane | |
| 25 25 | 
             
                  #####################################################
         | 
| 26 26 |  | 
| 27 27 | 
             
                  def self.description
         | 
| 28 | 
            -
                    ' | 
| 28 | 
            +
                    'Installs or recreates all Certs and Profiles necessary for development and ad-hoc and registers a new device if required'
         | 
| 29 29 | 
             
                  end
         | 
| 30 30 |  | 
| 31 31 | 
             
                  def self.available_options
         | 
| @@ -35,7 +35,7 @@ module Fastlane | |
| 35 35 | 
             
                        description: 'AppStore Connect API Key',
         | 
| 36 36 | 
             
                        is_string: false,
         | 
| 37 37 | 
             
                        verify_block: proc do |api_key|
         | 
| 38 | 
            -
                          UI.user_error!('AppStore Connect API Key has to be specified')  | 
| 38 | 
            +
                          UI.user_error!('AppStore Connect API Key has to be specified') if api_key.nil? || api_key.empty? || !api_key.kind_of?(Hash)
         | 
| 39 39 | 
             
                        end
         | 
| 40 40 | 
             
                      ),
         | 
| 41 41 | 
             
                      FastlaneCore::ConfigItem.new(
         | 
| @@ -2,11 +2,11 @@ module Fastlane | |
| 2 2 | 
             
              module Actions
         | 
| 3 3 | 
             
                class IsCheckRequiredAction < Action
         | 
| 4 4 | 
             
                  def self.run(params)
         | 
| 5 | 
            -
                    return true  | 
| 5 | 
            +
                    return true if params[:github_pr_num].nil? || params[:github_pr_num].empty?
         | 
| 6 6 |  | 
| 7 7 | 
             
                    UI.message("Checking if check is required for PR ##{params[:github_pr_num]}")
         | 
| 8 8 |  | 
| 9 | 
            -
                    changed_files = sh("gh pr view #{params[:github_pr_num]} --json files -q '.files[].path'").split("\n")
         | 
| 9 | 
            +
                    changed_files = Actions.sh("gh pr view #{params[:github_pr_num]} --json files -q '.files[].path'").split("\n")
         | 
| 10 10 |  | 
| 11 11 | 
             
                    return true if changed_files.size == 100 # TODO: https://github.com/cli/cli/issues/5368
         | 
| 12 12 |  | 
| @@ -31,14 +31,15 @@ module Fastlane | |
| 31 31 | 
             
                        key: :sources,
         | 
| 32 32 | 
             
                        description: 'Array of paths to scan',
         | 
| 33 33 | 
             
                        is_string: false,
         | 
| 34 | 
            -
                        verify_block: proc do | | 
| 35 | 
            -
                          UI.user_error!("Sources have to be specified") unless  | 
| 34 | 
            +
                        verify_block: proc do |array|
         | 
| 35 | 
            +
                          UI.user_error!("Sources have to be specified") unless array.kind_of?(Array) && array.size.positive?
         | 
| 36 36 | 
             
                        end
         | 
| 37 37 | 
             
                      ),
         | 
| 38 38 | 
             
                      FastlaneCore::ConfigItem.new(
         | 
| 39 39 | 
             
                        env_name: 'GITHUB_PR_NUM',
         | 
| 40 40 | 
             
                        key: :github_pr_num,
         | 
| 41 | 
            -
                        description: 'GitHub PR number'
         | 
| 41 | 
            +
                        description: 'GitHub PR number',
         | 
| 42 | 
            +
                        optional: true
         | 
| 42 43 | 
             
                      )
         | 
| 43 44 | 
             
                    ]
         | 
| 44 45 | 
             
                  end
         | 
| @@ -2,8 +2,6 @@ module Fastlane | |
| 2 2 | 
             
              module Actions
         | 
| 3 3 | 
             
                class ReadChangelogAction < Action
         | 
| 4 4 | 
             
                  def self.run(params)
         | 
| 5 | 
            -
                    UI.user_error!('You need to pass the version of the release you want to obtain the changelog from') unless params[:version]
         | 
| 6 | 
            -
             | 
| 7 5 | 
             
                    UI.message("Getting changelog for #{params[:version]}")
         | 
| 8 6 | 
             
                    reading_changelog = false
         | 
| 9 7 | 
             
                    changes = ''
         | 
| @@ -38,7 +36,7 @@ module Fastlane | |
| 38 36 | 
             
                        key: :version,
         | 
| 39 37 | 
             
                        description: 'Release version',
         | 
| 40 38 | 
             
                        verify_block: proc do |v|
         | 
| 41 | 
            -
                          UI.user_error!("You need to pass the version of the release you want to obtain the changelog from")  | 
| 39 | 
            +
                          UI.user_error!("You need to pass the version of the release you want to obtain the changelog from") if v.nil? || v.empty?
         | 
| 42 40 | 
             
                        end
         | 
| 43 41 | 
             
                      ),
         | 
| 44 42 | 
             
                      FastlaneCore::ConfigItem.new(
         | 
| @@ -0,0 +1,159 @@ | |
| 1 | 
            +
            module Fastlane
         | 
| 2 | 
            +
              module Actions
         | 
| 3 | 
            +
                class ReleaseIosSdkAction < Action
         | 
| 4 | 
            +
                  def self.run(params)
         | 
| 5 | 
            +
                    ensure_everything_is_set_up(params)
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                    version_number = ''
         | 
| 8 | 
            +
                    params[:sdk_names].each do |target|
         | 
| 9 | 
            +
                      version_number = other_action.increment_version_number_in_plist(
         | 
| 10 | 
            +
                        target: target,
         | 
| 11 | 
            +
                        version_number: params[:version],
         | 
| 12 | 
            +
                        bump_type: params[:bump_type]
         | 
| 13 | 
            +
                      )
         | 
| 14 | 
            +
                    end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                    ensure_release_tag_is_new(version_number)
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                    changes = other_action.read_changelog(version: version_number, changelog_path: params[:changelog_path])
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                    podspecs = []
         | 
| 21 | 
            +
                    params[:sdk_names].each { |sdk| podspecs << "#{sdk}.podspec" }
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                    podspecs.each do |podspec|
         | 
| 24 | 
            +
                      UI.user_error!("Podspec #{podspec} does not exist!") unless File.exist?(podspec)
         | 
| 25 | 
            +
                      other_action.pod_lib_lint(podspec: podspec, allow_warnings: true) unless params[:skip_pod_list]
         | 
| 26 | 
            +
                      other_action.version_bump_podspec(path: podspec, version_number: version_number)
         | 
| 27 | 
            +
                    end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                    commit_changes(version_number)
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                    release_details = other_action.set_github_release(
         | 
| 32 | 
            +
                      repository_name: params[:github_repo],
         | 
| 33 | 
            +
                      api_token: params[:github_token],
         | 
| 34 | 
            +
                      name: version_number,
         | 
| 35 | 
            +
                      tag_name: version_number,
         | 
| 36 | 
            +
                      description: changes,
         | 
| 37 | 
            +
                      commitish: ENV['BRANCH_NAME'] || other_action.git_branch
         | 
| 38 | 
            +
                    )
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                    podspecs.each { |podspec| pod_push_safely(podspec: podspec, sync: params[:pod_sync] & true) }
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                    UI.success("Github release v#{version_number} was created, please visit #{release_details['html_url']} to see it! 🚢")
         | 
| 43 | 
            +
                  end
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                  def self.ensure_everything_is_set_up(params)
         | 
| 46 | 
            +
                    other_action.ensure_git_branch(branch: 'main') if params[:check_release_branch]
         | 
| 47 | 
            +
                    other_action.ensure_git_status_clean if params[:check_git_status]
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                    if params[:version].nil? && !["patch", "minor", "major"].include?(params[:bump_type])
         | 
| 50 | 
            +
                      UI.user_error!("Please use type parameter with one of the options: type:patch, type:minor, type:major")
         | 
| 51 | 
            +
                    end
         | 
| 52 | 
            +
                  end
         | 
| 53 | 
            +
             | 
| 54 | 
            +
                  def self.ensure_release_tag_is_new(version_number)
         | 
| 55 | 
            +
                    if other_action.git_tag_exists(tag: version_number)
         | 
| 56 | 
            +
                      UI.user_error!("Tag for version #{version_number} already exists!")
         | 
| 57 | 
            +
                    else
         | 
| 58 | 
            +
                      UI.success("Ignore the red warning above. Tag for version #{version_number} is alright!")
         | 
| 59 | 
            +
                    end
         | 
| 60 | 
            +
                  end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
                  def self.commit_changes(version_number)
         | 
| 63 | 
            +
                    sh("git add -A")
         | 
| 64 | 
            +
                    UI.user_error!("Not committing changes") unless other_action.prompt(text: "Will commit changes. All looking good?", boolean: true)
         | 
| 65 | 
            +
             | 
| 66 | 
            +
                    sh("git commit -m 'Bump #{version_number}'")
         | 
| 67 | 
            +
                    UI.user_error!("Not pushing changes") unless other_action.prompt(text: "Will push changes. All looking good?", boolean: true)
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                    other_action.push_to_git_remote(tags: true)
         | 
| 70 | 
            +
                  end
         | 
| 71 | 
            +
             | 
| 72 | 
            +
                  def self.pod_push_safely(params)
         | 
| 73 | 
            +
                    UI.message("Starting to push podspec: #{params[:podspec]}")
         | 
| 74 | 
            +
                    other_action.pod_push(path: params[:podspec], allow_warnings: true, synchronous: params[:sync])
         | 
| 75 | 
            +
                  rescue StandardError => e
         | 
| 76 | 
            +
                    UI.message(e)
         | 
| 77 | 
            +
                    UI.message("pod_push failed for #{params[:podspec]}. Waiting a minute until retry for trunk to get updated...")
         | 
| 78 | 
            +
                    sleep(60) # sleep for a minute, wait until trunk gets updates
         | 
| 79 | 
            +
                    pod_push_safely(params)
         | 
| 80 | 
            +
                  end
         | 
| 81 | 
            +
             | 
| 82 | 
            +
                  #####################################################
         | 
| 83 | 
            +
                  # @!group Documentation
         | 
| 84 | 
            +
                  #####################################################
         | 
| 85 | 
            +
             | 
| 86 | 
            +
                  def self.description
         | 
| 87 | 
            +
                    'Releases iOS SDKs to GitHub and CocoaPods'
         | 
| 88 | 
            +
                  end
         | 
| 89 | 
            +
             | 
| 90 | 
            +
                  def self.available_options
         | 
| 91 | 
            +
                    [
         | 
| 92 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 93 | 
            +
                        key: :version,
         | 
| 94 | 
            +
                        description: 'Release version (not required if release type is set)',
         | 
| 95 | 
            +
                        optional: true
         | 
| 96 | 
            +
                      ),
         | 
| 97 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 98 | 
            +
                        key: :bump_type,
         | 
| 99 | 
            +
                        description: 'Release type (not required if release version is set)',
         | 
| 100 | 
            +
                        optional: true
         | 
| 101 | 
            +
                      ),
         | 
| 102 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 103 | 
            +
                        key: :sdk_names,
         | 
| 104 | 
            +
                        description: 'SDK names to release',
         | 
| 105 | 
            +
                        is_string: false,
         | 
| 106 | 
            +
                        verify_block: proc do |sdks|
         | 
| 107 | 
            +
                          UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
         | 
| 108 | 
            +
                        end
         | 
| 109 | 
            +
                      ),
         | 
| 110 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 111 | 
            +
                        env_name: 'GITHUB_REPOSITORY',
         | 
| 112 | 
            +
                        key: :github_repo,
         | 
| 113 | 
            +
                        description: 'Github repository name'
         | 
| 114 | 
            +
                      ),
         | 
| 115 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 116 | 
            +
                        env_name: 'GITHUB_TOKEN',
         | 
| 117 | 
            +
                        key: :github_token,
         | 
| 118 | 
            +
                        description: 'GITHUB_TOKEN environment variable'
         | 
| 119 | 
            +
                      ),
         | 
| 120 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 121 | 
            +
                        key: :check_git_status,
         | 
| 122 | 
            +
                        description: 'Ensure git status is clean',
         | 
| 123 | 
            +
                        is_string: false,
         | 
| 124 | 
            +
                        default_value: true
         | 
| 125 | 
            +
                      ),
         | 
| 126 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 127 | 
            +
                        key: :check_release_branch,
         | 
| 128 | 
            +
                        description: 'Ensure git branch is main',
         | 
| 129 | 
            +
                        is_string: false,
         | 
| 130 | 
            +
                        default_value: true
         | 
| 131 | 
            +
                      ),
         | 
| 132 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 133 | 
            +
                        key: :skip_pod_list,
         | 
| 134 | 
            +
                        description: 'Skip pod lib lint action',
         | 
| 135 | 
            +
                        is_string: false,
         | 
| 136 | 
            +
                        default_value: false
         | 
| 137 | 
            +
                      ),
         | 
| 138 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 139 | 
            +
                        key: :pod_sync,
         | 
| 140 | 
            +
                        description: 'If validation depends on other recently pushed pods, synchronize',
         | 
| 141 | 
            +
                        is_string: false,
         | 
| 142 | 
            +
                        default_value: false
         | 
| 143 | 
            +
                      ),
         | 
| 144 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 145 | 
            +
                        key: :changelog_path,
         | 
| 146 | 
            +
                        env_name: 'FL_CHANGELOG_PATH',
         | 
| 147 | 
            +
                        description: 'The path to your project CHANGELOG.md',
         | 
| 148 | 
            +
                        is_string: true,
         | 
| 149 | 
            +
                        default_value: './CHANGELOG.md'
         | 
| 150 | 
            +
                      )
         | 
| 151 | 
            +
                    ]
         | 
| 152 | 
            +
                  end
         | 
| 153 | 
            +
             | 
| 154 | 
            +
                  def self.supported?(_platform)
         | 
| 155 | 
            +
                    [:ios].include?(platform)
         | 
| 156 | 
            +
                  end
         | 
| 157 | 
            +
                end
         | 
| 158 | 
            +
              end
         | 
| 159 | 
            +
            end
         | 
| @@ -0,0 +1,125 @@ | |
| 1 | 
            +
            module Fastlane
         | 
| 2 | 
            +
              module Actions
         | 
| 3 | 
            +
                class TestflightBuildAction < Action
         | 
| 4 | 
            +
                  def self.run(params)
         | 
| 5 | 
            +
                    build_number = other_action.latest_testflight_build_number(
         | 
| 6 | 
            +
                      app_identifier: params[:app_identifier],
         | 
| 7 | 
            +
                      api_key: params[:api_key]
         | 
| 8 | 
            +
                    ) + 1
         | 
| 9 | 
            +
                    other_action.increment_build_number(build_number: build_number.to_s)
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    other_action.gym(
         | 
| 12 | 
            +
                      project: params[:xcode_project],
         | 
| 13 | 
            +
                      scheme: params[:app_target],
         | 
| 14 | 
            +
                      configuration: 'Release',
         | 
| 15 | 
            +
                      export_method: 'app-store',
         | 
| 16 | 
            +
                      export_options: params[:testflight_export_options],
         | 
| 17 | 
            +
                      clean: true,
         | 
| 18 | 
            +
                      include_symbols: true,
         | 
| 19 | 
            +
                      output_directory: params[:output_directory]
         | 
| 20 | 
            +
                    )
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                    current_branch = ENV['BRANCH_NAME'] || other_action.git_branch
         | 
| 23 | 
            +
                    external_groups = current_branch == 'main' ? ['Public Link'] : []
         | 
| 24 | 
            +
                    other_action.pilot(
         | 
| 25 | 
            +
                      api_key: params[:api_key],
         | 
| 26 | 
            +
                      team_id: '118902954',
         | 
| 27 | 
            +
                      app_identifier: params[:app_identifier],
         | 
| 28 | 
            +
                      app_platform: 'ios',
         | 
| 29 | 
            +
                      ipa: lane_context[SharedValues::IPA_OUTPUT_PATH],
         | 
| 30 | 
            +
                      groups: external_groups,
         | 
| 31 | 
            +
                      distribute_external: external_groups.any?,
         | 
| 32 | 
            +
                      notify_external_testers: external_groups.any?,
         | 
| 33 | 
            +
                      reject_build_waiting_for_review: true,
         | 
| 34 | 
            +
                      changelog: testflight_instructions(params)
         | 
| 35 | 
            +
                    )
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                    if params[:github_pr_num]
         | 
| 38 | 
            +
                      message = "Build for regression testing №#{build_number} has been uploaded to TestFlight 🎁"
         | 
| 39 | 
            +
                      sh("gh pr comment #{params[:github_pr_num]} -b '#{message}'")
         | 
| 40 | 
            +
                    end
         | 
| 41 | 
            +
                  end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
                  def self.testflight_instructions(params)
         | 
| 44 | 
            +
                    version_number = other_action.get_version_number(target: params[:sdk_target])[/\d+\.\d+\.\d/]
         | 
| 45 | 
            +
                    if ENV['GITHUB_EVENT_NAME'] == 'pull_request'
         | 
| 46 | 
            +
                      sha = ENV['GITHUB_SHA'] ? ENV['GITHUB_SHA'][0..8] : sh('git rev-parse --short HEAD')
         | 
| 47 | 
            +
                      "This is the build for Regression testing on release candidate v#{version_number} (sha: #{sha})."
         | 
| 48 | 
            +
                    else
         | 
| 49 | 
            +
                      "This is the official sample app built with iOS #{params[:sdk_target]} SDK v#{version_number}. It's designed " \
         | 
| 50 | 
            +
                        'to highlight engaging features and new improvements to the SDK, but remember that this is just one ' \
         | 
| 51 | 
            +
                        'possible implementation. You can start your own by borrowing and customizing the code from this ' \
         | 
| 52 | 
            +
                        "sample, or build something completely different using Stream's components."
         | 
| 53 | 
            +
                    end
         | 
| 54 | 
            +
                  end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                  #####################################################
         | 
| 57 | 
            +
                  # @!group Documentation
         | 
| 58 | 
            +
                  #####################################################
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                  def self.description
         | 
| 61 | 
            +
                    'Builds a DemoApp and uploads it to TestFlight'
         | 
| 62 | 
            +
                  end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                  def self.available_options
         | 
| 65 | 
            +
                    [
         | 
| 66 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 67 | 
            +
                        key: :api_key,
         | 
| 68 | 
            +
                        description: 'AppStore Connect API Key',
         | 
| 69 | 
            +
                        is_string: false,
         | 
| 70 | 
            +
                        verify_block: proc do |api_key|
         | 
| 71 | 
            +
                          UI.user_error!('AppStore Connect API Key has to be specified') if api_key.nil? || api_key.empty?
         | 
| 72 | 
            +
                        end
         | 
| 73 | 
            +
                      ),
         | 
| 74 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 75 | 
            +
                        key: :xcode_project,
         | 
| 76 | 
            +
                        description: 'Path to the Xcode project',
         | 
| 77 | 
            +
                        verify_block: proc do |path|
         | 
| 78 | 
            +
                          UI.user_error!('Path to the Xcode project has to be specified') if path.nil? || path.empty?
         | 
| 79 | 
            +
                        end
         | 
| 80 | 
            +
                      ),
         | 
| 81 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 82 | 
            +
                        key: :sdk_target,
         | 
| 83 | 
            +
                        description: 'SDK target name',
         | 
| 84 | 
            +
                        verify_block: proc do |target|
         | 
| 85 | 
            +
                          UI.user_error!('SDK target name has to be specified') if target.nil? || target.empty?
         | 
| 86 | 
            +
                        end
         | 
| 87 | 
            +
                      ),
         | 
| 88 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 89 | 
            +
                        key: :app_target,
         | 
| 90 | 
            +
                        description: 'DemoApp target name',
         | 
| 91 | 
            +
                        verify_block: proc do |target|
         | 
| 92 | 
            +
                          UI.user_error!('DemoApp target name has to be specified') if target.nil? || target.empty?
         | 
| 93 | 
            +
                        end
         | 
| 94 | 
            +
                      ),
         | 
| 95 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 96 | 
            +
                        key: :app_identifier,
         | 
| 97 | 
            +
                        description: 'DemoApp bundle identifier',
         | 
| 98 | 
            +
                        verify_block: proc do |id|
         | 
| 99 | 
            +
                          UI.user_error!('DemoApp bundle identifier has to be specified') if id.nil? || id.empty?
         | 
| 100 | 
            +
                        end
         | 
| 101 | 
            +
                      ),
         | 
| 102 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 103 | 
            +
                        key: :testflight_export_options,
         | 
| 104 | 
            +
                        description: 'We have to pass manually since `gym` detects profiles from `match` and that breaks it',
         | 
| 105 | 
            +
                        default_value: './fastlane/testflight_export_options.plist'
         | 
| 106 | 
            +
                      ),
         | 
| 107 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 108 | 
            +
                        key: :output_directory,
         | 
| 109 | 
            +
                        description: 'Output directory for the build',
         | 
| 110 | 
            +
                        default_value: 'archives'
         | 
| 111 | 
            +
                      ),
         | 
| 112 | 
            +
                      FastlaneCore::ConfigItem.new(
         | 
| 113 | 
            +
                        env_name: 'GITHUB_PR_NUM',
         | 
| 114 | 
            +
                        key: :github_pr_num,
         | 
| 115 | 
            +
                        description: 'GitHub PR number'
         | 
| 116 | 
            +
                      )
         | 
| 117 | 
            +
                    ]
         | 
| 118 | 
            +
                  end
         | 
| 119 | 
            +
             | 
| 120 | 
            +
                  def self.supported?(_platform)
         | 
| 121 | 
            +
                    true
         | 
| 122 | 
            +
                  end
         | 
| 123 | 
            +
                end
         | 
| 124 | 
            +
              end
         | 
| 125 | 
            +
            end
         | 
| @@ -4,14 +4,17 @@ module Fastlane | |
| 4 4 | 
             
                  def self.run(params)
         | 
| 5 5 | 
             
                    data_hash = JSON.parse(File.read(params[:path]))
         | 
| 6 6 |  | 
| 7 | 
            -
                    # Create the `environmentVariableEntries` array if it doesn't exist
         | 
| 8 7 | 
             
                    data_hash['defaultOptions']['environmentVariableEntries'] ||= []
         | 
| 9 8 |  | 
| 10 | 
            -
                     | 
| 9 | 
            +
                    if params[:env_vars].kind_of?(Hash)
         | 
| 10 | 
            +
                      data_hash['defaultOptions']['environmentVariableEntries'] << params[:env_vars]
         | 
| 11 | 
            +
                    else
         | 
| 12 | 
            +
                      params[:env_vars].each { |env| data_hash['defaultOptions']['environmentVariableEntries'] << env }
         | 
| 13 | 
            +
                    end
         | 
| 14 | 
            +
             | 
| 11 15 | 
             
                    File.write(params[:path], JSON.pretty_generate(data_hash))
         | 
| 12 16 |  | 
| 13 | 
            -
                    UI. | 
| 14 | 
            -
                    UI.message("👀 #{params[:path]} ENV variables:\n#{data_hash['defaultOptions']['environmentVariableEntries']}")
         | 
| 17 | 
            +
                    UI.message("👀 Testplan environment variables:\n#{data_hash['defaultOptions']['environmentVariableEntries']}")
         | 
| 15 18 | 
             
                  end
         | 
| 16 19 |  | 
| 17 20 | 
             
                  #####################################################
         | 
| @@ -19,7 +22,7 @@ module Fastlane | |
| 19 22 | 
             
                  #####################################################
         | 
| 20 23 |  | 
| 21 24 | 
             
                  def self.description
         | 
| 22 | 
            -
                    ' | 
| 25 | 
            +
                    'Adds environment variables to a test plan'
         | 
| 23 26 | 
             
                  end
         | 
| 24 27 |  | 
| 25 28 | 
             
                  def self.available_options
         | 
| @@ -35,8 +38,8 @@ module Fastlane | |
| 35 38 | 
             
                        key: :env_vars,
         | 
| 36 39 | 
             
                        description: 'The environment variables to add to test plan',
         | 
| 37 40 | 
             
                        is_string: false,
         | 
| 38 | 
            -
                        verify_block: proc do | | 
| 39 | 
            -
                          UI.user_error!("The environment variables array should not be empty") if  | 
| 41 | 
            +
                        verify_block: proc do |env_vars|
         | 
| 42 | 
            +
                          UI.user_error!("The environment variables array should not be empty") if env_vars.nil? || env_vars.empty?
         | 
| 40 43 | 
             
                        end
         | 
| 41 44 | 
             
                      )
         | 
| 42 45 | 
             
                    ]
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: fastlane-plugin-stream_actions
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.15
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - GetStream
         | 
| @@ -128,14 +128,14 @@ dependencies: | |
| 128 128 | 
             
                requirements:
         | 
| 129 129 | 
             
                - - '='
         | 
| 130 130 | 
             
                  - !ruby/object:Gem::Version
         | 
| 131 | 
            -
                    version: 1. | 
| 131 | 
            +
                    version: '1.38'
         | 
| 132 132 | 
             
              type: :development
         | 
| 133 133 | 
             
              prerelease: false
         | 
| 134 134 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 135 135 | 
             
                requirements:
         | 
| 136 136 | 
             
                - - '='
         | 
| 137 137 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 | 
            -
                    version: 1. | 
| 138 | 
            +
                    version: '1.38'
         | 
| 139 139 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 140 140 | 
             
              name: rubocop-performance
         | 
| 141 141 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -184,14 +184,14 @@ dependencies: | |
| 184 184 | 
             
                requirements:
         | 
| 185 185 | 
             
                - - '='
         | 
| 186 186 | 
             
                  - !ruby/object:Gem::Version
         | 
| 187 | 
            -
                    version: 2. | 
| 187 | 
            +
                    version: 2.15.0
         | 
| 188 188 | 
             
              type: :development
         | 
| 189 189 | 
             
              prerelease: false
         | 
| 190 190 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 191 191 | 
             
                requirements:
         | 
| 192 192 | 
             
                - - '='
         | 
| 193 193 | 
             
                  - !ruby/object:Gem::Version
         | 
| 194 | 
            -
                    version: 2. | 
| 194 | 
            +
                    version: 2.15.0
         | 
| 195 195 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 196 196 | 
             
              name: simplecov
         | 
| 197 197 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -230,15 +230,17 @@ files: | |
| 230 230 | 
             
            - lib/fastlane/plugin/stream_actions.rb
         | 
| 231 231 | 
             
            - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
         | 
| 232 232 | 
             
            - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
         | 
| 233 | 
            -
            - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
         | 
| 234 233 | 
             
            - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
         | 
| 234 | 
            +
            - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
         | 
| 235 235 | 
             
            - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb
         | 
| 236 | 
            +
            - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
         | 
| 236 237 | 
             
            - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb
         | 
| 237 238 | 
             
            - lib/fastlane/plugin/stream_actions/actions/update_testplan.rb
         | 
| 238 239 | 
             
            - lib/fastlane/plugin/stream_actions/version.rb
         | 
| 239 240 | 
             
            homepage: https://github.com/GetStream/fastlane-plugin-stream_actions
         | 
| 240 241 | 
             
            licenses: []
         | 
| 241 | 
            -
            metadata: | 
| 242 | 
            +
            metadata:
         | 
| 243 | 
            +
              rubygems_mfa_required: 'true'
         | 
| 242 244 | 
             
            post_install_message:
         | 
| 243 245 | 
             
            rdoc_options: []
         | 
| 244 246 | 
             
            require_paths:
         | 
| @@ -1,48 +0,0 @@ | |
| 1 | 
            -
            module Fastlane
         | 
| 2 | 
            -
              module Actions
         | 
| 3 | 
            -
                class PodPushSafelyAction < Action
         | 
| 4 | 
            -
                  def self.run(params)
         | 
| 5 | 
            -
                    pod_push_safely(params)
         | 
| 6 | 
            -
                  end
         | 
| 7 | 
            -
             | 
| 8 | 
            -
                  def self.pod_push_safely(params)
         | 
| 9 | 
            -
                    UI.message("Starting to push podspec: #{params[:podspec]}")
         | 
| 10 | 
            -
                    other_action.pod_push(path: params[:podspec], allow_warnings: true, synchronous: params[:sync])
         | 
| 11 | 
            -
                  rescue StandardError => e
         | 
| 12 | 
            -
                    UI.message(e)
         | 
| 13 | 
            -
                    UI.message("pod_push failed for #{params[:podspec]}. Waiting a minute until retry for trunk to get updated...")
         | 
| 14 | 
            -
                    sleep(60) # sleep for a minute, wait until trunk gets updates
         | 
| 15 | 
            -
                    pod_push_safely(params)
         | 
| 16 | 
            -
                  end
         | 
| 17 | 
            -
             | 
| 18 | 
            -
                  #####################################################
         | 
| 19 | 
            -
                  # @!group Documentation
         | 
| 20 | 
            -
                  #####################################################
         | 
| 21 | 
            -
             | 
| 22 | 
            -
                  def self.description
         | 
| 23 | 
            -
                    'Releases pod to cocoapods trunk'
         | 
| 24 | 
            -
                  end
         | 
| 25 | 
            -
             | 
| 26 | 
            -
                  def self.available_options
         | 
| 27 | 
            -
                    [
         | 
| 28 | 
            -
                      FastlaneCore::ConfigItem.new(
         | 
| 29 | 
            -
                        key: :podspec,
         | 
| 30 | 
            -
                        description: 'Podspec path',
         | 
| 31 | 
            -
                        verify_block: proc do |pod|
         | 
| 32 | 
            -
                          UI.user_error!("Podspec path has to be specified") unless pod
         | 
| 33 | 
            -
                        end
         | 
| 34 | 
            -
                      ),
         | 
| 35 | 
            -
                      FastlaneCore::ConfigItem.new(
         | 
| 36 | 
            -
                        key: :sync,
         | 
| 37 | 
            -
                        description: 'When `sync` is false, pod trunk push is run asynchronously',
         | 
| 38 | 
            -
                        is_string: false
         | 
| 39 | 
            -
                      )
         | 
| 40 | 
            -
                    ]
         | 
| 41 | 
            -
                  end
         | 
| 42 | 
            -
             | 
| 43 | 
            -
                  def self.supported?(_platform)
         | 
| 44 | 
            -
                    [:ios].include?(platform)
         | 
| 45 | 
            -
                  end
         | 
| 46 | 
            -
                end
         | 
| 47 | 
            -
              end
         | 
| 48 | 
            -
            end
         |