fastlane-plugin-app_dropper 1.0.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 +7 -0
- data/LICENSE +21 -0
- data/README.md +133 -0
- data/lib/fastlane/plugin/app_dropper/actions/app_dropper_action.rb +180 -0
- data/lib/fastlane/plugin/app_dropper/helper/app_dropper_helper.rb +133 -0
- data/lib/fastlane/plugin/app_dropper/version.rb +5 -0
- data/lib/fastlane/plugin/app_dropper.rb +16 -0
- metadata +123 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 76c011d561432b70d2ec3994e11145fd34e8ade523503b8d2548f4b266fa43cd
|
|
4
|
+
data.tar.gz: c19756277bd79750da48a86bf2693ce372ff923be66447f185b29993e57f2eb1
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c6f423e2b20583c66fc536c928960879929dc247bf80c63344faad52eb6b988a54f554144bb825460bda1af229b358a562f65df3d9ae2a43c4823b9f523c3139
|
|
7
|
+
data.tar.gz: ab27205510035b373d668fc31b4df2ccdb91e77729d65f21e2c920322d9450c9d98bff3e1e4da22d299105a450fc91c21a090bff14a22e1de7c202c162206992
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 App Dropper
|
|
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,133 @@
|
|
|
1
|
+
# fastlane-plugin-app_dropper
|
|
2
|
+
|
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-app_dropper)
|
|
4
|
+
|
|
5
|
+
Upload the build your lane just produced to [App Dropper](https://appdropper.io) and get a shareable install link back.
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
fastlane add_plugin app_dropper
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Generate an API token under **Settings → API tokens** in your App Dropper dashboard, and export it:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
export APPDROPPER_TOKEN="adp_…"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Each token is scoped to a single app and carries one scope, `upload:builds` — it cannot delete builds, manage testers, read billing, or reach another app.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
With no arguments, the action uploads whatever the lane most recently built — `IPA_OUTPUT_PATH`, falling back to `GRADLE_APK_OUTPUT_PATH`:
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
lane :beta do
|
|
27
|
+
build_app(scheme: "MyApp", export_method: "ad-hoc")
|
|
28
|
+
app_dropper
|
|
29
|
+
end
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or spell it out:
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
lane :beta do
|
|
36
|
+
build_app(scheme: "MyApp", export_method: "ad-hoc")
|
|
37
|
+
|
|
38
|
+
app_dropper(
|
|
39
|
+
api_token: ENV["APPDROPPER_TOKEN"],
|
|
40
|
+
file: lane_context[SharedValues::IPA_OUTPUT_PATH],
|
|
41
|
+
release_notes: last_git_commit[:message],
|
|
42
|
+
tag: "adhoc"
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Android
|
|
48
|
+
|
|
49
|
+
```ruby
|
|
50
|
+
lane :beta do
|
|
51
|
+
gradle(task: "assemble", build_type: "Release")
|
|
52
|
+
|
|
53
|
+
app_dropper(
|
|
54
|
+
file: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
|
55
|
+
release_notes: last_git_commit[:message]
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Options
|
|
61
|
+
|
|
62
|
+
| Option | Environment variable | Default |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `api_token` | `APPDROPPER_TOKEN` | required |
|
|
65
|
+
| `file` | `APPDROPPER_FILE` | the lane's `.ipa`, else its `.apk` |
|
|
66
|
+
| `release_notes` | `APPDROPPER_RELEASE_NOTES` | empty |
|
|
67
|
+
| `tag` | `APPDROPPER_TAG` | `beta` |
|
|
68
|
+
| `timeout` | `APPDROPPER_TIMEOUT` | `600` seconds |
|
|
69
|
+
| `api_url` | `APPDROPPER_API_URL` | `https://appdropper.io/api/v1` |
|
|
70
|
+
|
|
71
|
+
`api_token` is declared sensitive, so fastlane redacts it from logs and from the run summary.
|
|
72
|
+
|
|
73
|
+
## Return value and lane context
|
|
74
|
+
|
|
75
|
+
The action returns the install link, and also sets:
|
|
76
|
+
|
|
77
|
+
| Lane context key | Contains |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `APP_DROPPER_INSTALL_URL` | Public install link |
|
|
80
|
+
| `APP_DROPPER_BUILD_ID` | Identifier of the new build |
|
|
81
|
+
| `APP_DROPPER_QR_URL` | PNG QR code for the install link |
|
|
82
|
+
| `APP_DROPPER_VERSION` | Version string read out of the binary |
|
|
83
|
+
|
|
84
|
+
```ruby
|
|
85
|
+
url = app_dropper
|
|
86
|
+
slack(message: "New iOS beta is up: #{url}")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Switching from Diawi
|
|
90
|
+
|
|
91
|
+
The action is deliberately shaped like the community `diawi` plugin, so the change is mechanical:
|
|
92
|
+
|
|
93
|
+
```ruby
|
|
94
|
+
# Before
|
|
95
|
+
diawi(
|
|
96
|
+
token: ENV["DIAWI_TOKEN"],
|
|
97
|
+
file: lane_context[SharedValues::IPA_OUTPUT_PATH],
|
|
98
|
+
comment: last_git_commit[:message]
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# After
|
|
102
|
+
app_dropper(
|
|
103
|
+
api_token: ENV["APPDROPPER_TOKEN"],
|
|
104
|
+
file: lane_context[SharedValues::IPA_OUTPUT_PATH],
|
|
105
|
+
release_notes: last_git_commit[:message]
|
|
106
|
+
)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Both block the lane until the build is processed and both return a link. App Dropper additionally groups builds into an app with full version history, notifies your registered testers by email and push, and keeps builds for 7 days on free or 30 on Pro (indefinitely if you pin one).
|
|
110
|
+
|
|
111
|
+
## How it works
|
|
112
|
+
|
|
113
|
+
The binary never passes through the API. The action reserves an upload (which is where every plan limit and quota is applied), streams the file straight to Google Cloud Storage, then waits for the server to parse it. That's what keeps a 500 MB `.ipa` clear of the request-size ceilings every HTTP API has.
|
|
114
|
+
|
|
115
|
+
No runtime dependencies — everything uses Ruby's standard library, so installing this plugin can't drag a conflicting HTTP gem into your `Gemfile.lock`.
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bundle install
|
|
121
|
+
bundle exec rspec
|
|
122
|
+
bundle exec rubocop
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Docs
|
|
126
|
+
|
|
127
|
+
- [Fastlane guide](https://appdropper.io/help/fastlane-plugin)
|
|
128
|
+
- [CI/CD setup guide](https://appdropper.io/help/ci-cd-uploads)
|
|
129
|
+
- [REST API reference](https://appdropper.io/help/api)
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require_relative '../helper/app_dropper_helper'
|
|
3
|
+
|
|
4
|
+
module Fastlane
|
|
5
|
+
module Actions
|
|
6
|
+
module SharedValues
|
|
7
|
+
APP_DROPPER_INSTALL_URL = :APP_DROPPER_INSTALL_URL
|
|
8
|
+
APP_DROPPER_BUILD_ID = :APP_DROPPER_BUILD_ID
|
|
9
|
+
APP_DROPPER_QR_URL = :APP_DROPPER_QR_URL
|
|
10
|
+
APP_DROPPER_VERSION = :APP_DROPPER_VERSION
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class AppDropperAction < Action
|
|
14
|
+
def self.run(params)
|
|
15
|
+
path = File.expand_path(params[:file])
|
|
16
|
+
UI.user_error!("App Dropper: no such file — #{path}") unless File.exist?(path)
|
|
17
|
+
|
|
18
|
+
extension = File.extname(path).downcase
|
|
19
|
+
unless ['.apk', '.ipa'].include?(extension)
|
|
20
|
+
UI.user_error!("App Dropper: only .apk and .ipa builds can be uploaded (got '#{extension}').")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
file_name = File.basename(path)
|
|
24
|
+
file_size = File.size(path)
|
|
25
|
+
helper = Helper::AppDropperHelper.new(
|
|
26
|
+
api_token: params[:api_token],
|
|
27
|
+
api_url: params[:api_url]
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
UI.message("Uploading #{file_name} (#{format_size(file_size)}) to App Dropper…")
|
|
31
|
+
|
|
32
|
+
ticket = helper.create_upload(
|
|
33
|
+
file_name: file_name,
|
|
34
|
+
file_size: file_size,
|
|
35
|
+
release_notes: params[:release_notes],
|
|
36
|
+
tag: params[:tag]
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
helper.send_binary(ticket['upload_url'], path, ticket['content_type'])
|
|
40
|
+
UI.message("Upload finished — waiting for App Dropper to process the build…")
|
|
41
|
+
|
|
42
|
+
result = helper.await_upload(ticket['upload_id'], timeout: params[:timeout])
|
|
43
|
+
|
|
44
|
+
if result['status'] == 'error'
|
|
45
|
+
UI.user_error!("App Dropper: #{result.dig('error', 'message') || 'the build could not be processed.'}")
|
|
46
|
+
end
|
|
47
|
+
unless result['status'] == 'ready'
|
|
48
|
+
UI.user_error!("App Dropper: the build is still processing after #{params[:timeout]}s. Nothing was lost — check your dashboard.")
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
install_url = result['install_url']
|
|
52
|
+
Actions.lane_context[SharedValues::APP_DROPPER_INSTALL_URL] = install_url
|
|
53
|
+
Actions.lane_context[SharedValues::APP_DROPPER_BUILD_ID] = result['build_id']
|
|
54
|
+
Actions.lane_context[SharedValues::APP_DROPPER_QR_URL] = result['qr_url']
|
|
55
|
+
Actions.lane_context[SharedValues::APP_DROPPER_VERSION] = result['version']
|
|
56
|
+
|
|
57
|
+
UI.success("#{result['app_name']} #{result['version']} is live: #{install_url}")
|
|
58
|
+
install_url
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.format_size(bytes)
|
|
62
|
+
bytes >= 1024 * 1024 ? "#{(bytes / 1024.0 / 1024.0).round(1)} MB" : "#{(bytes / 1024.0).round} KB"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.description
|
|
66
|
+
"Upload an .apk or .ipa to App Dropper and get a shareable install link"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.details
|
|
70
|
+
[
|
|
71
|
+
"Sends a build to App Dropper and returns its public install link.",
|
|
72
|
+
"",
|
|
73
|
+
"The binary goes straight to storage on a resumable session rather than",
|
|
74
|
+
"through the API, so build size is bounded only by your plan.",
|
|
75
|
+
"",
|
|
76
|
+
"Generate a token under Settings → API tokens in your App Dropper",
|
|
77
|
+
"dashboard. Each token is scoped to one app and can only upload builds."
|
|
78
|
+
].join("\n")
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.available_options
|
|
82
|
+
[
|
|
83
|
+
FastlaneCore::ConfigItem.new(
|
|
84
|
+
key: :api_token,
|
|
85
|
+
env_name: "APPDROPPER_TOKEN",
|
|
86
|
+
description: "Your App Dropper API token",
|
|
87
|
+
sensitive: true,
|
|
88
|
+
verify_block: proc do |value|
|
|
89
|
+
UI.user_error!("No API token — set APPDROPPER_TOKEN or pass api_token:") if value.to_s.empty?
|
|
90
|
+
end
|
|
91
|
+
),
|
|
92
|
+
FastlaneCore::ConfigItem.new(
|
|
93
|
+
key: :file,
|
|
94
|
+
env_name: "APPDROPPER_FILE",
|
|
95
|
+
description: "Path to the .apk or .ipa to upload",
|
|
96
|
+
# Whichever of the two the lane just produced. Both are set by the
|
|
97
|
+
# standard build actions, so the common case needs no `file:` at all.
|
|
98
|
+
default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] ||
|
|
99
|
+
Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
|
100
|
+
default_value_dynamic: true,
|
|
101
|
+
verify_block: proc do |value|
|
|
102
|
+
UI.user_error!("Couldn't find a build to upload — pass file:") if value.to_s.empty?
|
|
103
|
+
end
|
|
104
|
+
),
|
|
105
|
+
FastlaneCore::ConfigItem.new(
|
|
106
|
+
key: :release_notes,
|
|
107
|
+
env_name: "APPDROPPER_RELEASE_NOTES",
|
|
108
|
+
description: "Release notes shown to testers on the install page",
|
|
109
|
+
optional: true,
|
|
110
|
+
default_value: ""
|
|
111
|
+
),
|
|
112
|
+
FastlaneCore::ConfigItem.new(
|
|
113
|
+
key: :tag,
|
|
114
|
+
env_name: "APPDROPPER_TAG",
|
|
115
|
+
description: "Label for this build, e.g. 'beta' or 'nightly'",
|
|
116
|
+
optional: true,
|
|
117
|
+
default_value: ""
|
|
118
|
+
),
|
|
119
|
+
FastlaneCore::ConfigItem.new(
|
|
120
|
+
key: :timeout,
|
|
121
|
+
env_name: "APPDROPPER_TIMEOUT",
|
|
122
|
+
description: "Seconds to wait for the build to finish processing",
|
|
123
|
+
optional: true,
|
|
124
|
+
type: Integer,
|
|
125
|
+
default_value: Helper::AppDropperHelper::DEFAULT_TIMEOUT
|
|
126
|
+
),
|
|
127
|
+
FastlaneCore::ConfigItem.new(
|
|
128
|
+
key: :api_url,
|
|
129
|
+
env_name: "APPDROPPER_API_URL",
|
|
130
|
+
description: "API base URL — only needed for a self-hosted deployment",
|
|
131
|
+
optional: true
|
|
132
|
+
)
|
|
133
|
+
]
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def self.output
|
|
137
|
+
[
|
|
138
|
+
['APP_DROPPER_INSTALL_URL', 'Public install link for the uploaded build'],
|
|
139
|
+
['APP_DROPPER_BUILD_ID', 'Identifier of the build that was created'],
|
|
140
|
+
['APP_DROPPER_QR_URL', 'PNG QR code pointing at the install link'],
|
|
141
|
+
['APP_DROPPER_VERSION', 'Version string parsed out of the binary']
|
|
142
|
+
]
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
def self.return_value
|
|
146
|
+
"The public install link"
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
def self.authors
|
|
150
|
+
["App Dropper"]
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
def self.is_supported?(platform)
|
|
154
|
+
[:ios, :android].include?(platform)
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
def self.example_code
|
|
158
|
+
[
|
|
159
|
+
'app_dropper(
|
|
160
|
+
api_token: ENV["APPDROPPER_TOKEN"],
|
|
161
|
+
file: lane_context[SharedValues::IPA_OUTPUT_PATH]
|
|
162
|
+
)',
|
|
163
|
+
'# Android, with the last commit message as release notes
|
|
164
|
+
app_dropper(
|
|
165
|
+
file: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
|
|
166
|
+
release_notes: last_git_commit[:message],
|
|
167
|
+
tag: "nightly"
|
|
168
|
+
)',
|
|
169
|
+
'# The install link is both the return value and a lane_context entry
|
|
170
|
+
url = app_dropper
|
|
171
|
+
slack(message: "New build ready: #{url}")'
|
|
172
|
+
]
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
def self.category
|
|
176
|
+
:beta
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
|
2
|
+
require 'net/http'
|
|
3
|
+
require 'json'
|
|
4
|
+
require 'uri'
|
|
5
|
+
|
|
6
|
+
module Fastlane
|
|
7
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
|
|
8
|
+
|
|
9
|
+
module Helper
|
|
10
|
+
# Talks to the App Dropper REST API over Ruby's standard library only.
|
|
11
|
+
#
|
|
12
|
+
# Binaries never pass through the API: `create_upload` returns a Google
|
|
13
|
+
# Cloud Storage resumable session, `send_binary` streams the file straight
|
|
14
|
+
# there, and `await_upload` waits for the server to parse it. That is what
|
|
15
|
+
# keeps a 500 MB .ipa clear of the request-size ceilings every HTTP API has.
|
|
16
|
+
class AppDropperHelper
|
|
17
|
+
DEFAULT_API_URL = "https://appdropper.io/api/v1".freeze
|
|
18
|
+
# Matches the CLI: long enough for a large build to be parsed, short
|
|
19
|
+
# enough that a wedged lane eventually fails instead of hanging a CI job.
|
|
20
|
+
DEFAULT_TIMEOUT = 600
|
|
21
|
+
|
|
22
|
+
def initialize(api_token:, api_url: nil)
|
|
23
|
+
@api_token = api_token
|
|
24
|
+
@api_url = (api_url || ENV['APPDROPPER_API_URL'] || DEFAULT_API_URL).chomp('/')
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def create_upload(file_name:, file_size:, release_notes:, tag:)
|
|
28
|
+
post('/uploads', {
|
|
29
|
+
file_name: file_name,
|
|
30
|
+
file_size: file_size,
|
|
31
|
+
release_notes: release_notes.to_s,
|
|
32
|
+
tag: tag.to_s
|
|
33
|
+
})
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# A single PUT of the whole file. Net::HTTP streams from the IO rather
|
|
37
|
+
# than reading the build into memory, which matters when the build is
|
|
38
|
+
# bigger than the runner's RAM budget.
|
|
39
|
+
def send_binary(session_url, path, content_type)
|
|
40
|
+
uri = URI.parse(session_url)
|
|
41
|
+
size = File.size(path)
|
|
42
|
+
|
|
43
|
+
File.open(path, 'rb') do |io|
|
|
44
|
+
request = Net::HTTP::Put.new(uri)
|
|
45
|
+
request['Content-Type'] = content_type
|
|
46
|
+
request['Content-Length'] = size.to_s
|
|
47
|
+
request.body_stream = io
|
|
48
|
+
|
|
49
|
+
response = http_for(uri, read_timeout: 900).request(request)
|
|
50
|
+
unless response.is_a?(Net::HTTPSuccess)
|
|
51
|
+
UI.user_error!("App Dropper: storage rejected the upload (HTTP #{response.code}). #{response.body.to_s[0, 300]}")
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Long-polls the upload until it is parsed. The server holds the
|
|
57
|
+
# connection for `wait` seconds, so this is normally one request.
|
|
58
|
+
def await_upload(upload_id, timeout: DEFAULT_TIMEOUT)
|
|
59
|
+
deadline = Time.now + timeout
|
|
60
|
+
loop do
|
|
61
|
+
remaining = (deadline - Time.now).to_i
|
|
62
|
+
wait = [[remaining, 120].min, 0].max
|
|
63
|
+
result = get("/uploads/#{upload_id}?wait=#{wait}")
|
|
64
|
+
status = result['status']
|
|
65
|
+
return result if status == 'ready' || status == 'error'
|
|
66
|
+
return result if Time.now >= deadline
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def whoami
|
|
71
|
+
get('/me')
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
private
|
|
75
|
+
|
|
76
|
+
def http_for(uri, read_timeout: 60)
|
|
77
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
78
|
+
http.use_ssl = uri.scheme == 'https'
|
|
79
|
+
http.open_timeout = 30
|
|
80
|
+
http.read_timeout = read_timeout
|
|
81
|
+
http
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def get(path)
|
|
85
|
+
uri = URI.parse("#{@api_url}#{path}")
|
|
86
|
+
request = Net::HTTP::Get.new(uri)
|
|
87
|
+
apply_headers(request)
|
|
88
|
+
# Generously past the server's own hold, so the client isn't what gives
|
|
89
|
+
# up on a request the server is still honouring.
|
|
90
|
+
parse(http_for(uri, read_timeout: 180).request(request))
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def post(path, body)
|
|
94
|
+
uri = URI.parse("#{@api_url}#{path}")
|
|
95
|
+
request = Net::HTTP::Post.new(uri)
|
|
96
|
+
apply_headers(request)
|
|
97
|
+
request['Content-Type'] = 'application/json'
|
|
98
|
+
request.body = body.to_json
|
|
99
|
+
parse(http_for(uri).request(request))
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def apply_headers(request)
|
|
103
|
+
request['Authorization'] = "Bearer #{@api_token}"
|
|
104
|
+
request['Accept'] = 'application/json'
|
|
105
|
+
request['User-Agent'] = "fastlane-plugin-app_dropper/#{Fastlane::AppDropper::VERSION}"
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def parse(response)
|
|
109
|
+
parsed = begin
|
|
110
|
+
response.body.to_s.empty? ? {} : JSON.parse(response.body)
|
|
111
|
+
rescue JSON::ParserError
|
|
112
|
+
{}
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
return parsed if response.is_a?(Net::HTTPSuccess)
|
|
116
|
+
|
|
117
|
+
message = parsed.dig('error', 'message') || "HTTP #{response.code}"
|
|
118
|
+
# The API answers 401/403 for a token problem; naming it here saves the
|
|
119
|
+
# usual round of "is the secret even set?" debugging.
|
|
120
|
+
case response.code.to_i
|
|
121
|
+
when 401, 403
|
|
122
|
+
UI.user_error!("App Dropper: #{message} Check that APPDROPPER_TOKEN is set and scoped to this app.")
|
|
123
|
+
when 402
|
|
124
|
+
UI.user_error!("App Dropper: #{message}")
|
|
125
|
+
when 429
|
|
126
|
+
UI.user_error!("App Dropper: #{message}")
|
|
127
|
+
else
|
|
128
|
+
UI.user_error!("App Dropper: #{message}")
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'fastlane/plugin/app_dropper/version'
|
|
2
|
+
|
|
3
|
+
module Fastlane
|
|
4
|
+
module AppDropper
|
|
5
|
+
# Returns all .rb files inside the "actions" and "helper" directory, which
|
|
6
|
+
# is how fastlane discovers what a plugin provides.
|
|
7
|
+
def self.all_classes
|
|
8
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# By default we want to import all available actions and helpers.
|
|
14
|
+
Fastlane::AppDropper.all_classes.each do |current|
|
|
15
|
+
require current
|
|
16
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: fastlane-plugin-app_dropper
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- App Dropper
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-08-15 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '2.0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '2.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: fastlane
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 2.170.0
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 2.170.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '13.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '13.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: '3.10'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3.10'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rubocop
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 1.12.1
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 1.12.1
|
|
83
|
+
description: A fastlane action that sends the build your lane just produced to App
|
|
84
|
+
Dropper, then returns a public install link and QR code for your testers.
|
|
85
|
+
email: support@appdropper.io
|
|
86
|
+
executables: []
|
|
87
|
+
extensions: []
|
|
88
|
+
extra_rdoc_files: []
|
|
89
|
+
files:
|
|
90
|
+
- LICENSE
|
|
91
|
+
- README.md
|
|
92
|
+
- lib/fastlane/plugin/app_dropper.rb
|
|
93
|
+
- lib/fastlane/plugin/app_dropper/actions/app_dropper_action.rb
|
|
94
|
+
- lib/fastlane/plugin/app_dropper/helper/app_dropper_helper.rb
|
|
95
|
+
- lib/fastlane/plugin/app_dropper/version.rb
|
|
96
|
+
homepage: https://appdropper.io/help/fastlane-plugin
|
|
97
|
+
licenses:
|
|
98
|
+
- MIT
|
|
99
|
+
metadata:
|
|
100
|
+
homepage_uri: https://appdropper.io/help/fastlane-plugin
|
|
101
|
+
documentation_uri: https://appdropper.io/help/fastlane-plugin
|
|
102
|
+
source_code_uri: https://github.com/appdropper-io/fastlane-plugin-app_dropper
|
|
103
|
+
bug_tracker_uri: https://appdropper.io/contact
|
|
104
|
+
post_install_message:
|
|
105
|
+
rdoc_options: []
|
|
106
|
+
require_paths:
|
|
107
|
+
- lib
|
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
|
+
requirements:
|
|
110
|
+
- - ">="
|
|
111
|
+
- !ruby/object:Gem::Version
|
|
112
|
+
version: '2.6'
|
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '0'
|
|
118
|
+
requirements: []
|
|
119
|
+
rubygems_version: 3.0.3.1
|
|
120
|
+
signing_key:
|
|
121
|
+
specification_version: 4
|
|
122
|
+
summary: Upload .apk and .ipa builds to App Dropper and get a shareable install link
|
|
123
|
+
test_files: []
|