fastlane-plugin-setapp 0.1.1 → 0.1.3
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: ee8f1ec606090dda29299f0dc1439db3bfd92869d8dfe50fb8597cf9022334bd
|
4
|
+
data.tar.gz: 1db7583c07f4352f62bbc0699f0699228d678ad225edc38379fd1ca32afc1715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b7160e1fcd264124de622b04adeb823a9310de1656082d2b4150fae5bcaf9965c3033f6dc1f56e4205b6c58961ac4751690905acad5f84132b15ce0d0282e44
|
7
|
+
data.tar.gz: 530e37e665581cde0d4c15eaece9c49882ea0bae9dde46427d764b9b129e32737eb3fd9206ce45eb2d643f18c5b6a1797767eccc13efcbf51cf4e7624d19ca69
|
data/README.md
CHANGED
@@ -50,7 +50,8 @@ upload_setapp_build(
|
|
50
50
|
build_path: '...', # The path to archive with a new Setapp build
|
51
51
|
release_notes: '...', # Text or path to a file that contains release notes for a new version
|
52
52
|
version_status: 'review', # Version status. It can be `draft` or `review`
|
53
|
-
release_on_approval: true # Indicates whether Setapp must publish a new version after review
|
53
|
+
release_on_approval: true, # Indicates whether Setapp must publish a new version after review
|
54
|
+
is_beta: false # Is beta or stable build
|
54
55
|
)
|
55
56
|
```
|
56
57
|
|
@@ -9,11 +9,21 @@ module Fastlane
|
|
9
9
|
build_path = params[:build_path]
|
10
10
|
release_notes = params[:release_notes]
|
11
11
|
version_status = params[:version_status]
|
12
|
-
release_on_approval = params[:release_on_approval]
|
12
|
+
release_on_approval = params[:release_on_approval] ? "true" : "false"
|
13
|
+
is_beta = params[:is_beta] ? "true" : "false"
|
13
14
|
file_dir = File.dirname(__FILE__)
|
14
15
|
UI.user_error!("Available options for version_status: [draft, review].") unless ['draft', 'review'].include?(version_status)
|
15
16
|
UI.message("The build at path #{build_path} will be uploaded to Setapp")
|
16
|
-
|
17
|
+
script_path = "#{file_dir}/../helper/setapp_build_uploader.sh"
|
18
|
+
exit_code = system(
|
19
|
+
"bash", script_path,
|
20
|
+
"--token", api_token,
|
21
|
+
"--path", build_path,
|
22
|
+
"--notes", release_notes,
|
23
|
+
"--status", version_status,
|
24
|
+
"--release-on-approval", release_on_approval,
|
25
|
+
"--beta", is_beta
|
26
|
+
)
|
17
27
|
UI.user_error!("Uploading error occured. Try again.") if exit_code != true
|
18
28
|
end
|
19
29
|
|
@@ -73,6 +83,14 @@ module Fastlane
|
|
73
83
|
description: "Indicate whether Setapp must release new version automatically after review. Available options: `true`, `false`",
|
74
84
|
optional: false,
|
75
85
|
type: Boolean
|
86
|
+
),
|
87
|
+
FastlaneCore::ConfigItem.new(
|
88
|
+
key: :is_beta,
|
89
|
+
env_name: "SETAPP_BUILD_IS_BETA",
|
90
|
+
description: "Is beta or stable build. Available options: `true`, `false`",
|
91
|
+
optional: false,
|
92
|
+
default_value: false,
|
93
|
+
type: Boolean
|
76
94
|
)
|
77
95
|
]
|
78
96
|
end
|
@@ -35,6 +35,10 @@ function help() {
|
|
35
35
|
Indicate whether Setapp must publish a new version automatically after review approval.
|
36
36
|
Available options: (true/false)
|
37
37
|
|
38
|
+
-b | --beta
|
39
|
+
Is beta or stable build.
|
40
|
+
Available options: (true/false)
|
41
|
+
|
38
42
|
-h, --help
|
39
43
|
Usage help
|
40
44
|
"
|
@@ -79,6 +83,11 @@ function parse_params() {
|
|
79
83
|
release_on_approval="${1}"
|
80
84
|
fi
|
81
85
|
shift;;
|
86
|
+
-b | --beta)
|
87
|
+
if test $# -gt 0; then
|
88
|
+
beta="${1}"
|
89
|
+
fi
|
90
|
+
shift;;
|
82
91
|
*)
|
83
92
|
die "Invalid parameter was provided: $param" 1
|
84
93
|
;;
|
@@ -92,6 +101,7 @@ function check_parameters() {
|
|
92
101
|
[[ -z "${release_notes}" ]] && die "Missing required parameter: release-notes"
|
93
102
|
[[ -z "${version_status}" ]] && die "Missing required parameter: version-status"
|
94
103
|
[[ -z "${release_on_approval}" ]] && die "Missing required parameter: release-on-approval"
|
104
|
+
[[ -z "${beta}" ]] && die "Missing required parameter: beta"
|
95
105
|
}
|
96
106
|
|
97
107
|
function validate_server_response() {
|
@@ -99,7 +109,7 @@ function validate_server_response() {
|
|
99
109
|
local response_code=${server_response##*HTTPSTATUS:}
|
100
110
|
local response_body=$(echo ${server_response%%HTTPSTATUS*})
|
101
111
|
|
102
|
-
if [ $response_code -
|
112
|
+
if [ "$response_code" -ge 200 ] && [ "$response_code" -lt 300 ]; then
|
103
113
|
echo "✅ The app version is uploaded. All checks are passed."
|
104
114
|
elif [ $response_code -eq 401 ]; then
|
105
115
|
die "⚠️ Something went wrong with your API token.\n${response_body}"
|
@@ -120,6 +130,7 @@ function upload_binary() {
|
|
120
130
|
-F "release_notes=${release_notes}" \
|
121
131
|
-F "status=${version_status}" \
|
122
132
|
-F "release_on_approval=${release_on_approval}" \
|
133
|
+
-F "beta=${beta}" \
|
123
134
|
-F "archive=@${archive_path};type=application/zip"
|
124
135
|
)
|
125
136
|
validate_server_response "${response}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-setapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Setapp Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|