fastlane-plugin-testappio 1.0.1 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b0950314e816dce7063d2e41c6d60fb9eecbe32bcacbf6b2f50ed5263cf7d73
4
- data.tar.gz: 4f5c270ea7b0daa6eb0b2219d081c5427b5deab3b7114bd055103ae056850c1a
3
+ metadata.gz: d55de14e5648c1807325ebdea9de2ebf7553a9c61d8a8c7e4f58484409c29dc1
4
+ data.tar.gz: 7d560dce67bef063702fb942b3bbfa508a3a55cf49a98e8b3a7d5e65bb803c1f
5
5
  SHA512:
6
- metadata.gz: f3336879b4e26c8e3e7fc76686f2e38147c095cca73c2a82097a0cacdd416717c2b2f86f5959b80c02ed123d9e8f8c393af19946761d868fd1c0e7093540c788
7
- data.tar.gz: 30ce02cb25454ab214560540c827051181fcd2f26804a3210b76e26add0547881fd78fb41a83030debfdd3f776268b526f01b662185f69ce1b1658a5a5ccc594
6
+ metadata.gz: 57d59c0bd2d320dcec29a97b53a21de3e2cc8290967738dd4591cabfd2317beb03567d8d92823f1bf6b39e10e7e8c4b00a2b23f07ad40408723178ae4dd0f637
7
+ data.tar.gz: 310cc7eb9e585a5b6dbb2eadb28084b921a8a217a50723abd7c365be3f1d02abee51e7427191a5412e7fdfae19f32b61fbeede3aa090359d153868e08b256f03
data/README.md CHANGED
@@ -98,9 +98,9 @@ _Fastlane_ is the easiest way to automate beta deployments and releases for iOS
98
98
 
99
99
  ## Feedback & Support
100
100
 
