fastlane-plugin-tpa 2.0.0 → 2.0.1
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bfef9a1b9d9496e50ed28cbb9c57287a6986378
|
4
|
+
data.tar.gz: aadedeb3d9ea7bf182c38f4b65a011405ff7370a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7cd65ef6629d782c652f23d428b819084c3f5ee486f6ed2576a9737eef97953c027a359bda20f0d4ea2d94fdba20eb6d1cddd43d80758eb7c1d8119e320d3f4
|
7
|
+
data.tar.gz: 667c57d9092073acfa42b095b09ab66a7f1312d28b2e839bde4c248bde0c0c482890ce499457ceef5cce31a1fbba28185e215d45559a4919e11479d036fbcb7b
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
</p>
|
4
4
|
|
5
5
|
# TPA plugin
|
6
|
+
[![Build Status](https://travis-ci.org/ThePerfectApp/fastlane-plugin-tpa.svg?branch=master)](https://travis-ci.org/ThePerfectApp/fastlane-plugin-tpa)
|
7
|
+
[![Gem](https://img.shields.io/gem/v/fastlane-plugin-tpa.svg?style=flat)](https://rubygems.org/gems/fastlane-plugin-tpa)
|
6
8
|
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-tpa)
|
7
9
|
|
8
10
|
TPA gives you advanced user behaviour analytics, app distribution, crash analytics and more.
|
@@ -28,24 +30,24 @@ This plugin makes interacting with TPA easy by providing you actions to upload `
|
|
28
30
|
|
29
31
|
In particular, this plugin provides the following two actions:
|
30
32
|
|
31
|
-
- [`
|
33
|
+
- [`upload_to_tpa`](#upload_to_tpa): uploads either an iOS `.ipa` app together with its corresponding `dSYM` to TPA. It is also capable of uploading an Android `.apk` app to TPA.
|
32
34
|
- [`upload_symbols_to_tpa`](#upload_symbols_to_tpa): Uploads only dSYM files to TPA
|
33
35
|
|
34
|
-
###
|
36
|
+
### upload_to_tpa
|
35
37
|
|
36
|
-
Use the `
|
38
|
+
Use the `upload_to_tpa` action (or the alias `tpa`) in order to upload an app to TPA. A common building lane would look something like the following:
|
37
39
|
|
38
40
|
```ruby
|
39
41
|
desc 'Builds a beta version of the app and uploads it to TPA'
|
40
42
|
lane :beta do
|
41
43
|
build_app # Builds the app
|
42
|
-
|
44
|
+
upload_to_tpa # Uploads the app and dSYM files to TPA
|
43
45
|
end
|
44
46
|
```
|
45
47
|
|
46
48
|
### upload_symbols_to_tpa
|
47
49
|
|
48
|
-
If you have bitcode enabled in your iOS app, then you will need to download the `dSYM` files from App Store Connect and upload them to TPA so that the crash reports can be symbolicated. In order to help with this process, then you can make use of the `upload_symbols_to_tpa` action.
|
50
|
+
If you have bitcode enabled in your iOS app, then you will need to download the `dSYM` files from App Store Connect and upload them to TPA so that the crash reports can be symbolicated. In order to help with this process, then you can make use of the `upload_symbols_to_tpa` action.
|
49
51
|
|
50
52
|
This action should be part of the [`download_dsyms`](https://docs.fastlane.tools/actions/download_dsyms/) action which is part of Fastlane.
|
51
53
|
|
@@ -72,6 +74,7 @@ end
|
|
72
74
|
```
|
73
75
|
|
74
76
|
## Available for `tpa.io` Domains
|
77
|
+
|
75
78
|
If you are using a managed version of TPA (for example `{your-subdomain.tpa.io}`, then feel free to use the latest version of this plugin. In your `Pluginfile` it should simply be written:
|
76
79
|
|
77
80
|
```ruby
|
@@ -84,10 +87,9 @@ If you do not have a `tpa.io` domain, you will need to use version 1.x.x of this
|
|
84
87
|
gem 'fastlane-plugin-tpa', '~>1.0'
|
85
88
|
```
|
86
89
|
|
87
|
-
|
88
90
|
## Example
|
89
91
|
|
90
|
-
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`.
|
92
|
+
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`.
|
91
93
|
|
92
94
|
## Run tests for this plugin
|
93
95
|
|
@@ -97,7 +99,8 @@ To run both the tests, and code style validation, run
|
|
97
99
|
rake
|
98
100
|
```
|
99
101
|
|
100
|
-
To automatically fix many of the styling issues, use
|
102
|
+
To automatically fix many of the styling issues, use
|
103
|
+
|
101
104
|
```
|
102
105
|
rubocop -a
|
103
106
|
```
|
@@ -1,166 +1,9 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
|
-
|
4
|
-
|
5
|
-
require 'rest_client'
|
6
|
-
|
7
|
-
upload_url = upload_url(params)
|
8
|
-
headers = headers(params)
|
9
|
-
body = body(params)
|
10
|
-
|
11
|
-
UI.message("Going to upload app to TPA")
|
12
|
-
UI.success("This might take a few minutes. Please don't interrupt the script.")
|
13
|
-
|
14
|
-
# Starts the upload
|
15
|
-
begin
|
16
|
-
RestClient.post(upload_url, body, headers)
|
17
|
-
rescue RestClient::ExceptionWithResponse => ex
|
18
|
-
handle_exception_response(ex)
|
19
|
-
rescue => ex
|
20
|
-
UI.crash!("Something went wrong while uploading your app to TPA: #{ex}")
|
21
|
-
else
|
22
|
-
UI.success("🎉 Your app has successfully been uploaded to TPA 🎉")
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def self.app_file(params)
|
27
|
-
app_file = [
|
28
|
-
params[:ipa],
|
29
|
-
params[:apk]
|
30
|
-
].detect { |e| !e.to_s.empty? }
|
31
|
-
|
32
|
-
if app_file.nil?
|
33
|
-
UI.user_error!("You have to provide a build file")
|
34
|
-
end
|
35
|
-
|
36
|
-
app_file
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.upload_url(params)
|
40
|
-
"#{params[:base_url]}/rest/api/v2/projects/#{params[:api_uuid]}/apps/versions/app/"
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.headers(params)
|
44
|
-
{
|
45
|
-
:"X-API-Key" => params[:api_key]
|
46
|
-
}
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.body(params)
|
50
|
-
{
|
51
|
-
app: File.new(app_file(params), 'rb'),
|
52
|
-
mapping: params[:mapping],
|
53
|
-
notes: params[:notes],
|
54
|
-
publish: params[:publish],
|
55
|
-
force: params[:force]
|
56
|
-
}
|
57
|
-
end
|
58
|
-
|
59
|
-
def self.handle_exception_response(ex)
|
60
|
-
if Fastlane::Helper::TpaHelper.valid_json?(ex.response)
|
61
|
-
res = JSON.parse(ex.response)
|
62
|
-
if res.key?("detail")
|
63
|
-
UI.crash!("Something went wrong while uploading your app to TPA: #{res['detail']}")
|
64
|
-
else
|
65
|
-
UI.crash!("Something went wrong while uploading your app to TPA: #{res}")
|
66
|
-
end
|
67
|
-
else
|
68
|
-
UI.crash!("Something went wrong while uploading your app to TPA: #{ex.response}")
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
#####################################################
|
73
|
-
# @!group Documentation
|
74
|
-
#####################################################
|
75
|
-
|
3
|
+
require_relative 'upload_to_tpa_action'
|
4
|
+
class TpaAction < UploadToTpaAction
|
76
5
|
def self.description
|
77
|
-
"
|
78
|
-
end
|
79
|
-
|
80
|
-
def self.details
|
81
|
-
[
|
82
|
-
"This plugin helps you to easily setup a CI/CD integration with The Perfect App. Simply",
|
83
|
-
"install this plugin and add the `tpa` command to your normal building lane. This will guide",
|
84
|
-
"you through the necessary parameters to use this plugin, which we recommend setting up as",
|
85
|
-
" as environmental to automate the whole process."
|
86
|
-
].join(" ")
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.available_options
|
90
|
-
Fastlane::Helper::TpaHelper.shared_available_options + [
|
91
|
-
FastlaneCore::ConfigItem.new(key: :ipa,
|
92
|
-
env_name: "FL_TPA_IPA",
|
93
|
-
description: "Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action",
|
94
|
-
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
|
95
|
-
optional: true,
|
96
|
-
verify_block: proc do |value|
|
97
|
-
UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
|
98
|
-
end,
|
99
|
-
conflicting_options: [:apk],
|
100
|
-
conflict_block: proc do |value|
|
101
|
-
UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
|
102
|
-
end),
|
103
|
-
FastlaneCore::ConfigItem.new(key: :apk,
|
104
|
-
env_name: "FL_TPA_APK",
|
105
|
-
description: "Path to your APK file",
|
106
|
-
default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
107
|
-
optional: true,
|
108
|
-
verify_block: proc do |value|
|
109
|
-
UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
|
110
|
-
end,
|
111
|
-
conflicting_options: [:ipa],
|
112
|
-
conflict_block: proc do |value|
|
113
|
-
UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
|
114
|
-
end),
|
115
|
-
FastlaneCore::ConfigItem.new(key: :mapping,
|
116
|
-
env_name: "FL_TPA_MAPPING",
|
117
|
-
description: "Path to your symbols file. For iOS provide path to app.dSYM.zip. For Android provide path to mappings.txt file",
|
118
|
-
default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
|
119
|
-
optional: true,
|
120
|
-
verify_block: proc do |value|
|
121
|
-
# validation is done in the action
|
122
|
-
end),
|
123
|
-
FastlaneCore::ConfigItem.new(key: :publish,
|
124
|
-
env_name: "FL_TPA_PUBLISH",
|
125
|
-
description: "Publish build upon upload",
|
126
|
-
default_value: true,
|
127
|
-
is_string: false),
|
128
|
-
FastlaneCore::ConfigItem.new(key: :force,
|
129
|
-
env_name: "FL_TPA_FORCE",
|
130
|
-
description: "Should a version with the same number already exist, force the new app to take the place of the old one",
|
131
|
-
default_value: false,
|
132
|
-
is_string: false),
|
133
|
-
FastlaneCore::ConfigItem.new(key: :notes,
|
134
|
-
env_name: "FL_TPA_NOTES",
|
135
|
-
description: "Release notes",
|
136
|
-
optional: true)
|
137
|
-
]
|
138
|
-
end
|
139
|
-
|
140
|
-
def self.output
|
141
|
-
nil
|
142
|
-
end
|
143
|
-
|
144
|
-
def self.return_value
|
145
|
-
nil
|
146
|
-
end
|
147
|
-
|
148
|
-
def self.authors
|
149
|
-
["mbogh", "Stefan Veis Pennerup"]
|
150
|
-
end
|
151
|
-
|
152
|
-
def self.is_supported?(platform)
|
153
|
-
[:ios, :android].include?(platform)
|
154
|
-
end
|
155
|
-
|
156
|
-
def self.example_code
|
157
|
-
[
|
158
|
-
'tpa'
|
159
|
-
]
|
160
|
-
end
|
161
|
-
|
162
|
-
def self.category
|
163
|
-
:beta
|
6
|
+
"Alias for the `upload_to_tpa` action"
|
164
7
|
end
|
165
8
|
end
|
166
9
|
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class UploadToTpaAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
require 'rest_client'
|
6
|
+
|
7
|
+
upload_url = upload_url(params)
|
8
|
+
headers = headers(params)
|
9
|
+
body = body(params)
|
10
|
+
|
11
|
+
UI.message("Going to upload app to TPA")
|
12
|
+
UI.success("This might take a few minutes. Please don't interrupt the script.")
|
13
|
+
|
14
|
+
# Starts the upload
|
15
|
+
begin
|
16
|
+
RestClient.post(upload_url, body, headers)
|
17
|
+
rescue RestClient::ExceptionWithResponse => ex
|
18
|
+
handle_exception_response(ex)
|
19
|
+
rescue => ex
|
20
|
+
UI.crash!("Something went wrong while uploading your app to TPA: #{ex}")
|
21
|
+
else
|
22
|
+
UI.success("🎉 Your app has successfully been uploaded to TPA 🎉")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.app_file(params)
|
27
|
+
app_file = [
|
28
|
+
params[:ipa],
|
29
|
+
params[:apk]
|
30
|
+
].detect { |e| !e.to_s.empty? }
|
31
|
+
|
32
|
+
if app_file.nil?
|
33
|
+
UI.user_error!("You have to provide a build file")
|
34
|
+
end
|
35
|
+
|
36
|
+
app_file
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.upload_url(params)
|
40
|
+
"#{params[:base_url]}/rest/api/v2/projects/#{params[:api_uuid]}/apps/versions/app/"
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.headers(params)
|
44
|
+
{
|
45
|
+
:"X-API-Key" => params[:api_key]
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.body(params)
|
50
|
+
{
|
51
|
+
app: File.new(app_file(params), 'rb'),
|
52
|
+
mapping: !params[:mapping].nil? && File.exist?(params[:mapping]) ? File.new(params[:mapping], 'rb') : nil,
|
53
|
+
notes: params[:notes],
|
54
|
+
publish: params[:publish],
|
55
|
+
force: params[:force]
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.handle_exception_response(ex)
|
60
|
+
if Fastlane::Helper::TpaHelper.valid_json?(ex.response)
|
61
|
+
res = JSON.parse(ex.response)
|
62
|
+
if res.key?("detail")
|
63
|
+
UI.crash!("Something went wrong while uploading your app to TPA: #{res['detail']}")
|
64
|
+
else
|
65
|
+
UI.crash!("Something went wrong while uploading your app to TPA: #{res}")
|
66
|
+
end
|
67
|
+
else
|
68
|
+
UI.crash!("Something went wrong while uploading your app to TPA: #{ex.response}")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
#####################################################
|
73
|
+
# @!group Documentation
|
74
|
+
#####################################################
|
75
|
+
|
76
|
+
def self.description
|
77
|
+
"Upload app builds to The Perfect App (tpa.io)"
|
78
|
+
end
|
79
|
+
|
80
|
+
def self.details
|
81
|
+
[
|
82
|
+
"This plugin helps you to easily setup a CI/CD integration with The Perfect App. Simply",
|
83
|
+
"install this plugin and add the `tpa` command to your normal building lane. This will guide",
|
84
|
+
"you through the necessary parameters to use this plugin, which we recommend setting up as",
|
85
|
+
" as environmental to automate the whole process."
|
86
|
+
].join(" ")
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.available_options
|
90
|
+
Fastlane::Helper::TpaHelper.shared_available_options + [
|
91
|
+
FastlaneCore::ConfigItem.new(key: :ipa,
|
92
|
+
env_name: "FL_TPA_IPA",
|
93
|
+
description: "Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action",
|
94
|
+
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
|
95
|
+
optional: true,
|
96
|
+
verify_block: proc do |value|
|
97
|
+
UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
|
98
|
+
end,
|
99
|
+
conflicting_options: [:apk],
|
100
|
+
conflict_block: proc do |value|
|
101
|
+
UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
|
102
|
+
end),
|
103
|
+
FastlaneCore::ConfigItem.new(key: :apk,
|
104
|
+
env_name: "FL_TPA_APK",
|
105
|
+
description: "Path to your APK file",
|
106
|
+
default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
107
|
+
optional: true,
|
108
|
+
verify_block: proc do |value|
|
109
|
+
UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
|
110
|
+
end,
|
111
|
+
conflicting_options: [:ipa],
|
112
|
+
conflict_block: proc do |value|
|
113
|
+
UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
|
114
|
+
end),
|
115
|
+
FastlaneCore::ConfigItem.new(key: :mapping,
|
116
|
+
env_name: "FL_TPA_MAPPING",
|
117
|
+
description: "Path to your symbols file. For iOS provide path to app.dSYM.zip. For Android provide path to mappings.txt file",
|
118
|
+
default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH],
|
119
|
+
optional: true,
|
120
|
+
verify_block: proc do |value|
|
121
|
+
# validation is done in the action
|
122
|
+
end),
|
123
|
+
FastlaneCore::ConfigItem.new(key: :publish,
|
124
|
+
env_name: "FL_TPA_PUBLISH",
|
125
|
+
description: "Publish build upon upload",
|
126
|
+
default_value: true,
|
127
|
+
is_string: false),
|
128
|
+
FastlaneCore::ConfigItem.new(key: :force,
|
129
|
+
env_name: "FL_TPA_FORCE",
|
130
|
+
description: "Should a version with the same number already exist, force the new app to take the place of the old one",
|
131
|
+
default_value: false,
|
132
|
+
is_string: false),
|
133
|
+
FastlaneCore::ConfigItem.new(key: :notes,
|
134
|
+
env_name: "FL_TPA_NOTES",
|
135
|
+
description: "Release notes",
|
136
|
+
optional: true)
|
137
|
+
]
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.output
|
141
|
+
nil
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.return_value
|
145
|
+
nil
|
146
|
+
end
|
147
|
+
|
148
|
+
def self.authors
|
149
|
+
["mbogh", "Stefan Veis Pennerup"]
|
150
|
+
end
|
151
|
+
|
152
|
+
def self.is_supported?(platform)
|
153
|
+
[:ios, :android].include?(platform)
|
154
|
+
end
|
155
|
+
|
156
|
+
def self.example_code
|
157
|
+
[
|
158
|
+
'upload_to_tpa'
|
159
|
+
]
|
160
|
+
end
|
161
|
+
|
162
|
+
def self.category
|
163
|
+
:beta
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-tpa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Perfect App
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- lib/fastlane/plugin/tpa.rb
|
176
176
|
- lib/fastlane/plugin/tpa/actions/tpa_action.rb
|
177
177
|
- lib/fastlane/plugin/tpa/actions/upload_symbols_to_tpa_action.rb
|
178
|
+
- lib/fastlane/plugin/tpa/actions/upload_to_tpa_action.rb
|
178
179
|
- lib/fastlane/plugin/tpa/helper/tpa_helper.rb
|
179
180
|
- lib/fastlane/plugin/tpa/helper/upload_symbols_to_tpa_helper.rb
|
180
181
|
- lib/fastlane/plugin/tpa/version.rb
|
@@ -198,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
199
|
version: '0'
|
199
200
|
requirements: []
|
200
201
|
rubyforge_project:
|
201
|
-
rubygems_version: 2.5.
|
202
|
+
rubygems_version: 2.5.2.3
|
202
203
|
signing_key:
|
203
204
|
specification_version: 4
|
204
205
|
summary: TPA gives you advanced user behaviour analytics, app distribution, crash
|