fastlane-craft 1.3.12 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane-craft/app_release_manager.rb +1 -0
- data/lib/fastlane-craft/info_plist_controller.rb +1 -0
- data/lib/fastlane-craft/telegram_notifier.rb +1 -0
- data/lib/fastlane-craft/upload_dsym.rb +35 -35
- data/lib/fastlane-craft/upload_to_s3.rb +127 -127
- data/lib/fastlane-craft/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b8499c0d0064edadabc667cce7b5ed6be67e96d9d08567b0be91daf95917ac3
|
4
|
+
data.tar.gz: fdc52b0ac3cc687875fca4d19498cf075a920114b6ac5096732a05aa51914ee5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f72ff63a3a609d43b4614c9642e80eee843a7221afa2f091c2eb2b6860ca19dd71f64c440767a8a7d4eca83da55573e8627a7d16532dc84336b0172348ce25
|
7
|
+
data.tar.gz: a681ce300e49fb8350255e96115f99de2a868d16af584de19be3c22fa9acb0e80b3b42c148b33f2a8c5977d8cebdbf96adc86bf2a78427d466647639abf36521
|
@@ -7,6 +7,7 @@ module FastlaneCraft
|
|
7
7
|
def initialize(info_plist, extra_info_plists = [])
|
8
8
|
raise 'Invalid Info Plist Path' unless File.file?(info_plist)
|
9
9
|
raise 'Invalid Extra Info Plists Paths' unless extra_info_plists.all? { |p| File.file?(p) }
|
10
|
+
|
10
11
|
@info_plist = info_plist
|
11
12
|
@extra_info_plists = extra_info_plists
|
12
13
|
end
|
@@ -7,7 +7,7 @@ module Fastlane
|
|
7
7
|
kind = params[:kind]
|
8
8
|
version = params[:version]
|
9
9
|
dsym_path = params[:dSYM]
|
10
|
-
dsym_name = File.basename(dsym_path,
|
10
|
+
dsym_name = File.basename(dsym_path, '.*')
|
11
11
|
dsym_ext = File.extname(dsym_path)
|
12
12
|
|
13
13
|
bucket = params[:space] || params[:bucket]
|
@@ -24,16 +24,16 @@ module Fastlane
|
|
24
24
|
|
25
25
|
UI.message "Check whether destination bucket #{bucket} exists..💤"
|
26
26
|
begin
|
27
|
-
response = client.create_bucket(
|
27
|
+
response = client.create_bucket(
|
28
28
|
bucket: bucket,
|
29
29
|
acl: acl
|
30
|
-
|
30
|
+
)
|
31
31
|
UI.message "Bucket #{bucket} created! ✨"
|
32
32
|
rescue Aws::S3::Errors::BucketAlreadyExists
|
33
33
|
UI.message "Bucket #{bucket} alredy exists 👌"
|
34
34
|
end
|
35
35
|
|
36
|
-
UI.message
|
36
|
+
UI.message 'Going to upload dSYM..💤'
|
37
37
|
File.open(dsym_path, 'r') do |body|
|
38
38
|
response = client.put_object(
|
39
39
|
acl: acl,
|
@@ -51,91 +51,91 @@ module Fastlane
|
|
51
51
|
#####################################################
|
52
52
|
|
53
53
|
def self.description
|
54
|
-
|
54
|
+
'Upload dSYM archive to S3 or Spaces'
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.available_options
|
58
58
|
[
|
59
59
|
FastlaneCore::ConfigItem.new(key: :kind,
|
60
|
-
env_name:
|
60
|
+
env_name: 'FL_UPLOAD_DSYM_KIND',
|
61
61
|
description: "Origin of the dSYM ('Beta', 'Release', etc)",
|
62
62
|
is_string: true,
|
63
63
|
default_value: ENV['BITRISE_TRIGGERED_WORKFLOW_TITLE'],
|
64
64
|
verify_block: proc do |value|
|
65
|
-
UI.user_error!("No kind for UploadDsymAction given, pass using `kind: 'kind'`") unless
|
65
|
+
UI.user_error!("No kind for UploadDsymAction given, pass using `kind: 'kind'`") unless value && !value.empty?
|
66
66
|
end),
|
67
67
|
FastlaneCore::ConfigItem.new(key: :version,
|
68
|
-
env_name:
|
68
|
+
env_name: 'FL_UPLOAD_DSYM_VERSION',
|
69
69
|
description: "Version of a constructed .ipa. (Build number '321', App version '1.2.3', etc.)",
|
70
70
|
is_string: true,
|
71
71
|
default_value: ENV['APP_RELEASE_BUILD_NUMBER'] || ENV['BITRISE_BUILD_NUMBER'],
|
72
72
|
verify_block: proc do |value|
|
73
|
-
UI.user_error!("No version for UploadDsymAction given, pass using `version: 'version'`") unless
|
73
|
+
UI.user_error!("No version for UploadDsymAction given, pass using `version: 'version'`") unless value && !value.empty?
|
74
74
|
end),
|
75
75
|
FastlaneCore::ConfigItem.new(key: :dSYM,
|
76
|
-
env_name:
|
77
|
-
description:
|
76
|
+
env_name: 'FL_UPLOAD_DSYM_PATH',
|
77
|
+
description: 'Archived dSYM files',
|
78
78
|
is_string: true,
|
79
79
|
default_value: ENV['DSYM_OUTPUT_PATH'] || Dir['*.dSYM.zip'].first,
|
80
80
|
verify_block: proc do |value|
|
81
|
-
|
81
|
+
UI.user_error!("Couldn't find dSYM file at path '#{value}'") unless File.exist?(value)
|
82
82
|
end),
|
83
83
|
FastlaneCore::ConfigItem.new(key: :region,
|
84
|
-
env_name:
|
85
|
-
description:
|
84
|
+
env_name: 'FL_UPLOAD_DSYM_REGION',
|
85
|
+
description: 'Region for S3 or Spaces',
|
86
86
|
is_string: true,
|
87
87
|
default_value: 'ams3',
|
88
88
|
verify_block: proc do |value|
|
89
|
-
|
89
|
+
UI.user_error!("No region for UploadDsymAction given, pass using `region: 'region'`") unless value && !value.empty?
|
90
90
|
end),
|
91
91
|
FastlaneCore::ConfigItem.new(key: :endpoint,
|
92
|
-
env_name:
|
93
|
-
description:
|
92
|
+
env_name: 'FL_UPLOAD_DSYM_ENDPOINT',
|
93
|
+
description: 'Endpoint for S3 or Spaces',
|
94
94
|
is_string: true,
|
95
95
|
default_value: 'https://ams3.digitaloceanspaces.com',
|
96
96
|
verify_block: proc do |value|
|
97
|
-
|
97
|
+
UI.user_error!("No Endpoint for UploadDsymAction given, pass using `endpoint: 'endpoint'`") unless value && !value.empty?
|
98
98
|
end),
|
99
99
|
FastlaneCore::ConfigItem.new(key: :access_key,
|
100
|
-
env_name:
|
101
|
-
description:
|
100
|
+
env_name: 'FL_UPLOAD_DSYM_S3_ACCESS_KEY',
|
101
|
+
description: 'Access Key for S3 or Spaces',
|
102
102
|
is_string: true,
|
103
103
|
verify_block: proc do |value|
|
104
|
-
|
104
|
+
raise "No Access Key for UploadDsymAction given, pass using `access_key: 'access_key'`".red unless value && !value.empty?
|
105
105
|
end),
|
106
106
|
FastlaneCore::ConfigItem.new(key: :secret_access_key,
|
107
|
-
env_name:
|
108
|
-
description:
|
107
|
+
env_name: 'FL_UPLOAD_DSYM_S3_SECRET_ACCESS_KEY',
|
108
|
+
description: 'Secret Access Key for S3 or Spaces',
|
109
109
|
is_string: true,
|
110
110
|
verify_block: proc do |value|
|
111
|
-
|
111
|
+
raise "No Secret Access Key for UploadDsymAction given, pass using `secret_access_key: 'secret_access_key'`".red unless value && !value.empty?
|
112
112
|
end),
|
113
113
|
FastlaneCore::ConfigItem.new(key: :bucket,
|
114
|
-
env_name:
|
115
|
-
description:
|
114
|
+
env_name: 'FL_UPLOAD_DSYM_S3_BUCKET',
|
115
|
+
description: 'Bucket for S3 or Spaces',
|
116
116
|
is_string: true,
|
117
117
|
default_value: 'default',
|
118
118
|
verify_block: proc do |value|
|
119
|
-
|
119
|
+
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless value && !value.empty?
|
120
120
|
end),
|
121
121
|
FastlaneCore::ConfigItem.new(key: :space,
|
122
|
-
env_name:
|
123
|
-
description:
|
122
|
+
env_name: 'FL_UPLOAD_DSYM_SPACE',
|
123
|
+
description: 'Digital Ocean Space',
|
124
124
|
is_string: true,
|
125
125
|
default_value: 'appcraft-dsym'),
|
126
126
|
FastlaneCore::ConfigItem.new(key: :acl,
|
127
|
-
env_name:
|
128
|
-
description:
|
127
|
+
env_name: 'FL_UPLOAD_DSYM_S3_ACL',
|
128
|
+
description: 'Access level for the file',
|
129
129
|
is_string: true,
|
130
|
-
default_value:
|
130
|
+
default_value: 'private',
|
131
131
|
verify_block: proc do |value|
|
132
|
-
|
133
|
-
end)
|
132
|
+
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless value && !value.empty?
|
133
|
+
end)
|
134
134
|
]
|
135
135
|
end
|
136
136
|
|
137
137
|
def self.authors
|
138
|
-
[
|
138
|
+
['https://github.com/sroik', 'https://github.com/elfenlaid']
|
139
139
|
end
|
140
140
|
|
141
141
|
def self.is_supported?(platform)
|
@@ -1,144 +1,144 @@
|
|
1
1
|
module Fastlane
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
UPLOADED_S3_URL = 'UPLOAD_S3_URL'.freeze
|
5
|
+
end
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
class UploadToS3Action < Action
|
8
|
+
def self.run(params)
|
9
|
+
require 'aws-sdk-s3'
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
local_path = params[:path]
|
12
|
+
local_name = File.basename(local_path)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
bucket = params[:space] || params[:bucket]
|
15
|
+
acl = params[:acl]
|
16
|
+
file_key = local_name
|
17
|
+
file_path = params[:space] ? params[:bucket] + '/' + file_key : file_key
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
client = Aws::S3::Client.new(
|
20
|
+
access_key_id: params[:access_key],
|
21
|
+
secret_access_key: params[:secret_access_key],
|
22
|
+
endpoint: params[:endpoint],
|
23
|
+
region: params[:region]
|
24
|
+
)
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
UI.message "Going to upload file to s3..💤"
|
39
|
-
|
40
|
-
File.open(local_path, 'r') do |body|
|
41
|
-
response = client.put_object(
|
42
|
-
acl: acl,
|
43
|
-
bucket: bucket,
|
44
|
-
key: file_path,
|
45
|
-
body: body
|
46
|
-
)
|
47
|
-
|
48
|
-
object = Aws::S3::Object.new(
|
49
|
-
key: file_path,
|
50
|
-
bucket_name: bucket,
|
51
|
-
client: client
|
52
|
-
)
|
53
|
-
|
54
|
-
url = object.public_url
|
55
|
-
|
56
|
-
UI.message "✨ file uploaded to #{url} ✨"
|
57
|
-
ENV[SharedValues::UPLOADED_S3_URL] = url
|
58
|
-
end
|
26
|
+
UI.message "Check whether destination bucket #{bucket} exists..💤"
|
27
|
+
|
28
|
+
begin
|
29
|
+
response = client.create_bucket(
|
30
|
+
bucket: bucket,
|
31
|
+
acl: 'private'
|
32
|
+
)
|
33
|
+
UI.message "✨ Bucket #{bucket} created! ✨"
|
34
|
+
rescue Aws::S3::Errors::BucketAlreadyExists
|
35
|
+
UI.message "Bucket #{bucket} alredy exists 👌"
|
59
36
|
end
|
60
37
|
|
61
|
-
|
62
|
-
# @!group Documentation
|
63
|
-
#####################################################
|
38
|
+
UI.message 'Going to upload file to s3..💤'
|
64
39
|
|
65
|
-
|
66
|
-
|
67
|
-
|
40
|
+
File.open(local_path, 'r') do |body|
|
41
|
+
response = client.put_object(
|
42
|
+
acl: acl,
|
43
|
+
bucket: bucket,
|
44
|
+
key: file_path,
|
45
|
+
body: body
|
46
|
+
)
|
68
47
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
is_string: true,
|
75
|
-
verify_block: proc do |value|
|
76
|
-
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
77
|
-
end),
|
78
|
-
FastlaneCore::ConfigItem.new(key: :region,
|
79
|
-
env_name: "FL_UPLOAD_S3_REGION",
|
80
|
-
description: "Region for S3 or Spaces",
|
81
|
-
is_string: true,
|
82
|
-
default_value: 'ams3',
|
83
|
-
verify_block: proc do |value|
|
84
|
-
UI.user_error!("No region for UploadToS3Action given, pass using `region: 'region'`") unless (value and not value.empty?)
|
85
|
-
end),
|
86
|
-
FastlaneCore::ConfigItem.new(key: :endpoint,
|
87
|
-
env_name: "FL_UPLOAD_S3_ENDPOINT",
|
88
|
-
description: "Endpoint for S3 or Spaces",
|
89
|
-
is_string: true,
|
90
|
-
default_value: 'https://ams3.digitaloceanspaces.com',
|
91
|
-
verify_block: proc do |value|
|
92
|
-
UI.user_error!("No Endpoint for UploadToS3Action given, pass using `endpoint: 'endpoint'`") unless (value and not value.empty?)
|
93
|
-
end),
|
94
|
-
FastlaneCore::ConfigItem.new(key: :access_key,
|
95
|
-
env_name: "FL_UPLOAD_S3_ACCESS_KEY",
|
96
|
-
description: "Access Key for S3 or Spaces",
|
97
|
-
is_string: true,
|
98
|
-
verify_block: proc do |value|
|
99
|
-
raise "No Access Key for UploadToS3Action given, pass using `access_key: 'access_key'`".red unless (value and not value.empty?)
|
100
|
-
end),
|
101
|
-
FastlaneCore::ConfigItem.new(key: :secret_access_key,
|
102
|
-
env_name: "FL_UPLOAD_S3_SECRET_ACCESS_KEY",
|
103
|
-
description: "Secret Access Key for S3 or Spaces",
|
104
|
-
is_string: true,
|
105
|
-
verify_block: proc do |value|
|
106
|
-
raise "No Secret Access Key for UploadToS3Action given, pass using `secret_access_key: 'secret_access_key'`".red unless (value and not value.empty?)
|
107
|
-
end),
|
108
|
-
FastlaneCore::ConfigItem.new(key: :bucket,
|
109
|
-
env_name: "FL_UPLOAD_S3_BUCKET",
|
110
|
-
description: "Bucket for S3 or Spaces",
|
111
|
-
is_string: true,
|
112
|
-
verify_block: proc do |value|
|
113
|
-
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless (value and not value.empty?)
|
114
|
-
end),
|
115
|
-
FastlaneCore::ConfigItem.new(key: :space,
|
116
|
-
env_name: "FL_UPLOAD_S3_SPACE",
|
117
|
-
description: "Digital Ocean Space",
|
118
|
-
is_string: true,
|
119
|
-
default_value: 'appcraft-files'),
|
120
|
-
FastlaneCore::ConfigItem.new(key: :acl,
|
121
|
-
env_name: "FL_UPLOAD_S3_ACL",
|
122
|
-
description: "Access level for the file",
|
123
|
-
is_string: true,
|
124
|
-
default_value: "public-read",
|
125
|
-
verify_block: proc do |value|
|
126
|
-
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless (value and not value.empty?)
|
127
|
-
end),
|
128
|
-
]
|
129
|
-
end
|
48
|
+
object = Aws::S3::Object.new(
|
49
|
+
key: file_path,
|
50
|
+
bucket_name: bucket,
|
51
|
+
client: client
|
52
|
+
)
|
130
53
|
|
131
|
-
|
132
|
-
["https://github.com/sroik", "https://github.com/elfenlaid"]
|
133
|
-
end
|
54
|
+
url = object.public_url
|
134
55
|
|
135
|
-
|
136
|
-
[
|
56
|
+
UI.message "✨ file uploaded to #{url} ✨"
|
57
|
+
ENV[SharedValues::UPLOADED_S3_URL] = url
|
137
58
|
end
|
59
|
+
end
|
138
60
|
|
139
|
-
|
140
|
-
|
141
|
-
|
61
|
+
#####################################################
|
62
|
+
# @!group Documentation
|
63
|
+
#####################################################
|
64
|
+
|
65
|
+
def self.description
|
66
|
+
'Upload file to S3 or Spaces'
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.available_options
|
70
|
+
[
|
71
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
72
|
+
env_name: 'FL_UPLOAD_S3_PATH',
|
73
|
+
description: 'Upload local path',
|
74
|
+
is_string: true,
|
75
|
+
verify_block: proc do |value|
|
76
|
+
UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
77
|
+
end),
|
78
|
+
FastlaneCore::ConfigItem.new(key: :region,
|
79
|
+
env_name: 'FL_UPLOAD_S3_REGION',
|
80
|
+
description: 'Region for S3 or Spaces',
|
81
|
+
is_string: true,
|
82
|
+
default_value: 'ams3',
|
83
|
+
verify_block: proc do |value|
|
84
|
+
UI.user_error!("No region for UploadToS3Action given, pass using `region: 'region'`") unless value && !value.empty?
|
85
|
+
end),
|
86
|
+
FastlaneCore::ConfigItem.new(key: :endpoint,
|
87
|
+
env_name: 'FL_UPLOAD_S3_ENDPOINT',
|
88
|
+
description: 'Endpoint for S3 or Spaces',
|
89
|
+
is_string: true,
|
90
|
+
default_value: 'https://ams3.digitaloceanspaces.com',
|
91
|
+
verify_block: proc do |value|
|
92
|
+
UI.user_error!("No Endpoint for UploadToS3Action given, pass using `endpoint: 'endpoint'`") unless value && !value.empty?
|
93
|
+
end),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :access_key,
|
95
|
+
env_name: 'FL_UPLOAD_S3_ACCESS_KEY',
|
96
|
+
description: 'Access Key for S3 or Spaces',
|
97
|
+
is_string: true,
|
98
|
+
verify_block: proc do |value|
|
99
|
+
raise "No Access Key for UploadToS3Action given, pass using `access_key: 'access_key'`".red unless value && !value.empty?
|
100
|
+
end),
|
101
|
+
FastlaneCore::ConfigItem.new(key: :secret_access_key,
|
102
|
+
env_name: 'FL_UPLOAD_S3_SECRET_ACCESS_KEY',
|
103
|
+
description: 'Secret Access Key for S3 or Spaces',
|
104
|
+
is_string: true,
|
105
|
+
verify_block: proc do |value|
|
106
|
+
raise "No Secret Access Key for UploadToS3Action given, pass using `secret_access_key: 'secret_access_key'`".red unless value && !value.empty?
|
107
|
+
end),
|
108
|
+
FastlaneCore::ConfigItem.new(key: :bucket,
|
109
|
+
env_name: 'FL_UPLOAD_S3_BUCKET',
|
110
|
+
description: 'Bucket for S3 or Spaces',
|
111
|
+
is_string: true,
|
112
|
+
verify_block: proc do |value|
|
113
|
+
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless value && !value.empty?
|
114
|
+
end),
|
115
|
+
FastlaneCore::ConfigItem.new(key: :space,
|
116
|
+
env_name: 'FL_UPLOAD_S3_SPACE',
|
117
|
+
description: 'Digital Ocean Space',
|
118
|
+
is_string: true,
|
119
|
+
default_value: 'appcraft-files'),
|
120
|
+
FastlaneCore::ConfigItem.new(key: :acl,
|
121
|
+
env_name: 'FL_UPLOAD_S3_ACL',
|
122
|
+
description: 'Access level for the file',
|
123
|
+
is_string: true,
|
124
|
+
default_value: 'public-read',
|
125
|
+
verify_block: proc do |value|
|
126
|
+
raise "No Bucket for UploadToS3Action given, pass using `bucket: 'bucket'`".red unless value && !value.empty?
|
127
|
+
end)
|
128
|
+
]
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.authors
|
132
|
+
['https://github.com/sroik', 'https://github.com/elfenlaid']
|
133
|
+
end
|
134
|
+
|
135
|
+
def self.output
|
136
|
+
['UPLOADED_S3_URL': 'Uploaded file s3 path']
|
137
|
+
end
|
138
|
+
|
139
|
+
def self.is_supported?(platform)
|
140
|
+
platform == :android || platform == :ios
|
142
141
|
end
|
143
142
|
end
|
144
143
|
end
|
144
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-craft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sroik
|
@@ -9,10 +9,10 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-12-
|
12
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: aws-sdk-s3
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">"
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: fastlane
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">"
|