fastlane-plugin-instabug_official 0.2.1 → 0.3

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
- SHA1:
3
- metadata.gz: 29ff81468754f432fd52be59fb0fc1da822b3388
4
- data.tar.gz: 7be9f7181f91b24d09f525135b02372f851a756f
2
+ SHA256:
3
+ metadata.gz: 16c54c18bcc8ec30e49641a6dd11c9427ead1aacef7e20e4b35fc5a3e9953a3a
4
+ data.tar.gz: b1fe30b20109e5ddaaf610f9600f935ce8e83eb58ab80e0d5cc017caebea7a18
5
5
  SHA512:
6
- metadata.gz: 4cfd391852f4d6fac882fbc28fca509f2f8616394736224d5759312548adbaae6973e37cc1e049639c7ff4e84ed63a47788166654fa1e3b70dfda8cd5e31a81c
7
- data.tar.gz: 2e006fb4fffcc7802a734e4bd9acad7455789538e94f074cba4aab2bef046603cac76a9ee3d906daba5b0512feb223ec868369b544422a3edad8ea821d651030
6
+ metadata.gz: 824acdb10f60e0fb1dbf4809cf4cdb8d7812d71fcd3bce1a046d8bd74fb48124fff344224703fe56142ef1d298e4081caae0d1b16d01ba765745eb83c9bdfe81
7
+ data.tar.gz: ac650a1c7329b7d88b6b897e34fbd9f63801cb3e529eb33b547899f03ae238acdf4c9765650e0d1a2507799818fa393c491da1f050d2e884ab6139121937efe3
data/README.md CHANGED
@@ -12,27 +12,20 @@ fastlane add_plugin instabug_official
12
12
 
13
13
  ## About instabug_official
14
14
 
15
- upload dsyms to fastlane
15
+ Upload dSYM files to Instabug
16
16
 
17
- **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
17
+ This action is used to upload symbolication files to Instabug. Incase you are not using bitcode, you can use this plug-in
18
+ with `gym` to upload dSYMs generated from your builds. If bitcode is enabled, you can use it with `download_dsyms` to upload dSYMs
19
+ from iTunes connect
18
20
 
19
21
  ## Example
20
22
 
21
- Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
22
-
23
- **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
-
25
- ## Run tests for this plugin
26
-
27
- To run both the tests, and code style validation, run
28
-
29
23
  ```
30
- rake
24
+ instabug_official(api_token: "<Instabug token>")
31
25
  ```
32
26
 
33
- To automatically fix many of the styling issues, use
34
27
  ```
35
- rubocop -a
28
+ instabug_official(api_token: "<Instabug token>", dsym_array_paths: ["./App1.dSYM.zip", "./App2.dSYM.zip"])
36
29
  ```
37
30
 
38
31
  ## Issues and Feedback
@@ -3,125 +3,131 @@ require 'fastlane/action'
3
3
  require_relative '../helper/instabug_official_helper'
4
4
 
5
5
  module Fastlane