101
- Developers built [TestApp.io](https://testapp.io) to solve the pain of app distribution for mobile app development teams.
101
+ Developers built [TestApp.io](https://testapp.io) to solve the pain of app distribution & feedback for mobile app development teams.
102
102
 
103
- Join our [Slack](https://join.slack.com/t/testappio/shared_invite/zt-pvpoj3l2-epGYwGTaV3~3~0f7udNWoA) channel for feedback and support.
103
+ Join our [community](https://help.testapp.io/faq/join-our-community/) for feedback and support.
104
104
 
105
105
  Check out our [Help Center](https://help.testapp.io/) for more info and other integrations.
106
106
 
@@ -2,11 +2,15 @@ module Fastlane
2
2
  module Actions
3
3
  class UploadToTestappioAction < Action
4
4
  SUPPORTED_FILE_EXTENSIONS = ["apk", "ipa"]
5
+
5
6
  def self.run(params)
6
- # Check if ta-cli is installed
7
- Helper::TestappioHelper.check_ta_cli
8
7
 
9
- # read the parameters
8
+ # Check if `ta_cli` exists, install it if not
9
+ unless Helper::TestappioHelper.check_ta_cli
10
+ UI.error("Error detecting ta-cli")
11
+ return
12
+ end
13
+
10
14
  api_token = params[:api_token]
11
15
  app_id = params[:app_id]
12
16
  apk_file = params[:apk_file]
@@ -16,36 +20,42 @@ module Fastlane
16
20
  git_release_notes = params[:git_release_notes]
17
21
  git_commit_id = params[:git_commit_id]
18
22
  notify = params[:notify]
23
+ self_update = params[:self_update]
24
+
25
+ # Check if ta-cli needs to be updated
26
+ unless Helper::TestappioHelper.check_update(self_update)
27
+ UI.error("Error updating ta-cli")
28
+ return
29
+ end
19
30
 
20
31
  validate_file_path(apk_file) unless release == "ios"
21
32
  validate_file_path(ipa_file) unless release == "android"
22
33
 
23
- command = ["ta-cli"]
24
- command.push("publish")
25
- command.push("--api_token=#{api_token}")
26
- command.push("--app_id=#{app_id}")
27
- command.push("--release=#{release}")
34
+ command = ["ta-cli", "publish",
35
+ "--api_token=#{api_token}",
36
+ "--app_id=#{app_id}",
37
+ "--release=#{release}"]
38
+
28
39
  command.push("--apk=#{apk_file}") unless release == "ios"
29
40
  command.push("--ipa=#{ipa_file}") unless release == "android"
30
- command.push("--release_notes=#{release_notes}")
31
- command.push("--git_release_notes=#{git_release_notes}")
32
- command.push("--git_commit_id=#{git_commit_id}")
33
- command.push("--notify=#{notify}")
34
- command.push("--source=Fastlane")
41
+
42
+ command += ["--release_notes=#{release_notes}",
43
+ "--git_release_notes=#{git_release_notes}",
44
+ "--git_commit_id=#{git_commit_id}",
45
+ "--notify=#{notify}",
46
+ "--source=Fastlane"]
35
47
 
36
48
  UI.message("Uploading to TestApp.io")
37
49
  Helper::TestappioHelper.call_ta_cli(command)
38
50
  UI.success("Successfully uploaded to TestApp.io!")
39
51
  end
40
52
 
41
- # Validate file_path.
42
53
  def self.validate_file_path(file_path)
43
54
  UI.user_error!("No file found at '#{file_path}'.") unless File.exist?(file_path)
44
55
 
45
- # Validate file extension.
46
- file_path_parts = file_path.split(".")
47
- unless file_path_parts.length > 1 && SUPPORTED_FILE_EXTENSIONS.include?(file_path_parts.last)
48
- UI.user_error!("file_path is invalid, only files with extensions " + SUPPORTED_FILE_EXTENSIONS.to_s + " are allowed to be uploaded.")
56
+ file_ext = File.extname(file_path).delete('.')
57
+ unless SUPPORTED_FILE_EXTENSIONS.include?(file_ext)
58
+ UI.user_error!("file_path is invalid, only files with extensions #{SUPPORTED_FILE_EXTENSIONS} are allowed to be uploaded.")
49
59
  end
50
60
  end
51
61
 
@@ -122,7 +132,13 @@ module Fastlane
122
132
  description: "Send notificaitons to your team members about this release: true or false",
123
133
  optional: true,
124
134
  is_string: false,
125
- default_value: false)
135
+ default_value: false),
136
+ FastlaneCore::ConfigItem.new(key: :self_update,
137
+ env_name: "TESTAPPIO_SELF_UPDATE",
138
+ description: "Automatically update ta-cli if a new version is available or required: true or false",
139
+ optional: true,
140
+ is_string: false,
141
+ default_value: true)
126
142
  ]
127
143
  end
128
144
 
@@ -5,42 +5,86 @@ module Fastlane
5
5
 
6
6
  module Helper
7
7
  class TestappioHelper
8
+
8
9
  # Check if `ta_cli` exists, install it if not
9
10
  def self.check_ta_cli
10
- unless `which ta-cli`.include?('ta-cli')
11
+ unless system('which ta-cli > /dev/null 2>&1')
11
12
  UI.error("ta-cli not found, installing")
12
- UI.command(`curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash`)
13
+
14
+ unless system('curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash')
15
+ UI.error("Error installing ta-cli")
16
+ return false
17
+ end
18
+ end
19
+
20
+ return true
21
+ end
22
+
23
+ # Check if there is an update available for `ta_cli`, and install it if necessary
24
+ def self.check_update(self_update)
25
+ require 'open3'
26
+
27
+ version_output = `ta-cli version`
28
+ UI.verbose(version_output)
29
+
30
+ if version_output.include?("breaking changes")
31
+ if self_update
32
+ UI.message("Updating ta-cli due to breaking changes...")
33
+ else
34
+ UI.user_error!("Update necessary due to breaking changes. Please update ta-cli manually or set self_update to true")
35
+ return false
36
+ end
37
+ elsif version_output.include?("New version available")
38
+ if self_update
39
+ UI.message("Updating ta-cli...")
40
+ else
41
+ UI.error("New version available, but skipping update as self_update is set to false.")
42
+ return true
43
+ end
44
+ else
45
+ UI.success("ta-cli is already up-to-date")
46
+ return true
47
+ end
48
+
49
+ update_command = "curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash"
50
+ update_output, update_errors, update_status = Open3.capture3(update_command)
51
+ UI.verbose(update_output)
52
+
53
+ if update_output.include?("ta-cli successfully installed") || update_output.include?("ta-cli has been updated")
54
+ version_output = `ta-cli version`
55
+ UI.verbose(version_output)
56
+
57
+ if version_output.include?("Update necessary due to breaking changes") || version_output.include?("New version available")
58
+ UI.user_error!("Error updating ta-cli: the version is still outdated")
59
+ return false
60
+ else
61
+ UI.success("ta-cli has been updated successfully")
62
+ return true
63
+ end
64
+ else
65
+ UI.user_error!("Error updating ta-cli: #{update_output}")
66
+ return false
13
67
  end
14
68
  end
15
69
 
16
70
  # Handle errors from `ta_cli`, if contains 'Error', the process stops,
17
71
  # otherwise, just print to user console
18
72
  def self.handle_error(errors)
19
- fatal = false
20
73
  errors.each do |error|
21
74
  if error
22
75
  if error =~ /Error/
23
76
  UI.error(error.to_s)
24
- fatal = true
25
77
  else
26
78
  UI.verbose(error.to_s)
27
79
  end
28
80
  end
29
81
  end
30
- UI.user_error!('Error while calling ta-cli') if fatal
31
- end
32
82
 
33
- def self.handle_force_update(outs, command)
34
- fatal = false
35
- outs.each do |error|
36
- if error
37
- if error =~ /Update is required because of breaking changes/
38
- UI.command(`curl -Ls https://github.com/testappio/cli/releases/latest/download/install | bash`)
39
- call_ta_cli(command)
40
- end
41
- end
83
+ if errors.any? { |e| e =~ /Error/ }
84
+ UI.user_error!('Error while calling ta-cli')
85
+ elsif errors.any?
86
+ UI.user_error!("Error while calling ta-cli: #{errors.join(', ')}")
42
87
  end
43
- UI.user_error!('Error while updating ta-cli') if fatal
44
88
  end
45
89
 
46
90
  # Run the given command
@@ -58,19 +102,17 @@ module Fastlane
58
102
  Open3.popen3(final_command) do |stdin, stdout, stderr, wait_thr|
59
103
  while (line = stdout.gets)
60
104
  out << line
61
- UI.message(line.strip!)
105
+ UI.message(line.strip!) if FastlaneCore::Globals.verbose? && !line.strip.empty?
62
106
  end
63
107
  while (line = stderr.gets)
64
108
  error << line.strip!
65
109
  end
66
110
  exit_status = wait_thr.value
67
- unless exit_status.success? && error.empty?
68
- handle_error(error)
69
- end
70
- handle_force_update(out, command)
111
+ handle_error(error) unless exit_status.success?
71
112
  end
72
113
  out.join
73
114
  end
115
+
74
116
  end
75
117
  end
76
118
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Testappio
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,33 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-testappio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - TestApp.io
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2023-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fastlane
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.204'
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
36
  version: 2.204.3
@@ -35,6 +38,9 @@ dependencies:
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '2.204'
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
46
  version: 2.204.3
@@ -42,58 +48,58 @@ dependencies:
42
48
  name: pry
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
- - - ">="
51
+ - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '0'
53
+ version: '0.13'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - ">="
58
+ - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '0'
60
+ version: '0.13'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: rake
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
- - - ">="
65
+ - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: '0'
67
+ version: '13.0'
62
68
  type: :development
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - ">="
72
+ - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: '0'
74
+ version: '13.0'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: rspec
71
77
  requirement: !ruby/object:Gem::Requirement
72
78
  requirements:
73
- - - ">="
79
+ - - "~>"
74
80
  - !ruby/object:Gem::Version
75
- version: '0'
81
+ version: '3.0'
76
82
  type: :development
77
83
  prerelease: false
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - ">="
86
+ - - "~>"
81
87
  - !ruby/object:Gem::Version
82
- version: '0'
88
+ version: '3.0'
83
89
  - !ruby/object:Gem::Dependency
84
90
  name: rspec_junit_formatter
85
91
  requirement: !ruby/object:Gem::Requirement
86
92
  requirements:
87
- - - ">="
93
+ - - "~>"
88
94
  - !ruby/object:Gem::Version
89
- version: '0'
95
+ version: '0.4'
90
96
  type: :development
91
97
  prerelease: false
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - ">="
100
+ - - "~>"
95
101
  - !ruby/object:Gem::Version
96
- version: '0'
102
+ version: '0.4'
97
103
  - !ruby/object:Gem::Dependency
98
104
  name: rubocop
99
105
  requirement: !ruby/object:Gem::Requirement
@@ -112,44 +118,44 @@ dependencies:
112
118
  name: rubocop-performance
113
119
  requirement: !ruby/object:Gem::Requirement
114
120
  requirements:
115
- - - ">="
121
+ - - "~>"
116
122
  - !ruby/object:Gem::Version
117
- version: '0'
123
+ version: 1.17.1
118
124
  type: :development
119
125
  prerelease: false
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
- - - ">="
128
+ - - "~>"
123
129
  - !ruby/object:Gem::Version
124
- version: '0'
130
+ version: 1.17.1
125
131
  - !ruby/object:Gem::Dependency
126
132
  name: rubocop-require_tools
127
133
  requirement: !ruby/object:Gem::Requirement
128
134
  requirements:
129
- - - ">="
135
+ - - "~>"
130
136
  - !ruby/object:Gem::Version
131
- version: '0'
137
+ version: 0.1.2
132
138
  type: :development
133
139
  prerelease: false
134
140
  version_requirements: !ruby/object:Gem::Requirement
135
141
  requirements:
136
- - - ">="
142
+ - - "~>"
137
143
  - !ruby/object:Gem::Version
138
- version: '0'
144
+ version: 0.1.2
139
145
  - !ruby/object:Gem::Dependency
140
146
  name: simplecov
141
147
  requirement: !ruby/object:Gem::Requirement
142
148
  requirements:
143
- - - ">="
149
+ - - "~>"
144
150
  - !ruby/object:Gem::Version
145
- version: '0'
151
+ version: '0.21'
146
152
  type: :development
147
153
  prerelease: false
148
154
  version_requirements: !ruby/object:Gem::Requirement
149
155
  requirements:
150
- - - ">="
156
+ - - "~>"
151
157
  - !ruby/object:Gem::Version
152
- version: '0'
158
+ version: '0.21'
153
159
  description:
154
160
  email: support@testapp.io
155
161
  executables: []
@@ -174,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
180
  requirements:
175
181
  - - ">="
176
182
  - !ruby/object:Gem::Version
177
- version: '2.5'
183
+ version: '2.6'
178
184
  required_rubygems_version: !ruby/object:Gem::Requirement
179
185
  requirements:
180
186
  - - ">="
181
187
  - !ruby/object:Gem::Version
182
188
  version: '0'
183
189
  requirements: []
184
- rubygems_version: 3.0.3.1
190
+ rubygems_version: 3.4.12
185
191
  signing_key:
186
192
  specification_version: 4
187
193
  summary: Deploy your Android & iOS to TestApp.io