fastlane-plugin-instabug_official 0.2.1 → 0.3.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f4cd31e00ccf7d08eb06dae94763d037fa565f15a3a8bf511e2cddaefa0b8853
|
4
|
+
data.tar.gz: '09535c86b470bfc082c194e598a80dd1e4fa4f4c7154c29e6b839ea9bfe1888d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9946522486b66f56471c30f08e9ed26826b4dc37295f8f6e9ba03cd6e85a71f46541ef0f6473b7dd322a6eea0016e5168340da2b194c5f2d32cb8bf949e933cc
|
7
|
+
data.tar.gz: dd9f90f660184d212193d161d231e32e8b538b2282f91933b1393bcccdae9c01e8a35068f7e83fb2e4aba4ba7b0a2e07bb8da27b5bab9b1b1d5f43a7ec96628a
|
data/README.md
CHANGED
@@ -12,27 +12,20 @@ fastlane add_plugin instabug_official
|
|
12
12
|
|
13
13
|
## About instabug_official
|
14
14
|
|
15
|
-
|
15
|
+
Upload dSYM files to Instabug
|
16
16
|
|
17
|
-
|
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
|
-
|
24
|
+
instabug_official(api_token: "<Instabug token>")
|
31
25
|
```
|
32
26
|
|
33
|
-
To automatically fix many of the styling issues, use
|
34
27
|
```
|
35
|
-
|
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
|
@@ -1,127 +1,135 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'fastlane/action'
|
3
3
|
require_relative '../helper/instabug_official_helper'
|
4
|
+
require 'shellwords'
|
4
5
|
|
5
6
|
module Fastlane
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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}"
|
7
|
+
module Actions
|
8
|
+
class InstabugOfficialAction < Action
|
9
|
+
def self.run(params)
|
10
|
+
@instabug_dsyms_directory = 'Instabug_dsym_files_fastlane'
|
11
|
+
|
12
|
+
UI.verbose 'Running Instabug Action'
|
13
|
+
api_token = params[:api_token]
|
14
|
+
|
15
|
+
endpoint = 'https://api.instabug.com/api/sdk/v3/symbols_files'
|
16
|
+
command = "curl #{endpoint} --write-out %{http_code} --silent --output /dev/null -F os=\"ios\" -F application_token=\"#{api_token}\" -F symbols_file="
|
17
|
+
|
18
|
+
dsym_paths = []
|
19
|
+
# Add paths provided by the user
|
20
|
+
dsym_paths += (params[:dsym_array_paths] || [])
|
21
|
+
# Add dSYMs generaed by `gym`
|
22
|
+
dsym_paths += [Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]] if Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]
|
23
|
+
# Add dSYMs downloaded from iTC
|
24
|
+
dsym_paths += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS]
|
25
|
+
|
26
|
+
dsym_paths.uniq!
|
27
|
+
UI.verbose 'dsym_paths: ' + dsym_paths.inspect
|
28
|
+
|
29
|
+
if dsym_paths.empty?
|
30
|
+
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"
|
31
|
+
return
|
42
32
|
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def self.description
|
46
|
-
'upload dsyms to fastlane'
|
47
|
-
end
|
48
33
|
|
49
|
-
|
50
|
-
['Instabug Inc.']
|
51
|
-
end
|
34
|
+
generate_instabug_directory
|
52
35
|
|
53
|
-
|
54
|
-
|
55
|
-
end
|
36
|
+
UI.verbose 'Directory name: ' + @instabug_dsyms_directory
|
37
|
+
copy_dsym_paths_into_directory(dsym_paths, @instabug_dsyms_directory)
|
56
38
|
|
57
|
-
|
58
|
-
# Optional:
|
59
|
-
'upload dsyms to fastlane'
|
60
|
-
end
|
39
|
+
command = build_single_file_command(command, @instabug_dsyms_directory)
|
61
40
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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
|
41
|
+
result = Actions.sh(command)
|
42
|
+
if result == '200'
|
43
|
+
UI.success 'dSYM is successfully uploaded to Instabug 🤖'
|
44
|
+
UI.verbose 'Removing The directory'
|
45
|
+
else
|
46
|
+
UI.error "Something went wrong during Instabug dSYM upload. Status code is #{result}"
|
47
|
+
end
|
76
48
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
49
|
+
# Cleanup zip file and directory
|
50
|
+
cleanup_instabug_directory
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.description
|
54
|
+
"Upload dSYM files to Instabug"
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.details
|
58
|
+
"This action is used to upload symbolication files to Instabug. Incase you are not using bitcode, you can use this plug-in
|
59
|
+
with `gym` to upload dSYMs generated from your builds. If bitcode is enabled, you can use it with `download_dsyms` to upload dSYMs
|
60
|
+
from iTunes connect"
|
61
|
+
end
|
81
62
|
|
82
|
-
|
63
|
+
def self.authors
|
64
|
+
['Instabug Inc.']
|
65
|
+
end
|
83
66
|
|
84
|
-
def self.
|
85
|
-
|
86
|
-
end
|
67
|
+
def self.return_value
|
68
|
+
# If your method provides a return value, you can describe here what it does
|
69
|
+
end
|
87
70
|
|
88
|
-
def self.
|
89
|
-
|
90
|
-
|
71
|
+
def self.example_code
|
72
|
+
[
|
73
|
+
'instabug_official(api_token: "<Instabug token>")',
|
74
|
+
'instabug_official(api_token: "<Instabug token>", dsym_array_paths: ["./App1.dSYM.zip", "./App2.dSYM.zip"])'
|
75
|
+
]
|
76
|
+
end
|
91
77
|
|
92
|
-
def self.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
78
|
+
def self.available_options
|
79
|
+
[
|
80
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
81
|
+
env_name: 'FL_INSTABUG_API_TOKEN', # The name of the environment variable
|
82
|
+
description: 'API Token for Instabug', # a short description of this parameter
|
83
|
+
verify_block: proc do |value|
|
84
|
+
unless value && !value.empty?
|
85
|
+
UI.user_error!("No API token for InstabugAction given, pass using `api_token: 'token'`")
|
86
|
+
end
|
87
|
+
end),
|
88
|
+
FastlaneCore::ConfigItem.new(key: :dsym_array_paths,
|
89
|
+
type: Array,
|
90
|
+
optional: true,
|
91
|
+
description: 'Array of paths to *.dSYM files')
|
92
|
+
]
|
93
|
+
end
|
99
94
|
|
100
|
-
def self.
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
ZipAction.run(path: dsym_path).shellescape
|
105
|
-
end
|
106
|
-
command + "@\"#{file_path}\""
|
107
|
-
end
|
95
|
+
def self.is_supported?(platform)
|
96
|
+
platform == :ios
|
97
|
+
true
|
98
|
+
end
|
108
99
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
if paths.empty?
|
114
|
-
return ""
|
115
|
-
end
|
100
|
+
def self.generate_instabug_directory
|
101
|
+
cleanup_instabug_directory
|
102
|
+
FileUtils.mkdir_p @instabug_dsyms_directory
|
103
|
+
end
|
116
104
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
File.rename(iTunesConnectdSYMs, renamediTunesConnectdSYMs)
|
122
|
-
default_value = renamediTunesConnectdSYMs
|
123
|
-
end
|
105
|
+
def self.cleanup_instabug_directory
|
106
|
+
FileUtils.rm_f "#{@instabug_dsyms_directory}.zip"
|
107
|
+
FileUtils.rm_rf @instabug_dsyms_directory
|
108
|
+
end
|
124
109
|
|
125
|
-
|
126
|
-
|
110
|
+
def self.remove_directory(directory_path)
|
111
|
+
FileUtils.rm_rf directory_path
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.copy_dsym_paths_into_directory(dsym_paths, directory_path)
|
115
|
+
dsym_paths.each do |path|
|
116
|
+
if File.extname(path) == '.dSYM'
|
117
|
+
destination_path = "#{directory_path}/#{File.basename(path)}"
|
118
|
+
FileUtils.copy_entry(path, destination_path) if File.exist?(path)
|
119
|
+
else
|
120
|
+
Actions.sh("unzip -n #{Shellwords.shellescape(path)} -d #{Shellwords.shellescape(directory_path)}")
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.build_single_file_command(command, dsym_path)
|
126
|
+
file_path = if dsym_path.end_with?('.zip')
|
127
|
+
dsym_path.shellescape
|
128
|
+
else
|
129
|
+
ZipAction.run(path: dsym_path, include: [], exclude: []).shellescape
|
130
|
+
end
|
131
|
+
command + "@\"#{Shellwords.shellescape(file_path)}\""
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
127
135
|
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.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instabug
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-03 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
|
-
|
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.
|