fastlane-plugin-taiwan_number_one 1.0.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d96498468a5871d8e612adb663a7f446ce026e9dfb1ba3ee6a6df3689d2ac786
|
4
|
+
data.tar.gz: 285b7cb87df61d33b387690f9d06c06e9834e078d6948ee46c7a1388eea342b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12ce29515257361ae7f814ca0fc93dd026a456c211457085071b353bf241ef10631b28ce1569bc3d20307e583e7f0b7dffb09da73a4e5619dfba6669d6c0b812
|
7
|
+
data.tar.gz: 8558a7f279b12c8e4efe192700cccd08ba2867903c71c60ecd346487e93143dfa2b032a9a8d775bb0a5fedd5efb3d9966a57db22ad2ceecefd85c6edf29e4ffc
|
data/README.md
CHANGED
@@ -70,7 +70,7 @@ and this:
|
|
70
70
|
```
|
71
71
|
desc "release App store version"
|
72
72
|
lane :release_app do
|
73
|
-
result = release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::
|
73
|
+
result = release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::DecisionType::RELEASE)
|
74
74
|
if result == Fastlane::Actions::TaiwanNumberOneAction::ActionResult::SUCCESS
|
75
75
|
# do your thing here!
|
76
76
|
end
|
@@ -86,7 +86,7 @@ lane :reject_app do
|
|
86
86
|
issuer_id: ENV["ISSUER_ID"],
|
87
87
|
key_content: ENV["ASC_API_KEY"]
|
88
88
|
)
|
89
|
-
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::
|
89
|
+
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::DecisionType::REJECT)
|
90
90
|
end
|
91
91
|
```
|
92
92
|
|
@@ -108,9 +108,9 @@ end
|
|
108
108
|
or
|
109
109
|
|
110
110
|
```
|
111
|
-
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::
|
111
|
+
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::DecisionType::RELEASE)
|
112
112
|
|
113
|
-
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::
|
113
|
+
release_decision(app_decision: Fastlane::Actions::TaiwanNumberOneAction::DecisionType::REJECT)
|
114
114
|
```
|
115
115
|
|
116
116
|
#### Use in terminal
|
@@ -53,13 +53,14 @@ module Fastlane
|
|
53
53
|
].join(","),
|
54
54
|
platform: platform
|
55
55
|
}
|
56
|
-
|
56
|
+
|
57
|
+
decision ||= fetch_decision(params)
|
57
58
|
if params[:force] && decision == DecisionType::REJECT
|
58
59
|
UI.message("decision is reject")
|
59
60
|
app_store_version = app.get_app_store_versions(client: client, includes: "appStoreVersionSubmission")
|
60
|
-
|
61
|
-
|
62
|
-
return reject_version_if_possible(
|
61
|
+
.sort_by { |v| Gem::Version.new(v.version_string) }
|
62
|
+
.last
|
63
|
+
return reject_version_if_possible(client: client, app_store_version: app_store_version)
|
63
64
|
end
|
64
65
|
|
65
66
|
app_store_version = app.get_app_store_versions(client: client, filter: filter, includes: "appStoreVersionSubmission")
|
@@ -74,16 +75,15 @@ module Fastlane
|
|
74
75
|
UI.message("🇹🇼 Taiwan helps you do nothing!")
|
75
76
|
return ActionResult::DO_NOTHING
|
76
77
|
end
|
77
|
-
decision ||= fetch_decision(params)
|
78
78
|
|
79
79
|
result = ActionResult::DO_NOTHING
|
80
80
|
case decision
|
81
81
|
when DecisionType::RELEASE
|
82
82
|
UI.message("decision is release")
|
83
|
-
result = release_version_if_possible(
|
83
|
+
result = release_version_if_possible(client: client, app_store_version: app_store_version, token: token)
|
84
84
|
when DecisionType::REJECT
|
85
85
|
UI.message("decision is reject")
|
86
|
-
result = reject_version_if_possible(
|
86
|
+
result = reject_version_if_possible(client: client, app_store_version: app_store_version)
|
87
87
|
else
|
88
88
|
UI.user_error!("App's decision must be release or reject")
|
89
89
|
result = ActionResult::DO_NOTHING
|
@@ -127,13 +127,13 @@ module Fastlane
|
|
127
127
|
end
|
128
128
|
|
129
129
|
begin
|
130
|
-
if token
|
130
|
+
if token
|
131
131
|
now = Time.now
|
132
132
|
release_date_string = now.strftime("%Y-%m-%dT%H:00%:z")
|
133
133
|
app_store_version.update(attributes: {
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
earliest_release_date: release_date_string,
|
135
|
+
release_type: Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
|
136
|
+
})
|
137
137
|
return ActionResult::SUCCESS
|
138
138
|
else
|
139
139
|
app_store_version.create_app_store_version_release_request
|
@@ -146,19 +146,19 @@ module Fastlane
|
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
|
-
|
150
|
-
|
151
|
-
|
149
|
+
# For example https://appstoreconnect.apple.com/iris/v1/appStoreVersionSubmissions/575ee084-a3a6-4664-8ba5-49dd77a00927
|
150
|
+
# Request Method: DELETE
|
151
|
+
def self.reject_version_if_possible(client: Spaceship::ConnectAPI, app_store_version: Spaceship::ConnectAPI::AppStoreVersion)
|
152
|
+
if app_store_version.app_store_state == Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::DEVELOPER_REJECTED
|
153
|
+
UI.message("app_store_state is already #{app_store_version.app_store_state}")
|
154
|
+
UI.message("🇹🇼 Taiwan helps you do nothing!")
|
152
155
|
return ActionResult::DO_NOTHING
|
153
156
|
end
|
154
157
|
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
UI.user_error!("An error occurred while rejected version #{app_store_version}")
|
160
|
-
return ActionResult::DO_NOTHING
|
161
|
-
end
|
158
|
+
client.delete_app_store_version_submission(app_store_version_submission_id: app_store_version.id)
|
159
|
+
UI.success("Rejected version #{app_store_version.version_string} Successfully!")
|
160
|
+
UI.message("🇹🇼 Taiwan can help!")
|
161
|
+
return ActionResult::SUCCESS
|
162
162
|
end
|
163
163
|
|
164
164
|
def self.api_token(params)
|
@@ -186,8 +186,8 @@ module Fastlane
|
|
186
186
|
|
187
187
|
def self.output
|
188
188
|
[
|
189
|
-
[ActionResult::SUCCESS,
|
190
|
-
[ActionResult::DO_NOTHING,
|
189
|
+
[ActionResult::SUCCESS, "Successfully release or reject."],
|
190
|
+
[ActionResult::DO_NOTHING, "Do nothing."]
|
191
191
|
]
|
192
192
|
end
|
193
193
|
|
@@ -258,7 +258,7 @@ module Fastlane
|
|
258
258
|
env_name: "FL_DECISION_FORCE",
|
259
259
|
description: "Skip verifying of current version state for reject reviewed version or cancel waiting review version",
|
260
260
|
is_string: false,
|
261
|
-
default_value: false)
|
261
|
+
default_value: false)
|
262
262
|
]
|
263
263
|
end
|
264
264
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-taiwan_number_one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- andrew54068
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|