fastlane-plugin-waldo 3.0.0 → 3.2.0

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: dd88e9f3a32bde7a83c70b6988a3683af7c896cc57a63f6d77942265eb7517fe
4
- data.tar.gz: a1f9c1fda4daf3705237de99eafa7bc2de6486a939e7545234a3792ab1a89b9b
3
+ metadata.gz: 8382365c0ea6f5bbeb6bf55302d06ff08b9c2b58f20b70a65a7519b6c6b19a7d
4
+ data.tar.gz: 6e9cadfb12cea129d362cda805ced4e6b3bb96b4b075af5345ce794f886d6b88
5
5
  SHA512:
6
- metadata.gz: 3e0613f158f9d570bbb1a0314f5cf1c16fe5d6976ea8abd2ab3ac686249ee47a4624e6b74fcaa4bf369846fa1bf9343131c16a9916fc4f062b2d14b7a56e7907
7
- data.tar.gz: daf65861ab2f031479f0e713f217b68686dd0133f619c1d7fb24b1dd4d9acb403da6781aa799dfbc58a5bae5432faa65e4df40e512a38aafa90639916e58afd5
6
+ metadata.gz: c53abad57353855c54c9dec994b3af36234db443df0552c7a8e3e9fe7e52d1414359b3dd5f59bcb445d9dfeabf457ab1a52eac891ba5f9a0dd78a604b9e875ff
7
+ data.tar.gz: 2baeb36edcc08caf4a51318eb6d6d9b0566ba9bfdfc035b8cb5c3a2378474b7c17788951792664ba0d0bfb7b08df3dfa76b0d4823f5fb7b67eb8b7f10a7201fa
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- © 2018 Amolo Atelier, Inc.
3
+ © 2018–2022 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
@@ -1,6 +1,74 @@
1
1
  module Fastlane
2
2
  module Helper
3
3
  class WaldoHelper
4
+ require 'net/http'
5
+
6
+ def self.determine_asset_name
7
+ platform = RUBY_PLATFORM.downcase
8
+
9
+ if platform.include?('linux')
10
+ ext = ''
11
+ os = 'linux'
12
+ elsif platform.include?('darwin')
13
+ ext = ''
14
+ os = 'macos'
15
+ elsif platform.include?('mswin')
16
+ ext = '.exe'
17
+ os = 'windows'
18
+ else
19
+ UI.error("Unsupported platform: #{platform}")
20
+ end
21
+
22
+ if platform.include?('arm64')
23
+ arch = 'arm64'
24
+ elsif platform.include?('x86_64')
25
+ arch = 'x86_64'
26
+ else
27
+ UI.error("Unsupported platform: #{platform}")
28
+ end
29
+
30
+ "waldo-agent-#{os}-#{arch}#{ext}"
31
+ end
32
+
33
+ def self.download(uri, path)
34
+ begin
35
+ request_uri = uri.request_uri
36
+ response = nil
37
+
38
+ loop do
39
+ response = Net::HTTP.get_response(uri)
40
+
41
+ break unless response.is_a?(Net::HTTPRedirection)
42
+
43
+ uri = URI.parse(response['location'])
44
+ end
45
+
46
+ fp = File.open(path, 'wb')
47
+
48
+ fp.write(response.body)
49
+ rescue => exc
50
+ UI.error("Unable to download #{request_uri}: #{exc.inspect.to_s}")
51
+ ensure
52
+ fp.close if fp
53
+ end
54
+ end
55
+
56
+ def self.download_binary
57
+ asset_name = determine_asset_name
58
+
59
+ uri_string = 'https://github.com/waldoapp/waldo-go-agent/releases/latest/download/'
60
+
61
+ uri_string += asset_name
62
+
63
+ binary_path = File.join(Dir.tmpdir, 'waldo-agent')
64
+
65
+ download(URI(uri_string), binary_path)
66
+
67
+ File.chmod(0755, binary_path)
68
+
69
+ binary_path
70
+ end
71
+
4
72
  def self.filter_parameters(in_params)
5
73
  out_params = {}
6
74
 
@@ -12,9 +80,9 @@ module Fastlane
12
80
  upload_token = in_params[:upload_token]
13
81
  variant_name = in_params[:variant_name] || Actions.lane_context[Actions::SharedValues::GRADLE_BUILD_TYPE]
14
82
 
