fastlane-plugin-waldo 3.2.0 → 3.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8382365c0ea6f5bbeb6bf55302d06ff08b9c2b58f20b70a65a7519b6c6b19a7d
4
- data.tar.gz: 6e9cadfb12cea129d362cda805ced4e6b3bb96b4b075af5345ce794f886d6b88
3
+ metadata.gz: 61a207f81867b5afd0d775f89c1163c9358959f1f592483ad831fec7feab20c4
4
+ data.tar.gz: 81d52d2dd53e75eda4a4cbb13eb1489b6354acdee33f267133d5ffcac2eda74c
5
5
  SHA512:
6
- metadata.gz: c53abad57353855c54c9dec994b3af36234db443df0552c7a8e3e9fe7e52d1414359b3dd5f59bcb445d9dfeabf457ab1a52eac891ba5f9a0dd78a604b9e875ff
7
- data.tar.gz: 2baeb36edcc08caf4a51318eb6d6d9b0566ba9bfdfc035b8cb5c3a2378474b7c17788951792664ba0d0bfb7b08df3dfa76b0d4823f5fb7b67eb8b7f10a7201fa
6
+ metadata.gz: b14f679bfd115f896155351731c64711c697f0eb08b16dd878baaeb1ee2edb5107958c65bf443edfa36569fc7bfe75eeeb62f9c5a4a9c76cc275430d62925b0a
7
+ data.tar.gz: 239ab8f569a592c3d891f2f79319a9bb86d0e461edfd03c05eaeaafc317e28b5db858ebde2d4800f33aad04705212b867c9eb55ad1234b388dc67f3ff8166be9
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- © 2018–2022 Amolo Atelier, Inc.
3
+ © 2018–2023 Amolo Atelier, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -59,27 +59,6 @@ waldo(upload_token: '0123456789abcdef0123456789abcdef',
59
59
  > **Note:** You _must_ specify _both_ the Waldo upload token _and_ the path of
60
60
  > the `.app`.
61
61
 
62
- ### Uploading an iOS Device Build
63
-
64
- Build a new IPA for your app. If you use `gym` (aka `build_ios_app`) to build
65
- your IPA, `waldo` will automatically find and upload the generated IPA.
66
-
67
- ```ruby
68
- gym(export_method: 'ad-hoc') # or 'development'
69
-
70
- waldo(upload_token: '0123456789abcdef0123456789abcdef')
71
- ```
72
-
73
- > **Note:** You _must_ specify the Waldo upload token.
74
-
75
- If you do _not_ use `gym` to build your IPA, you will need to explicitly
76
- specify the IPA path to `waldo`:
77
-
78
- ```ruby
79
- waldo(upload_token: '0123456789abcdef0123456789abcdef',
80
- ipa_path: '/path/to/YourApp.ipa')
81
- ```
82
-
83
62
  ### Uploading an Android Build
84
63
 
85
64
  Build a new APK for your app. If you use `gradle` to build your APK, `waldo`
@@ -21,12 +21,6 @@ module Fastlane
21
21
  env_name: 'WALDO_APP_PATH',
22
22
  description: 'Path to your app file',
23
23
  optional: true),
24
- FastlaneCore::ConfigItem.new(key: :ipa_path,
25
- env_name: 'WALDO_IPA_PATH',
26
- description: 'Path to your IPA file (optional if you use the _gym_ or _xcodebuild_ action)',
27
- default_value: Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH],
28
- default_value_dynamic: true,
29
- optional: true),
30
24
  # Android-specific
31
25
  FastlaneCore::ConfigItem.new(key: :apk_path,
32
26
  env_name: 'WALDO_APK_PATH',
@@ -73,10 +67,6 @@ module Fastlane
73
67
  apk_path: './YourApp.apk',
74
68
  upload_token: '...'
75
69
  )",
76
- "waldo(
77
- ipa_path: './YourApp.ipa',
78
- upload_token: '...'
79
- )",
80
70
  "waldo(
81
71
  app_path: './YourApp.app',
82
72
  upload_token: '...'
@@ -30,7 +30,7 @@ module Fastlane
30
30
  "waldo-agent-#{os}-#{arch}#{ext}"
31
31
  end
32
32
 
33
- def self.download(uri, path)
33
+ def self.download(uri, path, retryAllowed)
34
34
  begin
35
35
  request_uri = uri.request_uri
36
36
  response = nil
@@ -43,14 +43,26 @@ module Fastlane
43
43
  uri = URI.parse(response['location'])