6
- module Actions
7
- class InstabugOfficialAction < Action
8
- def self.run(params)
9
- UI.verbose "Running Instabug Action"
10
- api_token = params[:api_token]
11
-
12
- endpoint = 'https://api.instabug.com/api/sdk/v3/symbols_files'
13
- command = "curl #{endpoint} --write-out %{http_code} --silent --output /dev/null -F os=\"ios\" -F application_token=\"#{api_token}\" -F symbols_file="
14
-
15
- dsym_paths = (params[:dsym_array_paths] || []).uniq
16
- UI.verbose "dsym_paths: " + dsym_paths.inspect
17
-
18
-
19
- if dsym_paths.empty?
20
- directory_name = fastlane_dsyms_filename
21
- if directory_name.empty?
22
- UI.error "Fastlane dSYMs file is not found! make sure you're using Fastlane action [download_dsyms] to download your dSYMs from App Store Connect"
23
- return
24
- end
25
- else
26
- directory_name = generate_directory_name
27
- UI.verbose "Directory name: " + directory_name
28
- copy_dsym_paths_into_directory(dsym_paths, directory_name)
29
- end
30
-
31
- command = build_single_file_command(command, directory_name)
32
-
33
- puts command
34
-
35
- result = Actions.sh(command)
36
- if result == '200'
37
- UI.success 'dSYM is successfully uploaded to Instabug 🤖'
38
- UI.verbose 'Removing The directory'
39
- remove_directory(directory_name)
40
- else
41
- UI.error "Something went wrong during Instabug dSYM upload. Status code is #{result}"
6
+ module Actions
7
+ class InstabugOfficialAction < Action
8
+ def self.run(params)
9
+ @instabug_dsyms_directory = 'Instabug_dsym_files_fastlane'
10
+
11
+ UI.verbose 'Running Instabug Action'
12
+ api_token = params[:api_token]
13
+
14
+ endpoint = 'https://api.instabug.com/api/sdk/v3/symbols_files'
15
+ command = "curl #{endpoint} --write-out %{http_code} --silent --output /dev/null -F os=\"ios\" -F application_token=\"#{api_token}\" -F symbols_file="
16
+
17
+ dsym_paths = []
18
+ # Add paths provided by the user
19
+ dsym_paths += (params[:dsym_array_paths] || [])
20
+ # Add dSYMs generaed by `gym`
21
+ dsym_paths += [Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]] if Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
22
+ # Add dSYMs downloaded from iTC
23
+ dsym_paths += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS]
24
+
25
+ dsym_paths.uniq!
26
+ UI.verbose 'dsym_paths: ' + dsym_paths.inspect
27
+
28
+ if dsym_paths.empty?
29
+ UI.error "Fastlane dSYMs file is not found! make sure you're using Fastlane action [download_dsyms] to download your dSYMs from App Store Connect"
30
+ return
42
31
  end
43
- end
44
-
45
- def self.description
46
- 'upload dsyms to fastlane'
47
- end
48
32
 
49
- def self.authors
50
- ['Instabug Inc.']
51
- end
33
+ generate_instabug_directory
52
34
 
53
- def self.return_value
54
- # If your method provides a return value, you can describe here what it does
55
- end
35
+ UI.verbose 'Directory name: ' + @instabug_dsyms_directory
36
+ copy_dsym_paths_into_directory(dsym_paths, @instabug_dsyms_directory)
56
37
 
57
- def self.details
58
- # Optional:
59
- 'upload dsyms to fastlane'
60
- end
38
+ command = build_single_file_command(command, @instabug_dsyms_directory)
61
39
 
62
- def self.available_options
63
- [
64
- FastlaneCore::ConfigItem.new(key: :api_token,
65
- env_name: 'FL_INSTABUG_API_TOKEN', # The name of the environment variable
66
- description: 'API Token for Instabug', # a short description of this parameter
67
- verify_block: proc do |value|
68
- UI.user_error!("No API token for InstabugAction given, pass using `api_token: 'token'`") unless value && !value.empty?
69
- end),
70
- FastlaneCore::ConfigItem.new(key: :dsym_array_paths,
71
- type: Array,
72
- optional: true,
73
- description: 'Array of paths to *.dSYM files')
74
- ]
75
- end
40
+ result = Actions.sh(command)
41
+ if result == '200'
42
+ UI.success 'dSYM is successfully uploaded to Instabug 🤖'
43
+ UI.verbose 'Removing The directory'
44
+ else
45
+ UI.error "Something went wrong during Instabug dSYM upload. Status code is #{result}"
46
+ end
76
47
 
77
- def self.is_supported?(platform)
78
- platform == :ios
79
- true
80
- end
48
+ # Cleanup zip file and directory
49
+ cleanup_instabug_directory
50
+ end
51
+
52
+ def self.description
53
+ "Upload dSYM files to Instabug"
54
+ end
55
+
56
+ def self.details
57
+ "This action is used to upload symbolication files to Instabug. Incase you are not using bitcode, you can use this plug-in
58
+ with `gym` to upload dSYMs generated from your builds. If bitcode is enabled, you can use it with `download_dsyms` to upload dSYMs
59
+ from iTunes connect"
60
+ end
81
61
 
82
- private
62
+ def self.authors
63
+ ['Instabug Inc.']
64
+ end
83
65
 
84
- def self.generate_directory_name
85
- "Instabug_dsym_files_fastlane"
86
- end
66
+ def self.return_value
67
+ # If your method provides a return value, you can describe here what it does
68
+ end
87
69
 
