fastlane-plugin-upload_to_hira 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: 2169b6483c39b91432dceea1317597f2714e8304dc4b49a7c9aad3b72d6bb82a
4
+ data.tar.gz: 53c22d56c3a70c1008b3238bdd1286604ae8bdf115521f3bdb26f7b897624aba
5
+ SHA512:
6
+ metadata.gz: e16dfcaa5945ae065a84ce3705632b98ce4fdf65795dbaeb8ee270bcfb8a767d67c6ba6312e3da5d11857e908dd9ff55fbdbbe75b4b6c28c9a9ccca2d67e1c52
7
+ data.tar.gz: d7eb117457cfb5788b314c77403369bd418473ec001d7fda2b5ee611762ae55dca69142ff55400f4c9c7810533b17e42a0a5908303dd1849d517591bac5655c4
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Hanif Ramadhan <hramadhaan20@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,52 @@
1
+ # upload_to_hira plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-upload_to_hira)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-upload_to_hira`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin upload_to_hira
11
+ ```
12
+
13
+ ## About upload_to_hira
14
+
15
+ upload to hira
16
+
17
+ **Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
18
+
19
+ ## Example
20
+
21
+ 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`.
22
+
23
+ **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
24
+
25
+ ## Run tests for this plugin
26
+
27
+ To run both the tests, and code style validation, run
28
+
29
+ ```
30
+ rake
31
+ ```
32
+
33
+ To automatically fix many of the styling issues, use
34
+ ```
35
+ rubocop -a
36
+ ```
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,99 @@
1
+ require 'fastlane/action'
2
+ require 'tty-spinner'
3
+ require_relative '../helper/upload_to_hira_helper'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class UploadToHiraAction < Action
8
+ def self.run(params)
9
+ app_path = params[:app_path]
10
+ token = params[:token]
11
+ app_url = params[:app_url]
12
+ upload_url = "http://localhost:8080/release/app"
13
+
14
+ unless File.exist?(app_path)
15
+ UI.error("File does not exist at path: #{app_path}")
16
+ return
17
+ end
18
+
19
+ spinner = TTY::Spinner.new("[:spinner] Uploading IPA file...", format: :dots)
20
+ spinner.auto_spin
21
+
22
+ begin
23
+ command = [
24
+ "curl --location '#{upload_url}'",
25
+ "--header 'Authorization: #{token}'",
26
+ "--header 'X-API-Key: #{token}'",
27
+ "--form 'file=@#{app_path}'",
28
+ "--form 'app_url=#{app_url}'"
29
+ ].join(" ")
30
+ sh(command)
31
+
32
+ spinner.success("(Upload successfully)")
33
+ UI.success("IPA uploaded successfully!")
34
+ rescue StandardError => e
35
+ spinner.error("(Upload failed !)")
36
+ UI.error("Upload failed: #{e.message}")
37
+ end
38
+ end
39
+ end
40
+
41
+ #####################################################
42
+ # @!group Documentation
43
+ #####################################################
44
+
45
+ def self.description
46
+ "upload to hira"
47
+ end
48
+
49
+ def self.authors
50
+ ["Hanif Ramadhan"]
51
+ end
52
+
53
+ def self.return_value
54
+ # If your method provides a return value, you can describe here what it does
55
+ end
56
+
57
+ def self.details
58
+ # Optional:
59
+ "this plugin for upload the ipa or apk to hira dashboardd"
60
+ end
61
+
62
+ def self.available_options
63
+ [
64
+ FastlaneCore::ConfigItem.new(
65
+ key: :app_path,
66
+ env_name: "UPLOAD_TO_HIRA_APP_PATH",
67
+ description: "Path to the IPA or APK file",
68
+ type: String,
69
+ verify_block: proc do |value|
70
+ UI.user_error!("IPA file not found at path '#{value}'") unless File.exist?(value)
71
+ end
72
+ ),
73
+ FastlaneCore::ConfigItem.new(
74
+ key: :token,
75
+ env_name: "UPLOAD_TO_HIRA_TOKEN",
76
+ description: "Authorization token for the API",
77
+ type: String
78
+ ),
79
+ FastlaneCore::ConfigItem.new(
80
+ key: :app_url,
81
+ env_name: "UPLOAD_TO_HIRA_APP_URL",
82
+ description: "App URL for the API",
83
+ type: String
84
+ )
85
+ ]
86
+ end
87
+
88
+ def self.is_supported?(platform)
89
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
90
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
91
+ #
92
+ # [:ios, :mac, :android].include?(platform)
93
+ # true
94
+
95
+ [:ios, :mac, :android].include?(platform)
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
5
+
6
+ module Helper
7
+ class UploadToHiraHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::UploadToHiraHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the upload_to_hira plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module UploadToHira
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/upload_to_hira/version'
2
+
3
+ module Fastlane
4
+ module UploadToHira
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::UploadToHira.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-upload_to_hira
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Hanif Ramadhan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-03-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: tty-spinner
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description:
28
+ email: hramadhaan20@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE
34
+ - README.md
35
+ - lib/fastlane/plugin/upload_to_hira.rb
36
+ - lib/fastlane/plugin/upload_to_hira/actions/upload_to_hira_action.rb
37
+ - lib/fastlane/plugin/upload_to_hira/helper/upload_to_hira_helper.rb
38
+ - lib/fastlane/plugin/upload_to_hira/version.rb
39
+ homepage:
40
+ licenses:
41
+ - MIT
42
+ metadata:
43
+ rubygems_mfa_required: 'true'
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '2.6'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubygems_version: 3.0.3.1
60
+ signing_key:
61
+ specification_version: 4
62
+ summary: upload to hira
63
+ test_files: []