15
- apk_path.gsub!("\\ ", ' ') if apk_path
16
- app_path.gsub!("\\ ", ' ') if app_path
17
- ipa_path.gsub!("\\ ", ' ') if ipa_path
83
+ apk_path.gsub!('\\ ', ' ') if apk_path
84
+ app_path.gsub!('\\ ', ' ') if app_path
85
+ ipa_path.gsub!('\\ ', ' ') if ipa_path
18
86
 
19
87
  out_params[:apk_path] = apk_path if apk_path
20
88
 
@@ -49,35 +117,6 @@ module Fastlane
49
117
  out_params
50
118
  end
51
119
 
52
- def self.get_binary_path
53
- platform = RUBY_PLATFORM.downcase
54
-
55
- if platform.include?("linux")
56
- ext = ""
57
- os = "linux"
58
- elsif platform.include?("darwin")
59
- ext = ""
60
- os = "macos"
61
- elsif platform.include?("mswin")
62
- ext = ".exe"
63
- os = "windows"
64
- else
65
- UI.error("Unsupported platform: #{platform}")
66
- end
67
-
68
- if platform.include?("arm64")
69
- arch = "arm64"
70
- elsif platform.include?("x86_64")
71
- arch = "x86_64"
72
- else
73
- UI.error("Unsupported platform: #{platform}")
74
- end
75
-
76
- root = Pathname.new(File.expand_path('../../..', __FILE__))
77
-
78
- File.join(root, "waldo", "assets", "waldo-#{os}-#{arch}#{ext}")
79
- end
80
-
81
120
  def self.upload_build(params)
82
121
  apk_path = params[:apk_path]
83
122
  app_path = params[:app_path]
@@ -90,15 +129,16 @@ module Fastlane
90
129
  elsif ipa_path
91
130
  build_path = ipa_path
92
131
  else
93
- build_path = ""
132
+ build_path = ''
94
133
  end
95
134
 
96
135
  command = []
97
136
 
98
- command << "WALDO_WRAPPER_NAME_OVERRIDE='Fastlane'"
137
+ command << "WALDO_WRAPPER_NAME_OVERRIDE='Waldo Fastlane Plugin'"
99
138
  command << "WALDO_WRAPPER_VERSION_OVERRIDE='#{Fastlane::Waldo::VERSION}'"
100
139
 
101
- command << get_binary_path.shellescape
140
+ command << download_binary.shellescape
141
+ command << 'upload'
102
142
 
103
143
  if params[:git_branch]
104
144
  command << '--git_branch'
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Waldo
3
- VERSION = "3.0.0"
3
+ VERSION = "3.2.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.0.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Pusey
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-05 00:00:00.000000000 Z
11
+ date: 2022-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description:
70
70
  email: john@waldo.io
71
71
  executables: []
72
72
  extensions: []
@@ -76,19 +76,13 @@ files:
76
76
  - README.md
77
77
  - lib/fastlane/plugin/waldo.rb
78
78
  - lib/fastlane/plugin/waldo/actions/waldo_action.rb
79
- - lib/fastlane/plugin/waldo/assets/waldo-linux-arm64
80
- - lib/fastlane/plugin/waldo/assets/waldo-linux-x86_64
81
- - lib/fastlane/plugin/waldo/assets/waldo-macos-arm64
82
- - lib/fastlane/plugin/waldo/assets/waldo-macos-x86_64
83
- - lib/fastlane/plugin/waldo/assets/waldo-windows-arm64.exe
84
- - lib/fastlane/plugin/waldo/assets/waldo-windows-x86_64.exe
85
79
  - lib/fastlane/plugin/waldo/helper/waldo_helper.rb
86
80
  - lib/fastlane/plugin/waldo/version.rb
87
81
  homepage: https://github.com/waldoapp/fastlane-plugin-waldo
88
82
  licenses:
89
83
  - MIT
90
84
  metadata: {}
91
- post_install_message:
85
+ post_install_message:
92
86
  rdoc_options: []
93
87
  require_paths:
94
88
  - lib
@@ -103,8 +97,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
97
  - !ruby/object:Gem::Version
104
98
  version: '0'
105
99
  requirements: []
106
- rubygems_version: 3.0.3
107
- signing_key:
100
+ rubygems_version: 3.0.3.1
101
+ signing_key:
108
102
  specification_version: 4
109
103
  summary: Upload build to Waldo
110
104
  test_files: []