88
- def self.remove_directory(directory_path)
89
- FileUtils.rm_rf directory_path
90
- end
70
+ def self.example_code
71
+ [
72
+ 'instabug_official(api_token: "<Instabug token>")',
73
+ 'instabug_official(api_token: "<Instabug token>", dsym_array_paths: ["./App1.dSYM.zip", "./App2.dSYM.zip"])'
74
+ ]
75
+ end
91
76
 
92
- def self.copy_dsym_paths_into_directory(dsym_paths, directory_path)
93
- FileUtils.rm "Instabug_dsym_files_fastlane.zip", :force => true
94
- FileUtils.mkdir_p directory_path
95
- dsym_paths.each do |path|
96
- FileUtils.copy_entry(path, "#{directory_path}/#{File.basename(path)}") if File.exist?(path)
97
- end
98
- end
77
+ def self.available_options
78
+ [
79
+ FastlaneCore::ConfigItem.new(key: :api_token,
80
+ env_name: 'FL_INSTABUG_API_TOKEN', # The name of the environment variable
81
+ description: 'API Token for Instabug', # a short description of this parameter
82
+ verify_block: proc do |value|
83
+ unless value && !value.empty?
84
+ UI.user_error!("No API token for InstabugAction given, pass using `api_token: 'token'`")
85
+ end
86
+ end),
87
+ FastlaneCore::ConfigItem.new(key: :dsym_array_paths,
88
+ type: Array,
89
+ optional: true,
90
+ description: 'Array of paths to *.dSYM files')
91
+ ]
92
+ end
99
93
 
100
- def self.build_single_file_command(command, dsym_path)
101
- file_path = if dsym_path.end_with?('.zip')
102
- dsym_path.shellescape
103
- else
104
- ZipAction.run(path: dsym_path).shellescape
105
- end
106
- command + "@\"#{file_path}\""
107
- end
94
+ def self.is_supported?(platform)
95
+ platform == :ios
96
+ true
97
+ end
108
98
 
109
- # this is a fallback scenario incase of dSYM paths are not provided.
110
- # We use the dSYMs folder from iTC
111
- def self.fastlane_dsyms_filename
112
- paths = Dir["./**/*.dSYM.zip"]
113
- if paths.empty?
114
- return ""
115
- end
99
+ def self.generate_instabug_directory
100
+ cleanup_instabug_directory
101
+ FileUtils.mkdir_p @instabug_dsyms_directory
102
+ end
116
103
 
117
- iTunesConnectdSYMs = paths[0]
118
- iTunesConnectdSYMs ["./"] = ""
119
- renamediTunesConnectdSYMs = iTunesConnectdSYMs.clone
120
- renamediTunesConnectdSYMs [".dSYM"] = "-iTC"
121
- File.rename(iTunesConnectdSYMs, renamediTunesConnectdSYMs)
122
- default_value = renamediTunesConnectdSYMs
123
- end
104
+ def self.cleanup_instabug_directory
105
+ FileUtils.rm_f "#{@instabug_dsyms_directory}.zip"
106
+ FileUtils.rm_rf @instabug_dsyms_directory
107
+ end
124
108
 
125
- end
126
- end
109
+ def self.remove_directory(directory_path)
110
+ FileUtils.rm_rf directory_path
111
+ end
112
+
113
+ def self.copy_dsym_paths_into_directory(dsym_paths, directory_path)
114
+ dsym_paths.each do |path|
115
+ if File.extname(path) == '.dSYM'
116
+ FileUtils.copy_entry(path, "#{directory_path}/#{File.basename(path)}") if File.exist?(path)
117
+ else
118
+ Actions.sh("unzip #{path} -d #{directory_path}")
119
+ end
120
+ end
121
+ end
122
+
123
+ def self.build_single_file_command(command, dsym_path)
124
+ file_path = if dsym_path.end_with?('.zip')
125
+ dsym_path.shellescape
126
+ else
127
+ ZipAction.run(path: dsym_path).shellescape
128
+ end
129
+ command + "@\"#{file_path}\""
130
+ end
131
+ end
132
+ end
127
133
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module InstabugOfficial
3
- VERSION = "0.2.1"
3
+ VERSION = "0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-instabug_official
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instabug
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-05 00:00:00.000000000 Z
11
+ date: 2020-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -167,8 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubyforge_project:
171
- rubygems_version: 2.6.11
170
+ rubygems_version: 3.1.2
172
171
  signing_key:
173
172
  specification_version: 4
174
173
  summary: Plugin to upload DSYMs to Instabug Dashboard.