fastlane-plugin-emerge 0.3.3 → 0.4.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: cc17f46cfc65d4e32951d958932fbbfed3d8c5e535545e65f4b94a3a1810fe3c
4
- data.tar.gz: 007d7e6bf3ae00ac20eafea8a661bdd634adb37ad130c757ed3ff14db17c18cd
3
+ metadata.gz: 47c07cc0fbda1c835f0ae0f3b1719aea68de191a28d614d4d2552835a611c90c
4
+ data.tar.gz: 13b5463f6997f22e1ed988929b3a3a7c40913ee6f91725a7bef0dbafd2cc03fe
5
5
  SHA512:
6
- metadata.gz: c273d5faa4ad923ee625b0d132691ed2859a71722ce52ba96750c076b872bb055e31884dec53b12ec7d043750f5d9c7673015b15cef262e0c5a4d4b8ca7390bf
7
- data.tar.gz: 0a16f5257de169978011cdc472dec9d1f7e3d0af27a419c2b9130a77c2b480b68b03521895edcbb2ae8003835036df1874f53b7f8f7473ed1ac013f140c4f0ab
6
+ metadata.gz: 37f44ee6483d12df8a2e0a7493f3955cce64852aa0aad5465a3036c9c3deb7784c2e171359ccebe2d249e0911c542cfa05ff96ef246228ea18afe965b63cc251
7
+ data.tar.gz: fd22b473450105e6e8e736f4f5d4db31fbcb3b71c64ace912f99b7b929f26d18fad1230cff744461afcdf52e8c36c501ca79388329c8dc4fd512dd8dfdf69122
@@ -3,6 +3,7 @@ require 'fastlane_core/print_table'
3
3
  require_relative '../helper/emerge_helper'
4
4
  require 'pathname'
5
5
  require 'tmpdir'
6
+ require 'json'
6
7
  require 'fileutils'
7
8
 
8
9
  module Fastlane
@@ -16,13 +17,14 @@ module Fastlane
16
17
  file_path = Dir.glob("#{lane_context[SharedValues::SCAN_DERIVED_DATA_PATH]}/Build/Products/Debug-iphonesimulator/*.app").first
17
18
  end
18
19
  pr_number = params[:pr_number]
19
- build_id = params[:build_id]
20
- base_build_id = params[:base_build_id]
20
+ branch = params[:branch]
21
+ sha = params[:sha] || params[:build_id]
22
+ base_sha = params[:base_sha] || params[:base_build_id]
21
23
  repo_name = params[:repo_name]
22
24
  gitlab_project_id = params[:gitlab_project_id]
23
25
  build_type = params[:build_type]
24
26
 
25
- if !File.exist?(file_path)
27
+ if file_path == nil || !File.exist?(file_path)
26
28
  UI.error("Invalid input file")
27
29
  return
28
30
  end
@@ -61,19 +63,22 @@ module Fastlane
61
63
  return
62
64
  end
63
65
 
64
- fileName = File.basename(file_path)
65
- url = 'https://api.emergetools.com/getUpload'
66
+ filename = File.basename(file_path)
67
+ url = 'https://api.emergetools.com/upload'
66
68
  params = {
67
- fileName: fileName,
69
+ filename: filename,
68
70
  }
69
71
  if pr_number
70
72
  params[:prNumber] = pr_number
71
73
  end
72
- if build_id
73
- params[:buildId] = build_id
74
+ if branch
75
+ params[:branch] = branch
74
76
  end
75
- if base_build_id
76
- params[:baseBuildId] = base_build_id
77
+ if sha
78
+ params[:sha] = sha
79
+ end
80
+ if base_sha
81
+ params[:baseSha] = base_sha
77
82
  end
78
83
  if repo_name
79
84
  params[:repoName] = repo_name
@@ -86,7 +91,7 @@ module Fastlane
86
91
  config: params,
87
92
  hide_keys: [],
88
93
  title: "Summary for Emerge #{Fastlane::Emerge::VERSION}")
89
- resp = Faraday.get(url, params, {'X-API-Token' => api_token})
94
+ resp = Faraday.post(url, params.to_json, {'Content-Type' => 'application/json', 'X-API-Token' => api_token})
90
95
  case resp.status
91
96
  when 200
92
97
  json = JSON.parse(resp.body)
@@ -144,12 +149,26 @@ module Fastlane
144
149
  description: "The PR number that triggered this upload",
145
150
  optional: true,
146
151
  type: String),
152
+ FastlaneCore::ConfigItem.new(key: :branch,
153
+ description: "The current git branch",
154
+ optional: true,
155
+ type: String),
156
+ FastlaneCore::ConfigItem.new(key: :sha,
157
+ description: "The git SHA that triggered this build",
158
+ optional: true,
159
+ type: String),
160
+ FastlaneCore::ConfigItem.new(key: :base_sha,
161
+ description: "The git SHA of the base build. This parameter does not need to be set if you’re using the Github integration",
162
+ optional: true,
163
+ type: String),
147
164
  FastlaneCore::ConfigItem.new(key: :build_id,
148
165
  description: "A string to identify this build",
166
+ deprecated: "Replaced by `sha`",
149
167
  optional: true,
150
168
  type: String),
151
169
  FastlaneCore::ConfigItem.new(key: :base_build_id,
152
170
  description: "Id of the build to compare with this upload",
171
+ deprecated: "Replaced by `base_sha`",
153
172
  optional: true,
154
173
  type: String),
155
174
  FastlaneCore::ConfigItem.new(key: :repo_name,
@@ -161,7 +180,7 @@ module Fastlane
161
180
  optional: true,
162
181
  type: Integer),
163
182
  FastlaneCore::ConfigItem.new(key: :build_type,
164
- description: "Type of build, either release or development. Defaults to development",
183
+ description: "String to identify the type of build such as release/development. Used to filter size graphs. Defaults to development",
165
184
  optional: true,
166
185
  type: String)
167
186
  ]
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Emerge
3
- VERSION = "0.3.3"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-emerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emerge Tools, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday