fastlane-plugin-easy_deploy 0.1.2 → 0.1.3

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: 5172d6b6a0d011caa0d187afd646fc3783c27dad07833cfa9f5acae26572c8e2
4
- data.tar.gz: f8a6ea4ca13268d11269ff241fe60fb017aebdd5bdc113daeb405047e633dfc6
3
+ metadata.gz: 58643c731bc9e1b793ea01b77259220d140e7761a3e85262e0c33402775a0402
4
+ data.tar.gz: 9b256fc42a48a8b90d95070988bd170cacdb9ed86e316ec6f163f08b4dd7ec2a
5
5
  SHA512:
6
- metadata.gz: '008325e6b8fb1aeb8a61b19e4da1a25183b14f6afdc136b1fcef342403817ed85b5cd82e392e0e1a7788a41f0637572e648c1a74515a5944cb2eb33440ae0f81'
7
- data.tar.gz: 441c238f746b562e193bc8101c0d7051e9f7acb3d6b7af470cc4df943d85f5ddf06b75149a02052910656a2a83295897ebd880451c43d7364c0b747fbb5055b9
6
+ metadata.gz: 69d2551d7ea41f6a97fa542570a81e8845c6cb22f6243411a61c1e07f49e80cdc0a00865f4ad51da49830e7c482a98ff75bcc4a2d16801dd3305ed373d124cd5
7
+ data.tar.gz: 5c769ee05b37ec075217dc02de4f57ac1a0a87aed23cb6f7e682fbf3385c81693625e7dc8b87dba175868299487c0c4d57168120529c265a0a0e7defddbde535
@@ -1,5 +1,5 @@
1
1
  require 'fastlane/action'
2
- require_relative '../helper/easy_deploy_helper'
2
+ require_relative '../helpers/easy_deploy_helper'
3
3
 
4
4
  module Fastlane
5
5
  module Actions
@@ -0,0 +1,32 @@
1
+ APP_BUNDLE_ID = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
2
+ TEAM_ID = CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
3
+
4
+ APP_PROD_PROFILE = "match AppStore #{APP_BUNDLE_ID}".freeze()
5
+ APP_DEV_PROFILE = "match Development #{APP_BUNDLE_ID}".freeze()
6
+
7
+ IOS_DEV_CERT = "Apple Development: Created via API (#{APP_STORE_KEY_ID})".freeze()
8
+
9
+ IOS_APP = load_json(json_path: "app.json")["name"]
10
+ IOS_PROJECT = "ios/#{IOS_APP}.xcodeproj".freeze()
11
+ IOS_WORKSPACE = "ios/#{IOS_APP}.xcworkspace".freeze()
12
+
13
+ APP_STORE_KEY_LOCATION = "fastlane/app_store_key.p8".freeze()
14
+
15
+ IS_DRAFT_ANDROID_BUILD = false unless defined? IS_DRAFT_ANDROID_BUILD
16
+ CURRENT_TIME = Time.now.strftime("%m%d%H%M")
17
+
18
+ lane :set_env do |options|
19
+ unless Schema.all.count > 1
20
+
21
+ # Produce production bundle
22
+ package = load_json(json_path: "package.json")
23
+ ENV["APP_ENV"] = options[:env]
24
+ ENV["BUNDLE_VERSION"] = package["version"]
25
+ if options[:env] == "PRODUCTION"
26
+ sh("cd .. && sh ./scripts/copyFirebaseConfig.sh PROD")
27
+ else
28
+ sh("cd .. && sh ./scripts/copyFirebaseConfig.sh")
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ import("#{FASTLANE_EXTENSION_LOCATION}src/utils/keychain.rb")
4
+ import("#{FASTLANE_EXTENSION_LOCATION}src/utils/targets.rb")
5
+ import("#{FASTLANE_EXTENSION_LOCATION}src/utils/schemas.rb")
6
+
7
+ lane :app_store_connect do
8
+ ensure_temp_keychain()
9
+ app_store_connect_api_key(
10
+ key_id: APP_STORE_KEY_ID,
11
+ issuer_id: APP_STORE_KEY_ISSUER,
12
+ key_filepath: APP_STORE_KEY_LOCATION,
13
+ in_house: false,
14
+ )
15
+ end
16
+
17
+ lane :get_credentials do
18
+ unless ENV["CREDENTIALS_PASSWORD"]
19
+ puts("Looks like CREDENTIALS_PASSWORD doesn't exist in your .env")
20
+ ENV["CREDENTIALS_PASSWORD"] = prompt(text: "Decryption pass: ", secure_text: true)
21
+ end
22
+ sh("cd .. && ./scripts/getCredentials.sh")
23
+
24
+ app_store_connect unless should_skip_ios()
25
+ end
26
+
27
+ def toggle_airship_production_android(bool)
28
+ set_properties_value(
29
+ path: "android/app/src/main/assets/airshipconfig.properties",
30
+ key: "inProduction",
31
+ value: bool,
32
+ )
33
+ end
34
+
35
+ lane :manual_on do |options|
36
+ Target.all.each do |target|
37
+ update_code_signing_settings(
38
+ use_automatic_signing: false,
39
+ team_id: TEAM_ID,
40
+ targets: [target.identifier],
41
+ path: IOS_PROJECT,
42
+ code_sign_identity: options[:certificate] || "iPhone Distribution",
43
+ profile_name: options[:profile] + (options[:bundle_suffix] || "") + target.bundle_suffix,
44
+ )
45
+ end
46
+ end
47
+
48
+ lane :manual_off do
49
+ signing_targets = Target.all.map(&:identifier)
50
+
51
+ update_code_signing_settings(
52
+ use_automatic_signing: true,
53
+ team_id: TEAM_ID,
54
+ profile_name: "",
55
+ targets: signing_targets,
56
+ path: IOS_PROJECT,
57
+ code_sign_identity: "Apple Development",
58
+ )
59
+ end
60
+
61
+ lane :ios_build_prod do
62
+ build_app(
63
+ workspace: IOS_WORKSPACE,
64
+ scheme: IOS_APP,
65
+ output_directory: ".",
66
+ output_name: "app.ipa",
67
+ suppress_xcode_output: ENV["SUPPRESS_XCODE_OUTPUT"],
68
+ silent: ENV["SILENT_XCODE_BUILD"],
69
+ )
70
+ end
71
+
72
+ lane :ios_build_firebase do |options|
73
+ provisioning_profiles = {}
74
+
75
+ Target.all.each do |target|
76
+ bundle_id = APP_BUNDLE_ID + (options[:bundle_suffix] || "") + target.bundle_suffix
77
+ provisioning_profiles[bundle_id] = APP_DEV_PROFILE + (options[:bundle_suffix] || "") + target.bundle_suffix
78
+ end
79
+
80
+ build_app(
81
+ configuration: options[:configuration] || "",
82
+ workspace: IOS_WORKSPACE,
83
+ scheme: IOS_APP,
84
+ output_directory: ".",
85
+ output_name: "app.ipa",
86
+ export_options: {
87
+ method: "development",
88
+ provisioningProfiles: provisioning_profiles,
89
+ signingCertificate: IOS_DEV_CERT,
90
+ },
91
+ suppress_xcode_output: ENV["SUPPRESS_XCODE_OUTPUT"],
92
+ silent: ENV["SILENT_XCODE_BUILD"],
93
+ )
94
+ end
95
+
96
+ lane :ios_match_development do |options|
97
+ identifiers = Target.all.map {|target| APP_BUNDLE_ID + (options[:bundle_suffix] || "") + target.bundle_suffix }
98
+
99
+ match(
100
+ app_identifier: identifiers,
101
+ type: "development",
102
+ force_for_new_devices: true,
103
+ )
104
+ end
105
+
106
+ lane :ios_match_appstore do
107
+ identifiers = Target.all.map {|target| APP_BUNDLE_ID + target.bundle_suffix }
108
+
109
+ match(
110
+ app_identifier: identifiers,
111
+ type: "appstore",
112
+ )
113
+ end
114
+
115
+ def should_skip_android
116
+ ENV["SKIP_ANDROID"] == "true"
117
+ end
118
+
119
+ def should_skip_ios
120
+ ENV["SKIP_IOS"] == "true"
121
+ end
122
+
123
+ def add_optional_jdk
124
+ return {} unless ENV["JDK_LOCATION"]
125
+
126
+ return {
127
+ "org.gradle.java.home" => ENV["JDK_LOCATION"],
128
+ }
129
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ TEMP_KEYCHAIN_USER = "temp_build_keychain"
4
+ TEMP_KEYCHAIN_PASSWORD = "temp_build_keychain_pass"
5
+
6
+ def delete_temp_keychain
7
+ return unless File.exist? File.expand_path("~/Library/Keychains/#{TEMP_KEYCHAIN_USER}-db")
8
+
9
+ delete_keychain(
10
+ name: TEMP_KEYCHAIN_USER,
11
+ )
12
+ end
13
+
14
+ def create_temp_keychain
15
+ create_keychain(
16
+ name: TEMP_KEYCHAIN_USER,
17
+ password: TEMP_KEYCHAIN_PASSWORD,
18
+ unlock: true,
19
+ timeout: 0,
20
+ )
21
+ end
22
+
23
+ def ensure_temp_keychain
24
+ delete_temp_keychain()
25
+ create_temp_keychain()
26
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ IOS_FB_CONFIG_LOCATION = "ios/"
4
+ ANDROID_FB_CONFIG_LOCATION = "android/app/"
5
+
6
+ class Schema
7
+ @@all = {}
8
+
9
+ attr_accessor :identifier, :bundle_suffix
10
+
11
+ def initialize(*args)
12
+ @identifier, @bundle_suffix = args
13
+ @@all[@identifier] = {
14
+ identifier: @identifier,
15
+ bundle_suffix: @bundle_suffix,
16
+ }
17
+ end
18
+
19
+ def attrs
20
+ instance_variables.map {|ivar| instance_variable_get ivar }
21
+ end
22
+
23
+ def self.all
24
+ @@all
25
+ end
26
+ end
27
+
28
+ Schema.new("Release", "")
29
+
30
+ def get_schema(schema_id="")
31
+ Schema.all[schema_id]
32
+ end
33
+
34
+ def get_ios_fb_app_id_by_schema(schema)
35
+ scheme_suffix = schema ? "-#{schema[:identifier]}" : ""
36
+
37
+ return get_info_plist_value(path: "#{IOS_FB_CONFIG_LOCATION}GoogleService#{scheme_suffix}-Info.plist",
38
+ key: "GOOGLE_APP_ID")
39
+ end
40
+
41
+ def get_android_fb_app_id_by_schema(schema)
42
+ location_suffix = schema ? "src/#{schema[:identifier]}/" : ""
43
+
44
+ app_id = load_json(json_path:
45
+ ANDROID_FB_CONFIG_LOCATION + location_suffix +
46
+ "google-services.json")["client"][0]["client_info"]["mobilesdk_app_id"]
47
+
48
+ return app_id
49
+ end
50
+
51
+ def get_android_flavor(schema)
52
+ return schema ? schema[:identifier] : "Release"
53
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Target
4
+ @@all = []
5
+
6
+ attr_accessor :identifier, :bundle_suffix
7
+
8
+ def initialize(*args)
9
+ @@all.push(self)
10
+ @identifier, @bundle_suffix = args
11
+ end
12
+
13
+ def attrs
14
+ instance_variables.map {|ivar| instance_variable_get ivar }
15
+ end
16
+
17
+ def self.all
18
+ @@all
19
+ end
20
+ end
21
+
22
+ Target.new(IOS_APP, "")
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module EasyDeploy
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-easy_deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Baranauskas
@@ -161,7 +161,12 @@ files:
161
161
  - lib/fastlane/plugin/easy_deploy.rb
162
162
  - lib/fastlane/plugin/easy_deploy/actions/easy_deploy_action.rb
163
163
  - lib/fastlane/plugin/easy_deploy/actions/prerequisites_action.rb
164
- - lib/fastlane/plugin/easy_deploy/helper/easy_deploy_helper.rb
164
+ - lib/fastlane/plugin/easy_deploy/helpers/easy_deploy_helper.rb
165
+ - lib/fastlane/plugin/easy_deploy/helpers/env.rb
166
+ - lib/fastlane/plugin/easy_deploy/helpers/helpers.rb
167
+ - lib/fastlane/plugin/easy_deploy/helpers/keychain.rb
168
+ - lib/fastlane/plugin/easy_deploy/helpers/schemas.rb
169
+ - lib/fastlane/plugin/easy_deploy/helpers/targets.rb
165
170
  - lib/fastlane/plugin/easy_deploy/version.rb
166
171
  homepage: https://github.com/kilohealth/fastlane-plugin-easy_deploy
167
172
  licenses: