fastlane-plugin-sxc_aliyun_oss 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0cc80241238d382cb39bef950d9157b22de882c4d983a2da5f3a6dd799f367d
4
- data.tar.gz: 172d6360c540b52c5483816265f616a067e028ebeb17e25b30704721fcbe0fd0
3
+ metadata.gz: f5e2998270862d3299a6673ffcd60befcd1a68c21ab11cd8ab5277033c65481c
4
+ data.tar.gz: a4469f45dacefe690c4e089924a776904014f37cd898cf09496243808ddbd359
5
5
  SHA512:
6
- metadata.gz: bfd3b4f2da21e71ee2d8bf1694b8be75c2aa483f0120ea9e0eb3faa2923f49879c5801e6642f60815d651036698e5f3de731bab399a6e46b718ba984d4e6a086
7
- data.tar.gz: 5d58a901868cd69b24612141625597fd8783c1c7722ddd8ec2396686512bec58b57c65346b6bf62a3b28d9c582841409e417f9c266af0ef3a2c1c297c86d6f83
6
+ metadata.gz: 8d18410174884a021e5de5dbe2277d15f51db7d7bf18d9329531cfcb53b7a31b8bcacbdd0ccb22a38620755579c65dfe9675e3f54f3ae691aba5921ff41b3f5e
7
+ data.tar.gz: 1894253b6fd2c3cb2c22de53ff14aab09eb9c656766a2fbb64e0e6e00994b1520228b203324f1dbb6688208d9bcf2f782c9c0cee41120b8cef1ff6ad1c1d2e36
@@ -11,11 +11,20 @@ module Fastlane
11
11
  bucket_name = params[:bucket]
12
12
  access_key_id = params[:access_key_id]
13
13
  access_key_secret = params[:access_key_secret]
14
- file_path = params[:file_path]
15
14
  object_key = params[:object_key]
16
15
 
17
16
  UI.message "endpoint: #{endpoint} bucket_name: #{bucket_name}"
18
17
 
18
+ build_file = [
19
+ params[:ipa],
20
+ params[:apk]
21
+ ].detect { |e| !e.to_s.empty? }
22
+
23
+ if build_file.nil?
24
+ UI.user_error!("You have to provide a build file")
25
+ end
26
+
27
+ UI.message "build_file: #{build_file}"
19
28
  # create aliyun oss client
20
29
  client = Aliyun::OSS::Client.new(
21
30
  endpoint: endpoint,
@@ -27,7 +36,7 @@ module Fastlane
27
36
  bucket = client.get_bucket(bucket_name)
28
37
  #
29
38
  UI.message "🚀uploading package..."
30
- bucket.put_object(object_key, :file => file_path)
39
+ bucket.put_object(object_key, :file => build_file)
31
40
  UI.message "✅uploading package success"
32
41
 
33
42
  end
@@ -71,11 +80,30 @@ module Fastlane
71
80
  description: "bucket is required!",
72
81
  optional: false,
73
82
  type: String),
74
- FastlaneCore::ConfigItem.new(key: :file_path,
75
- env_name: "ALIOSS_FILE_PATH",
76
- description: "file path is reqiured",
77
- optional: false,
78
- type: String),
83
+ FastlaneCore::ConfigItem.new(key: :apk,
84
+ env_name: "ALIOSS_APK",
85
+ description: "apk path",
86
+ default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
87
+ optional: true,
88
+ verify_block: proc do |value|
89
+ UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
90
+ end,
91
+ conflicting_options: [:ipa],
92
+ conflict_block: proc do |value|
93
+ UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
94
+ end),
95
+ FastlaneCore::ConfigItem.new(key: :ipa,
96
+ env_name: "ALIOSS_IPA",
97
+ description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action. For Mac zip the .app. For Android provide path to .apk file",
98
+ default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
99
+ optional: true,
100
+ verify_block: proc do |value|
101
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
102
+ end,
103
+ conflicting_options: [:apk],
104
+ conflict_block: proc do |value|
105
+ UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
106
+ end),
79
107
  FastlaneCore::ConfigItem.new(key: :object_key,
80
108
  env_name: "ALIOSS_OBJECT_KEY",
81
109
  description: "object_key is reqiured",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module SxcAliyunOss
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-sxc_aliyun_oss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JimmyDaddy