44
44
  end
45
45
 
46
+ code = response.code.to_i
47
+
48
+ if code < 200 || code > 299
49
+ UI.error("Unable to download #{request_uri}, HTTP status: #{response.code}")
50
+
51
+ return retryAllowed && shouldRetry?(response)
52
+ end
53
+
46
54
  fp = File.open(path, 'wb')
47
55
 
48
56
  fp.write(response.body)
49
57
  rescue => exc
50
58
  UI.error("Unable to download #{request_uri}: #{exc.inspect.to_s}")
59
+
60
+ return retryAllowed
51
61
  ensure
52
62
  fp.close if fp
53
63
  end
64
+
65
+ return false
54
66
  end
55
67
 
56
68
  def self.download_binary
@@ -62,7 +74,15 @@ module Fastlane
62
74
 
63
75
  binary_path = File.join(Dir.tmpdir, 'waldo-agent')
64
76
 
65
- download(URI(uri_string), binary_path)
77
+ maxDownloadAttempts = 2
78
+
79
+ for attempts in 1..maxDownloadAttempts do
80
+ doRetry = download(URI(uri_string), binary_path, attempts < maxDownloadAttempts)
81
+
82
+ break unless doRetry
83
+
84
+ UI.message("Failed download attempts: #{attempts} -- retrying…")
85
+ end
66
86
 
67
87
  File.chmod(0755, binary_path)
68
88
 
@@ -76,39 +96,14 @@ module Fastlane
76
96
  app_path = in_params[:app_path]
77
97
  git_branch = in_params[:git_branch]
78
98
  git_commit = in_params[:git_commit]
79
- ipa_path = in_params[:ipa_path]
80
99
  upload_token = in_params[:upload_token]
81
100
  variant_name = in_params[:variant_name] || Actions.lane_context[Actions::SharedValues::GRADLE_BUILD_TYPE]
82
101
 
83
102
  apk_path.gsub!('\\ ', ' ') if apk_path
84
103
  app_path.gsub!('\\ ', ' ') if app_path
85
- ipa_path.gsub!('\\ ', ' ') if ipa_path
86
104
 
87
105
  out_params[:apk_path] = apk_path if apk_path
88
-
89
- if app_path && ipa_path
90
- if !File.exist?(app_path)
91
- out_params[:ipa_path] = ipa_path
92
-
93
- app_path = nil
94
- elsif !File.exist?(ipa_path)
95
- out_params[:app_path] = app_path
96
-
97
- ipa_path = nil
98
- elsif File.mtime(app_path) < File.mtime(ipa_path)
99
- out_params[:ipa_path] = ipa_path
100
-
101
- app_path = nil
102
- else
103
- out_params[:app_path] = app_path
104
-
105
- ipa_path = nil
106
- end
107
- else
108
- out_params[:app_path] = app_path if app_path
109
- out_params[:ipa_path] = ipa_path if ipa_path
110
- end
111
-
106
+ out_params[:app_path] = app_path if app_path
112
107
  out_params[:git_branch] = git_branch if git_branch
113
108
  out_params[:git_commit] = git_commit if git_commit
114
109
  out_params[:upload_token] = upload_token if upload_token
@@ -117,17 +112,18 @@ module Fastlane
117
112
  out_params
118
113
  end
119
114
 
115
+ def self.shouldRetry?(response)
116
+ [408, 429, 500, 502, 503, 504].include?(response.code.to_i)
117
+ end
118
+
120
119
  def self.upload_build(params)
121
120
  apk_path = params[:apk_path]
122
121
  app_path = params[:app_path]
123
- ipa_path = params[:ipa_path]
124
122
 
125
123
  if apk_path
126
124
  build_path = apk_path
127
125
  elsif app_path
128
126
  build_path = app_path
129
- elsif ipa_path
130
- build_path = ipa_path
131
127
  else
132
128
  build_path = ''
133
129
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Waldo
3
- VERSION = "3.2.0"
3
+ VERSION = "3.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-waldo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Pusey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-26 00:00:00.000000000 Z
11
+ date: 2023-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description:
70
- email: john@waldo.io
70
+ email: john@waldo.com
71
71
  executables: []
72
72
  extensions: []
73
73
  extra_rdoc_files: []
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
- rubygems_version: 3.0.3.1
100
+ rubygems_version: 3.1.6
101
101
  signing_key:
102
102
  specification_version: 4
103
103
  summary: Upload build to Waldo