fastlane-plugin-loadly 2.2.2
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +63 -0
- data/lib/fastlane/plugin/loadly/actions/loadly_action.rb +151 -0
- data/lib/fastlane/plugin/loadly/helper/loadly_helper.rb +12 -0
- data/lib/fastlane/plugin/loadly/version.rb +5 -0
- data/lib/fastlane/plugin/loadly.rb +16 -0
- metadata +146 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f6249dce655bb3768b80f77bbf1be5f87a21683bef3b0314f5da44069f31a3a4
|
4
|
+
data.tar.gz: 51a3afaf381377b578dd60f37989b54dc3903dabcbb553e6a332bb5d3871277a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 549af5a8dc0f61274e0d9d3395cf26b3687f3f78a7b06f46ca58fb88f6cad0870a2cebffd2062b0ca4e1a4815ff3fae9929b0bab85749eefb0ad9f78d67415ab
|
7
|
+
data.tar.gz: b5a86eb1fdb6e26058499120bd86646dcdb9828736204d5a13589a318d02024f01abdb99092b98cbdc1c6f62f63d0a49ddaa6c4e0cb16559e579091da0b20b62
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Phu Hoang <hi@hmphu.com>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# Fastlane loadly.io plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-loadly)
|
4
|
+
[](https://github.com/hmphu/fastlane-plugin-loadly/actions/workflows/gem-push.yml)
|
5
|
+
|
6
|
+
## Getting Started
|
7
|
+
|
8
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-loadly`, add it to your project by running:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
fastlane add_plugin loadly
|
12
|
+
```
|
13
|
+
|
14
|
+
## About loadly.io
|
15
|
+
|
16
|
+
Loadly.io is the ultimate platform for app beta testing and distribution, offering unlimited app uploads and downloads, enhanced security, detailed analytics, and seamless integration. Alternative to TestFlight and Diawi
|
17
|
+
|
18
|
+
This plugin can upload .ipa and .apk file to Loadly.
|
19
|
+
|
20
|
+
## Available options
|
21
|
+
|
22
|
+
Key | Required | Type | Description
|
23
|
+
--- | --- | --- | ---
|
24
|
+
**api_key** | **`true`** | `String` | [Loadly API Key](https://loadly.io/doc/view/api)
|
25
|
+
**file** | `true` | `String` | Path to .ipa or .apk file.<br>**Default**: `IPA_OUTPUT_PATH` or `GRADLE_APK_OUTPUT_PATH` based on platform
|
26
|
+
**build_password** | `false` | `String` | Set the App installation password. If the password is empty, public installation is used by default
|
27
|
+
**build_description** | `false` | `String` | Additional information to your users on this build: the comment will be displayed on the installation page
|
28
|
+
**callback_url** | `false` | `String` | The URL loadly should call with the result
|
29
|
+
**timeout** | `false` | `Int` | Timeout for uploading file to Loadly.<br>**Default**: 600<br>**Range**: (60, 1800)
|
30
|
+
|
31
|
+
## Result link
|
32
|
+
|
33
|
+
If file upload successfully, you can access result link by:
|
34
|
+
|
35
|
+
`lane_context[SharedValues::UPLOADED_FILE_LINK_TO_LOADLY]`
|
36
|
+
|
37
|
+
## Example
|
38
|
+
|
39
|
+
Minimal plugin configuration is:
|
40
|
+
```ruby
|
41
|
+
loadly(
|
42
|
+
api_key: "your_api_key",
|
43
|
+
file: "your_app_file_path",
|
44
|
+
)
|
45
|
+
```
|
46
|
+
|
47
|
+
For more options see [**Available options**](#available-options) section.
|
48
|
+
|
49
|
+
## Issues and Feedback
|
50
|
+
|
51
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
52
|
+
|
53
|
+
## Troubleshooting
|
54
|
+
|
55
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
56
|
+
|
57
|
+
## Using _fastlane_ Plugins
|
58
|
+
|
59
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
60
|
+
|
61
|
+
## About _fastlane_
|
62
|
+
|
63
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,151 @@
|
|
1
|
+
# based on https://dashboard.diawi.com/docs/apis/upload
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
|
6
|
+
module SharedValues
|
7
|
+
UPLOADED_FILE_LINK_TO_LOADLY = :UPLOADED_FILE_LINK_TO_LOADLY
|
8
|
+
end
|
9
|
+
|
10
|
+
class LoadlyAction < Action
|
11
|
+
|
12
|
+
UPLOAD_URL = "https://api.loadly.io/apiv2/app/upload"
|
13
|
+
LOADLY_FILE_LINK = "https://i.loadly.io"
|
14
|
+
|
15
|
+
def self.run(options)
|
16
|
+
Actions.verify_gem!('rest-client')
|
17
|
+
require 'rest-client'
|
18
|
+
require 'json'
|
19
|
+
|
20
|
+
if options[:file].nil?
|
21
|
+
UI.important("File didn't come to LOADLY_plugin. Uploading is unavailable.")
|
22
|
+
return
|
23
|
+
end
|
24
|
+
|
25
|
+
if options[:api_key].nil?
|
26
|
+
UI.important("Diawi api_key is nil - uploading is unavailable.")
|
27
|
+
UI.important("Try to upload file by yourself. Path: #{options[:file]}")
|
28
|
+
return
|
29
|
+
end
|
30
|
+
|
31
|
+
upload_options = {
|
32
|
+
_api_key: options[:api_key],
|
33
|
+
buildPassword: options[:build_password],
|
34
|
+
buildUpdateDescription: options[:build_description],
|
35
|
+
file: File.new(options[:file], 'rb'),
|
36
|
+
}
|
37
|
+
|
38
|
+
timeout = options[:timeout]
|
39
|
+
|
40
|
+
UI.success("Start uploading file to loadly. Please, be patient. This could take some time.")
|
41
|
+
|
42
|
+
response = RestClient::Request.execute(
|
43
|
+
method: :post,
|
44
|
+
url: UPLOAD_URL,
|
45
|
+
timeout: timeout,
|
46
|
+
payload: upload_options
|
47
|
+
)
|
48
|
+
|
49
|
+
begin
|
50
|
+
response
|
51
|
+
rescue RestClient::ExceptionWithResponse => error
|
52
|
+
UI.important("Failed to upload file to loadly, because of:")
|
53
|
+
UI.important(error)
|
54
|
+
UI.important("Try to upload file by yourself. Path: #{options[:file]}")
|
55
|
+
return
|
56
|
+
end
|
57
|
+
|
58
|
+
data = JSON.parse(response.body)['data']
|
59
|
+
|
60
|
+
if data
|
61
|
+
download_url = "#{LOADLY_FILE_LINK}/#{data['buildKey']}"
|
62
|
+
|
63
|
+
Actions.lane_context[SharedValues::UPLOADED_FILE_LINK_TO_LOADLY] = download_url
|
64
|
+
|
65
|
+
UI.success("Upload completed successfully.")
|
66
|
+
UI.important("Download URL: #{download_url}")
|
67
|
+
|
68
|
+
if !options[:callback_url].nil?
|
69
|
+
data['download_url'] = download_url
|
70
|
+
self.callback(options[:callback_url], data)
|
71
|
+
end
|
72
|
+
|
73
|
+
return
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.callback(url, data)
|
78
|
+
UI.success("Performing callback to #{url}")
|
79
|
+
RestClient.post(url, data)
|
80
|
+
UI.success("Callback sucessfully")
|
81
|
+
end
|
82
|
+
|
83
|
+
def self.default_file_path
|
84
|
+
platform = Actions.lane_context[SharedValues::PLATFORM_NAME]
|
85
|
+
ios_path = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
|
86
|
+
android_path = Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
|
87
|
+
return platform == :ios ? ios_path : android_path
|
88
|
+
end
|
89
|
+
|
90
|
+
#####################################################
|
91
|
+
# @!group Documentation
|
92
|
+
#####################################################
|
93
|
+
|
94
|
+
def self.available_options
|
95
|
+
[
|
96
|
+
FastlaneCore::ConfigItem.new(key: :api_key,
|
97
|
+
env_name: "LOADLY_API_KEY",
|
98
|
+
description: "Loadly API Key",
|
99
|
+
optional: false),
|
100
|
+
FastlaneCore::ConfigItem.new(key: :file,
|
101
|
+
env_name: "LOADLY_FILE",
|
102
|
+
description: "Path to .ipa or .apk file. Default - `IPA_OUTPUT_PATH` or `GRADLE_APK_OUTPUT_PATH` based on platform",
|
103
|
+
optional: true,
|
104
|
+
default_value: self.default_file_path),
|
105
|
+
FastlaneCore::ConfigItem.new(key: :build_password,
|
106
|
+
env_name: "LOADLY_BUILD_PASSWORD",
|
107
|
+
description: "Set the App installation password. If the password is empty, public installation is used by default",
|
108
|
+
optional: true),
|
109
|
+
FastlaneCore::ConfigItem.new(key: :build_description,
|
110
|
+
env_name: "LOADLY_BUILD_UPDATE_DESCRIPTION",
|
111
|
+
description: "Additional information to your users on this build: the comment will be displayed on the installation page",
|
112
|
+
optional: true),
|
113
|
+
FastlaneCore::ConfigItem.new(key: :callback_url,
|
114
|
+
env_name: "LOADLY_CALLBACK_URL",
|
115
|
+
description: "The URL loadly should call with the result",
|
116
|
+
optional: true),
|
117
|
+
FastlaneCore::ConfigItem.new(key: :timeout,
|
118
|
+
env_name: "LOADLY_TIMEOUT",
|
119
|
+
description: "Timeout for uploading file to Loadly. Default: 600, range: (60, 1800)",
|
120
|
+
is_string: false,
|
121
|
+
optional: true,
|
122
|
+
default_value: 600),
|
123
|
+
]
|
124
|
+
end
|
125
|
+
|
126
|
+
def self.output
|
127
|
+
[
|
128
|
+
['UPLOADED_FILE_LINK_TO_LOADLY', 'URL to uploaded .ipa or .apk file to loadly.']
|
129
|
+
]
|
130
|
+
end
|
131
|
+
|
132
|
+
def self.description
|
133
|
+
"Upload .ipa/.apk file to loadly.io"
|
134
|
+
end
|
135
|
+
|
136
|
+
def self.authors
|
137
|
+
["hmphu"]
|
138
|
+
end
|
139
|
+
|
140
|
+
def self.details
|
141
|
+
"This action upload .ipa/.apk file to https://loadly.io and return link to uploaded file."
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.is_supported?(platform)
|
145
|
+
[:ios, :android].include?(platform)
|
146
|
+
end
|
147
|
+
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Helper
|
3
|
+
class LoadlyHelper
|
4
|
+
# class methods that you define here become available in your action
|
5
|
+
# as `Helper::LoadlyHelper.your_method`
|
6
|
+
#
|
7
|
+
def self.show_message
|
8
|
+
UI.message("Hello from the loadly plugin helper!")
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/loadly/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Loadly
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::Loadly.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-loadly
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Phu Hoang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rest-client
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.0.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: fastlane
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.93.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.93.0
|
111
|
+
description:
|
112
|
+
email: hi@hmphu.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- LICENSE
|
118
|
+
- README.md
|
119
|
+
- lib/fastlane/plugin/loadly.rb
|
120
|
+
- lib/fastlane/plugin/loadly/actions/loadly_action.rb
|
121
|
+
- lib/fastlane/plugin/loadly/helper/loadly_helper.rb
|
122
|
+
- lib/fastlane/plugin/loadly/version.rb
|
123
|
+
homepage: https://github.com/hmphu/fastlane-plugin-loadly
|
124
|
+
licenses:
|
125
|
+
- MIT
|
126
|
+
metadata: {}
|
127
|
+
post_install_message:
|
128
|
+
rdoc_options: []
|
129
|
+
require_paths:
|
130
|
+
- lib
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubygems_version: 3.1.6
|
143
|
+
signing_key:
|
144
|
+
specification_version: 4
|
145
|
+
summary: Upload .ipa or .apk file to loadly.com
|
146
|
+
test_files: []
|