fastlane-plugin-emerge 0.5.0 → 0.6.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: 86bc85e26613527f77ae725575824b2d4c2dd5dde9ab0814f716ab8efd4875c0
4
- data.tar.gz: 3fcd9202ed9ca7d5ff16b221ad9c9d0e0e7af1cc2febbadb6e8f96cf8c498ca6
3
+ metadata.gz: f84892f800a40e25a4b867e178edb8619c24864a4b9ff9670470270ea227969c
4
+ data.tar.gz: b8749428f0e193bf816b8dae1dc9e3f10ace668eb86ab3e1e6992d61438995cc
5
5
  SHA512:
6
- metadata.gz: 330252fc7c00bdba4a91bd9a206dad404886c8d99631a3cc3da5efe6ee1b55e46cc0e298441fa54f5807f881cb395baf3fe3400da63c983b13182f9c25d52e2b
7
- data.tar.gz: abce90f5e848cad8c840f0d94130518ed318b776af6543d75bc73105dac295667fabf4aaff68aa06e72ae00a89956eec7f725ed54d06d460005fe396dfa3723f
6
+ metadata.gz: 93d799a5679ba33a333028db9f30217da3742ca2af4cc24c4c792a1c3c06122ee3bc2f79c79ff0f5f2306513a079ab280f586204618deeb5a50fa6953eae363b
7
+ data.tar.gz: 86718d6dc29e96ce1fbe78d6198dfcb5dde0fcdadadd63d6f87d1040672fa3d8f73c4171f059615afca40536a217b2f2b283f6cb8262aa68be07f73071538775
@@ -23,6 +23,8 @@ module Fastlane
23
23
  repo_name = params[:repo_name]
24
24
  gitlab_project_id = params[:gitlab_project_id]
25
25
  build_type = params[:build_type]
26
+ order_file_version = params[:order_file_version]
27
+ config_path = params[:config_path]
26
28
 
27
29
  if file_path == nil || !File.exist?(file_path)
28
30
  UI.error("Invalid input file")
@@ -45,6 +47,7 @@ module Fastlane
45
47
  FileUtils.cp(l, linkmap_folder)
46
48
  end
47
49
  end
50
+ copy_config(config_path, "#{d}/archive.xcarchive")
48
51
  FileUtils.cp_r(file_path, application_folder)
49
52
  copy_dsyms("#{absolute_path.dirname}/*.dsym", dsym_folder)
50
53
  copy_dsyms("#{absolute_path.dirname}/*/*.dsym", dsym_folder)
@@ -66,6 +69,7 @@ module Fastlane
66
69
  FileUtils.cp(l, linkmap_folder)
67
70
  end
68
71
  end
72
+ copy_config(config_path, file_path)
69
73
  Actions::ZipAction.run(
70
74
  path: file_path,
71
75
  output_path: zip_path,
@@ -102,6 +106,9 @@ module Fastlane
102
106
  if gitlab_project_id
103
107
  params[:gitlabProjectId] = gitlab_project_id
104
108
  end
109
+ if order_file_version
110
+ params[:orderFileVersion] = order_file_version
111
+ end
105
112
  params[:buildType] = build_type || "development"
106
113
  FastlaneCore::PrintTable.print_values(
107
114
  config: params,
@@ -132,6 +139,13 @@ module Fastlane
132
139
  end
133
140
  end
134
141
 
142
+ def self.copy_config(config_path, tmp_dir)
143
+ if config_path != nil && File.exist?(config_path)
144
+ emerge_config_path = "#{tmp_dir}/emerge_config.yaml"
145
+ FileUtils.cp(config_path, emerge_config_path)
146
+ end
147
+ end
148
+
135
149
  def self.description
136
150
  "Fastlane plugin for Emerge"
137
151
  end
@@ -178,7 +192,7 @@ module Fastlane
178
192
  optional: true,
179
193
  type: String),
180
194
  FastlaneCore::ConfigItem.new(key: :base_sha,
181
- description: "The git SHA of the base build. This parameter does not need to be set if you’re using the Github integration",
195
+ description: "The git SHA of the base build",
182
196
  optional: true,
183
197
  type: String),
184
198
  FastlaneCore::ConfigItem.new(key: :build_id,
@@ -202,7 +216,15 @@ module Fastlane
202
216
  FastlaneCore::ConfigItem.new(key: :build_type,
203
217
  description: "String to identify the type of build such as release/development. Used to filter size graphs. Defaults to development",
204
218
  optional: true,
205
- type: String)
219
+ type: String),
220
+ FastlaneCore::ConfigItem.new(key: :order_file_version,
221
+ description: "Version of the order file to download",
222
+ optional: true,
223
+ type: String),
224
+ FastlaneCore::ConfigItem.new(key: :config_path,
225
+ description: "Path to Emerge config path",
226
+ optional: true,
227
+ type: String),
206
228
  ]
207
229
  end
208
230
 
@@ -7,7 +7,8 @@ module Fastlane
7
7
  module Actions
8
8
  class EmergeOrderFileAction < Action
9
9
  def self.run(params)
10
- resp = Faraday.get("https://order-files-prod.emergetools.com/#{params[:app_id]}", nil, {'X-API-Token' => params[:api_token]})
10
+ puts "https://order-files-prod.emergetools.com/#{params[:app_id]}/#{params[:order_file_version]}"
11
+ resp = Faraday.get("https://order-files-prod.emergetools.com/#{params[:app_id]}/#{params[:order_file_version]}", nil, {'X-API-Token' => params[:api_token]})
11
12
  case resp.status
12
13
  when 200
13
14
  Tempfile.create do |f|
@@ -15,13 +16,20 @@ module Fastlane
15
16
  decompressed = IO.popen(['gunzip', '-c', f.path]).read
16
17
  IO.write(params[:output_path], decompressed)
17
18
  end
19
+ return 200
18
20
  when 401
19
21
  UI.error("Unauthorized")
22
+ when 403
23
+ UI.message("No order file found, this is expected for the first build of an app_id/version.")
24
+ # The API will return a 403 when no order file is found, but we change that to a 200 for the
25
+ # fastlane plugin because this is an expected state for a CI integraion.
26
+ return 200
20
27
  else
21
28
  UI.error("Failed to download order file code: #{resp.status}")
22
29
  end
23
-
30
+ resp.status
24
31
  end
32
+
25
33
  def self.description
26
34
  "Fastlane plugin to download order files"
27
35
  end
@@ -53,7 +61,11 @@ module Fastlane
53
61
  FastlaneCore::ConfigItem.new(key: :output_path,
54
62
  description: "Path to the order file",
55
63
  optional: false,
56
- type: String)
64
+ type: String),
65
+ FastlaneCore::ConfigItem.new(key: :order_file_version,
66
+ description: "Version of the order file to download",
67
+ optional: false,
68
+ type: String),
57
69
  ]
58
70
  end
59
71
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Emerge
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.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.5.0
4
+ version: 0.6.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: 2022-03-14 00:00:00.000000000 Z
11
+ date: 2023-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday