fastlane-plugin-ovo_gptdriver 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 3e2d0df06cedeecdc50c6eab7668ad7cc9f1a1e124643875d250fb20f348308d
4
+ data.tar.gz: a78f6186ff717242a9a290c95e57c48b734cf036cf16c3743908ff9d7aeb1c2f
5
+ SHA512:
6
+ metadata.gz: d941e95a63290a582ce4772c8cfc542c854c6900a12dcdea30041007f3b98088a4ecaa474221d4caa295349b814ddbb50eb7cf5e17b8b9a782ebbeae9f3dc256
7
+ data.tar.gz: 266daeb91db6138679961a5fe12c382afbd7eac8a22b22e0673dcde2df3edaf4b01820448c4264ac9397336132840598439d34d346a85aa591f0b9c1d24123dd
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Christian Borsato <christian@ovolab.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,52 @@
1
+ # Ovo GPT Driver plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-ovo_gptdriver)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-ovo_gptdriver`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin ovo_gptdriver
11
+ ```
12
+
13
+ ## About ovo_gptdriver
14
+
15
+ The GPT Driver Fastlane Plugin provides a streamlined way to upload build artifacts to the GPT Driver service as part of your CI/CD pipeline. It supports uploading platform-specific binaries (such as APK, AAB, or IPA files), attaching metadata, and associating each build with your organization via a secure key.
16
+
17
+ This plugin is ideal for mobile teams that want to automate build delivery to GPT Driver with minimal configuration and full control over metadata like branch names or deployment context. Upon successful upload, the action returns the unique build ID generated by the GPT Driver service.
18
+
19
+ ## Available Actions
20
+
21
+ ### ovo_gptdriver_upload_build
22
+
23
+ This action uploads a build artifact to the GPT Driver service, along with relevant metadata such as platform, organization key, and custom deployment information (e.g., branch name). It is intended for use in CI/CD environments and ensures that each build is properly registered with GPT Driver. If the upload fails, the action returns nil instead of raising an error, allowing for graceful handling.
24
+
25
+ ```ruby
26
+ ovo_gptdriver_upload_build(
27
+ build_path: build_path,
28
+ organisation_key: organisation_key,
29
+ platform: platform,
30
+ metadata: metadata
31
+ )
32
+ ```
33
+
34
+ ## Example
35
+
36
+ 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`.
37
+
38
+ ## Issues and Feedback
39
+
40
+ For any other issues and feedback about this plugin, please submit it to this repository.
41
+
42
+ ## Troubleshooting
43
+
44
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
45
+
46
+ ## Using _fastlane_ Plugins
47
+
48
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
49
+
50
+ ## About _fastlane_
51
+
52
+ _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,73 @@
1
+ require 'fastlane/action'
2
+
3
+ module Fastlane
4
+ module Actions
5
+ class OvoGptdriverUploadBuildAction < Action
6
+ def self.run(params)
7
+ Helper::OvoGptdriverHelper.upload_build(
8
+ build_path: params[:build_path],
9
+ organisation_key: params[:organisation_key],
10
+ platform: params[:platform],
11
+ metadata: params[:metadata]
12
+ )
13
+ end
14
+
15
+ def self.description
16
+ "An action to upload build files to the GPT Driver service."
17
+ end
18
+
19
+ def self.authors
20
+ ["Christian Borsato"]
21
+ end
22
+
23
+ def self.return_value
24
+ "This action returns a string representing the ID of the uploaded build, as returned by the GPT Driver service. If the upload fails due to any error (e.g., network issues, invalid input, or authentication failure), it returns nil."
25
+ end
26
+
27
+ def self.details
28
+ "This action uploads a build artifact to the GPT Driver service, along with relevant metadata such as platform, organization key, and custom deployment information (e.g., branch name). It is intended for use in CI/CD environments and ensures that each build is properly registered with GPT Driver. If the upload fails, the action returns nil instead of raising an error, allowing for graceful handling."
29
+ end
30
+
31
+ def self.available_options
32
+ [
33
+ FastlaneCore::ConfigItem.new(
34
+ key: :build_path,
35
+ env_name: "GPTDRIVER_BUILD_PATH",
36
+ description: "The build binary file path to upload to GPT Driver (e.g., /path/to/your/build_file.apk)",
37
+ optional: false,
38
+ is_string: true
39
+ ),
40
+ FastlaneCore::ConfigItem.new(
41
+ key: :organisation_key,
42
+ env_name: "GPTDRIVER_ORGANISATION_KEY",
43
+ description: "The unique organization key used to identify your GPT Driver account",
44
+ optional: false,
45
+ is_string: true
46
+ ),
47
+ FastlaneCore::ConfigItem.new(
48
+ key: :platform,
49
+ env_name: "GPTDRIVER_PLATFORM",
50
+ description: "The platform of the build being uploaded (e.g., android, ios)",
51
+ optional: false,
52
+ is_string: true
53
+ ),
54
+ FastlaneCore::ConfigItem.new(
55
+ key: :metadata,
56
+ env_name: "GPTDRIVER_METADATA",
57
+ description: "A JSON string containing additional metadata for the upload (e.g., branch name, build type)",
58
+ optional: true,
59
+ is_string: true
60
+ )
61
+ ]
62
+ end
63
+
64
+ def self.is_supported?(platform)
65
+ true
66
+ end
67
+
68
+ def self.category
69
+ :misc
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,51 @@
1
+ require 'fastlane_core/ui/ui'
2
+ require 'json'
3
+ require 'rest-client'
4
+
5
+ module Fastlane
6
+ UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
7
+
8
+ module Helper
9
+ class OvoGptdriverHelper
10
+ API_BASE_URL = "https://api.mobileboost.io"
11
+
12
+ # GPT Driver API Documentation: https://docs.mobileboost.io/gpt-driver-api/basics/images-and-media/api
13
+ def self.upload_build(build_path:, organisation_key:, platform:, metadata:)
14
+ UI.message("Starting upload of build '#{build_path}' to GTP Driver...")
15
+
16
+ begin
17
+ # Start request using RestClient
18
+ response = RestClient.post(
19
+ "#{API_BASE_URL}/uploadBuild/",
20
+ {
21
+ build: File.new(build_path, 'rb'), # APK/ZIP/TAR.GZ file
22
+ organisation_key: organisation_key, # Organization key
23
+ platform: platform, # Platform type
24
+ metadata: metadata # Metadata as JSON
25
+ },
26
+ { content_type: :multipart } # Specify multipart/form-data
27
+ )
28
+
29
+ json_response = JSON.parse(response.body)
30
+ build_id = json_response["buildId"]
31
+
32
+ # If the request is successful (HTTP 2xx)
33
+ UI.success("Build '#{build_path}' uploaded successfully to GPT Driver.\nBuild ID assigned: #{build_id}")
34
+
35
+ # Return the build id
36
+ return build_id
37
+ rescue RestClient::ExceptionWithResponse => e
38
+ # Server returned an HTTP error (e.g. 400, 401, 500)
39
+ UI.error(
40
+ "An error occurred while uploading the build '#{build_path}' to GTPDriver.\nStatus Code: #{e.http_code}\nBody: #{e.response}"
41
+ )
42
+ return nil
43
+ rescue StandardError => e
44
+ # Catch any other unexpected error
45
+ UI.error("An unexpected error occurred: #{e.to_s}")
46
+ return nil
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module OvoGptdriver
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/ovo_gptdriver/version'
2
+
3
+ module Fastlane
4
+ module OvoGptdriver
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::OvoGptdriver.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-ovo_gptdriver
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Christian Borsato
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-05-18 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rest-client
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
26
+ email: christian@ovolab.com
27
+ executables: []
28
+ extensions: []
29
+ extra_rdoc_files: []
30
+ files:
31
+ - LICENSE
32
+ - README.md
33
+ - lib/fastlane/plugin/ovo_gptdriver.rb
34
+ - lib/fastlane/plugin/ovo_gptdriver/actions/ovo_gptdriver_upload_build_action.rb
35
+ - lib/fastlane/plugin/ovo_gptdriver/helper/ovo_gptdriver_helper.rb
36
+ - lib/fastlane/plugin/ovo_gptdriver/version.rb
37
+ homepage: https://github.com/ovolab/fastlane-plugin-ovo_gptdriver
38
+ licenses:
39
+ - MIT
40
+ metadata:
41
+ rubygems_mfa_required: 'true'
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: '2.6'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubygems_version: 3.6.3
57
+ specification_version: 4
58
+ summary: This Fastlane plugin provides actions for interacting with GPT Driver.
59
+ test_files: []