fastlane-plugin-rustored 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: 280cab221b564f9533f0e047b36e60f816bda16b7967638fe22ff5b4ec72f0dd
4
+ data.tar.gz: 2c2e092e3d2832b44d225e913bd39f5eba8a9964d5d944d69ef6d9e4bfa80deb
5
+ SHA512:
6
+ metadata.gz: becad129986cfa3924759a75b674d313442bf5b2d253d7a6cceed694ad2315c53a358a15903fa0ea168a9f8e84b9aecb905909cbc7d98f071c6d45a6f72c8e3c
7
+ data.tar.gz: 1d3b6750875546b25a3236f9373bd51d9830f856caf713f026c9c6fc1bae409d717682af03eb938ab8be87b4a7bcd333e9d36b16cd49fb5bb2c3a774c28b75d0
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 06ED <hsbest123@gmail.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,70 @@
1
+ # fastlane-rustored
2
+
3
+ Fastlane plugin for publishing Android builds to RuStore.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ fastlane add_plugin rustored
9
+ ```
10
+
11
+ ## Actions
12
+
13
+ ### `rustored_publish_aab`
14
+
15
+ Publishes an AAB file.
16
+
17
+ ```ruby
18
+ rustored_publish_aab(
19
+ token: ENV["RUSTORE_TOKEN"],
20
+ package_name: "com.example.app",
21
+ version_id: "123456",
22
+ aab_path: "app/build/outputs/bundle/release/app-release.aab"
23
+ )
24
+ ```
25
+
26
+ ### `rustored_publish_apk`
27
+
28
+ Publishes an APK file.
29
+
30
+ ```ruby
31
+ rustored_publish_apk(
32
+ token: ENV["RUSTORE_TOKEN"],
33
+ package_name: "com.example.app",
34
+ version_id: "123456",
35
+ apk_path: "app/build/outputs/apk/release/app-release.apk",
36
+ services_type: "Unknown",
37
+ is_main_apk: true
38
+ )
39
+ ```
40
+
41
+ ## Options
42
+
43
+ Shared:
44
+
45
+ | Option | Env | Required |
46
+ | --- | --- | --- |
47
+ | `token` | `RUSTORE_TOKEN` | yes |
48
+ | `package_name` | `RUSTORE_PACKAGE_NAME` | yes |
49
+ | `version_id` | `RUSTORE_VERSION_ID` | yes |
50
+
51
+ AAB:
52
+
53
+ | Option | Env | Required |
54
+ | --- | --- | --- |
55
+ | `aab_path` | `RUSTORE_AAB_PATH` | yes |
56
+
57
+ APK:
58
+
59
+ | Option | Env | Required |
60
+ | --- | --- | --- |
61
+ | `apk_path` | `RUSTORE_APK_PATH` | yes |
62
+ | `services_type` | `RUSTORE_SERVICES_TYPE` | no |
63
+ | `is_main_apk` | `RUSTORE_IS_MAIN_APK` | yes |
64
+
65
+ ## Test
66
+
67
+ ```bash
68
+ bundle exec rspec
69
+ bundle exec rubocop
70
+ ```
@@ -0,0 +1,48 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/configuration/config_item'
3
+
4
+ require_relative '../helper/rustored_helper'
5
+ require_relative '../helper/rustored_options'
6
+
7
+ module Fastlane
8
+ module Actions
9
+ class RustoredPublishAabAction < Action
10
+ def self.run(params)
11
+ Fastlane::Helper::RustoredHelper.publish_aab(
12
+ token: params[:token],
13
+ package_name: params[:package_name],
14
+ version_id: params[:version_id],
15
+ aab_path: params[:aab_path]
16
+ )
17
+ end
18
+
19
+ def self.description
20
+ "Publish an AAB file to RuStore"
21
+ end
22
+
23
+ def self.authors
24
+ ["06ED"]
25
+ end
26
+
27
+ def self.details
28
+ "Uploads an Android App Bundle to an existing RuStore app version."
29
+ end
30
+
31
+ def self.available_options
32
+ Fastlane::Helper::RustoredOptions.common_options + [
33
+ FastlaneCore::ConfigItem.new(
34
+ key: :aab_path,
35
+ env_name: "RUSTORE_AAB_PATH",
36
+ description: "Path to the AAB file you want to publish",
37
+ optional: false,
38
+ type: String
39
+ )
40
+ ]
41
+ end
42
+
43
+ def self.is_supported?(platform)
44
+ [:android].include?(platform)
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,64 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/configuration/config_item'
3
+
4
+ require_relative '../helper/rustored_helper'
5
+ require_relative '../helper/rustored_options'
6
+
7
+ module Fastlane
8
+ module Actions
9
+ class RustoredPublishApkAction < Action
10
+ def self.run(params)
11
+ Fastlane::Helper::RustoredHelper.publish_apk(
12
+ token: params[:token],
13
+ package_name: params[:package_name],
14
+ version_id: params[:version_id],
15
+ services_type: params[:services_type],
16
+ is_main_apk: params[:is_main_apk],
17
+ apk_path: params[:apk_path]
18
+ )
19
+ end
20
+
21
+ def self.description
22
+ "Publish an APK file to RuStore"
23
+ end
24
+
25
+ def self.authors
26
+ ["06ED"]
27
+ end
28
+
29
+ def self.details
30
+ "Uploads an APK to an existing RuStore app version."
31
+ end
32
+
33
+ def self.available_options
34
+ Fastlane::Helper::RustoredOptions.common_options + [
35
+ FastlaneCore::ConfigItem.new(
36
+ key: :apk_path,
37
+ env_name: "RUSTORE_APK_PATH",
38
+ description: "Path to the APK file you want to publish",
39
+ optional: false,
40
+ type: String
41
+ ),
42
+ FastlaneCore::ConfigItem.new(
43
+ key: :services_type,
44
+ env_name: "RUSTORE_SERVICES_TYPE",
45
+ description: "The APK services type",
46
+ optional: true,
47
+ type: String
48
+ ),
49
+ FastlaneCore::ConfigItem.new(
50
+ key: :is_main_apk,
51
+ env_name: "RUSTORE_IS_MAIN_APK",
52
+ description: "Whether this APK is the main APK",
53
+ optional: false,
54
+ type: Boolean
55
+ )
56
+ ]
57
+ end
58
+
59
+ def self.is_supported?(platform)
60
+ [:android].include?(platform)
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,59 @@
1
+ require 'fastlane_core/ui/ui'
2
+ require 'faraday'
3
+ require 'json'
4
+
5
+ module Fastlane
6
+ UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
7
+
8
+ module Helper
9
+ class RustoredHelper
10
+ BASE_URL = 'https://public-api.rustore.ru/public/v1'
11
+
12
+ def self.client
13
+ @client ||= Faraday.new(url: BASE_URL) do |f|
14
+ f.request(:json)
15
+ f.request(:multipart)
16
+ f.response(:json)
17
+ end
18
+ end
19
+
20
+ def self.publish_aab(token:, package_name:, version_id:, aab_path:)
21
+ UI.message("Publishing AAB to Rustore...")
22
+
23
+ response = client.post("/application/#{package_name}/version/#{version_id}/aab") do |req|
24
+ req.headers['Public-Token'] = token
25
+ req.body = {
26
+ file: Faraday::UploadIO.new(aab_path, 'application/octet-stream')
27
+ }
28
+ end
29
+
30
+ if response.success? && response.body['code'] == 'OK'
31
+ UI.success("AAB published successfully!")
32
+ else
33
+ UI.error("Failed to publish AAB: #{response.status} - #{response.body['message']}")
34
+ end
35
+ end
36
+
37
+ def self.publish_apk(token:, package_name:, version_id:, services_type:, is_main_apk:, apk_path:)
38
+ UI.message("Publishing APK to Rustore...")
39
+
40
+ response = client.post("/application/#{package_name}/version/#{version_id}/apk") do |req|
41
+ req.headers['Public-Token'] = token
42
+
43
+ req.params['servicesType'] = services_type
44
+ req.params['isMainApk'] = is_main_apk
45
+
46
+ req.body = {
47
+ file: Faraday::UploadIO.new(apk_path, 'application/octet-stream')
48
+ }
49
+ end
50
+
51
+ if response.success? && response.body['code'] == 'OK'
52
+ UI.success("APK published successfully!")
53
+ else
54
+ UI.error("Failed to publish APK: #{response.status} - #{response.body['message']}")
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,33 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+
3
+ module Fastlane
4
+ module Helper
5
+ module RustoredOptions
6
+ def self.common_options
7
+ [
8
+ FastlaneCore::ConfigItem.new(
9
+ key: :token,
10
+ env_name: "RUSTORE_TOKEN",
11
+ description: "The token for authenticating with RuStore",
12
+ optional: false,
13
+ type: String
14
+ ),
15
+ FastlaneCore::ConfigItem.new(
16
+ key: :package_name,
17
+ env_name: "RUSTORE_PACKAGE_NAME",
18
+ description: "The package name of the app you want to publish",
19
+ optional: false,
20
+ type: String
21
+ ),
22
+ FastlaneCore::ConfigItem.new(
23
+ key: :version_id,
24
+ env_name: "RUSTORE_VERSION_ID",
25
+ description: "The version id of the app you want to publish",
26
+ optional: false,
27
+ type: String
28
+ )
29
+ ]
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module Rustored
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/rustored/version'
2
+
3
+ module Fastlane
4
+ module Rustored
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::Rustored.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-rustored
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - 06ED
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ email: hsbest123@gmail.com
13
+ executables: []
14
+ extensions: []
15
+ extra_rdoc_files: []
16
+ files:
17
+ - LICENSE
18
+ - README.md
19
+ - lib/fastlane/plugin/rustored.rb
20
+ - lib/fastlane/plugin/rustored/actions/rustored_publish_aab_action.rb
21
+ - lib/fastlane/plugin/rustored/actions/rustored_publish_apk_action.rb
22
+ - lib/fastlane/plugin/rustored/helper/rustored_helper.rb
23
+ - lib/fastlane/plugin/rustored/helper/rustored_options.rb
24
+ - lib/fastlane/plugin/rustored/version.rb
25
+ homepage: https://github.com/06ED/fastlane-rustored
26
+ licenses:
27
+ - MIT
28
+ metadata:
29
+ rubygems_mfa_required: 'true'
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '2.7'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubygems_version: 4.0.10
45
+ specification_version: 4
46
+ summary: Plugin for automating rustore publishing
47
+ test_files: []