fastlane-plugin-react_native_release 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -2
- data/lib/fastlane/plugin/react_native_release/actions/create_fastlane_session_action.rb +63 -0
- data/lib/fastlane/plugin/react_native_release/actions/react_native_release_action.rb +3 -35
- data/lib/fastlane/plugin/react_native_release/actions/read_fastlane_session_action.rb +67 -0
- data/lib/fastlane/plugin/react_native_release/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b56dd04e4f45053993e073fb79a804c7280c02a323b8a4d8d0faff8013bd3a
|
4
|
+
data.tar.gz: a656b84729a0f3257da1699386f2cb3d1761a8dd0187f206a0a99a690fa32c41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 863e046372fedf07bde580efa5f2301afa51cb9d35ad43beaf0db0f063b8f703b7ee8f8d9ea3bbf7ba66bb98538e9a924ad17a8558e6a2f6b36a851b20ecdd7a
|
7
|
+
data.tar.gz: 7eddc07b20b17f2d8fa386703172bece9c5c0a7d3577cef7df7a0be3c54f0998130a511b2b6ed35f277c21200366311908837c535621d920b6f97ce4e866aaeb
|
data/README.md
CHANGED
@@ -25,9 +25,24 @@ Use `agvtool` to get and set a version across your project. From the `ios` direc
|
|
25
25
|
|
26
26
|
### Configuring builds to TestFlight and AppStore Connect on CI
|
27
27
|
|
28
|
-
To upload builds to TestFlight or AppStore Connect,
|
28
|
+
To upload builds to TestFlight or AppStore Connect, CI will need a cookie that was generated with a 2FA code. The `react_native_release` lane generates and stores this code securely in Github. We then use this token on CI during the IOS build upload step to TestFlight or AppStore Connect.
|
29
29
|
|
30
|
-
|
30
|
+
This is managed by the `fastlane-plugin-react_native_release` plugin in the iOS project. Start by adding the plugin to the iOS project by running:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
cd ios && fastlane add_plugin react_native_release
|
34
|
+
```
|
35
|
+
|
36
|
+
Then add the `read_fastlane_session` command to the end of the `before_all` step in your `<root>/ios/Fastfile`:
|
37
|
+
|
38
|
+
```yaml
|
39
|
+
before_all do
|
40
|
+
setup_circle_ci
|
41
|
+
read_fastlane_session
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
Next add an `.env` file at `<root>/fastlane/.env` with the following configuration.
|
31
46
|
|
32
47
|
| KEY | TYPE | DESCRIPTION |
|
33
48
|
|-----|------|-------------|
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/react_native_release_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class CreateFastlaneSessionAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
require 'fastlane/plugin/cryptex'
|
9
|
+
|
10
|
+
fastlane_session_git_url = ENV["FASTLANE_ENV_GIT_URL"]
|
11
|
+
fastlane_session_username = ENV["FASTLANE_ENV_USERNAME"]
|
12
|
+
fastlane_session_password = ENV["CRYPTEX_PASSWORD"]
|
13
|
+
fastlane_session_cookie_path = "#{File.expand_path('~')}/.fastlane/spaceship/#{fastlane_session_username}/cookie"
|
14
|
+
|
15
|
+
if !fastlane_session_username
|
16
|
+
UI.user_error!("No FASTLANE_ENV_USERNAME var at <root>/fastlane/.env\nFASTLANE_ENV_USERNAME is used to authenticate with the App Store for iOS releases.")
|
17
|
+
elsif !fastlane_session_git_url
|
18
|
+
UI.user_error!("No FASTLANE_ENV_GIT_URL var at <root>/fastlane/.env\nFASTLANE_ENV_GIT_URL is used to store the App Store Connect session to upload releases on CI.")
|
19
|
+
elsif !fastlane_session_password
|
20
|
+
UI.user_error!("No CRYPTEX_PASSWORD var at <root>/fastlane/.env\nCRYPTEX_PASSWORD is used to encrypt/decrypt the App Store Connect session.")
|
21
|
+
else
|
22
|
+
UI.message "Generating a new fastlane session."
|
23
|
+
|
24
|
+
UI.message "Please enter the 6 digit 2FA code if one is sent to your device otherwise the script will continue automatically."
|
25
|
+
|
26
|
+
`fastlane spaceauth -u #{fastlane_session_username.shellescape}`
|
27
|
+
|
28
|
+
other_action.cryptex(
|
29
|
+
type: "import",
|
30
|
+
in: fastlane_session_cookie_path,
|
31
|
+
key: "FASTLANE_SESSION",
|
32
|
+
git_url: fastlane_session_git_url
|
33
|
+
)
|
34
|
+
|
35
|
+
UI.message "Uploaded FASTLANE_SESSION variable securely to git repository."
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.description
|
40
|
+
"Simplify 2FA authentication for App Store Connect"
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.authors
|
44
|
+
["cball", "isaiahgrey93"]
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.return_value
|
48
|
+
# If your method provides a return value, you can describe here what it does
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.details
|
52
|
+
"Creates a cookie for authenticating with App Store connecting. Handles generating, encrypting, and storing the cookie."
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.is_supported?(platform)
|
56
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
57
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
58
|
+
#
|
59
|
+
[:ios, :android].include?(platform)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -8,8 +8,8 @@ module Fastlane
|
|
8
8
|
|
9
9
|
def self.run(params)
|
10
10
|
require 'fastlane/plugin/android_versioning'
|
11
|
-
|
12
|
-
create_fastlane_session
|
11
|
+
|
12
|
+
other_action.create_fastlane_session
|
13
13
|
|
14
14
|
target = UI.select "Select a release type:", VALID_TARGETS
|
15
15
|
is_beta = target.include?('beta')
|
@@ -121,45 +121,13 @@ module Fastlane
|
|
121
121
|
UI.select("Update Version?: ", ["none", "major", "minor", "patch"])
|
122
122
|
end
|
123
123
|
|
124
|
-
#
|
125
|
-
def self.create_fastlane_session
|
126
|
-
require 'fastlane/plugin/cryptex'
|
127
|
-
|
128
|
-
UI.message "Generating a new fastlane session."
|
129
|
-
|
130
|
-
fastlane_session_git_url = ENV["FASTLANE_ENV_GIT_URL"]
|
131
|
-
fastlane_session_username = ENV["FASTLANE_ENV_USERNAME"]
|
132
|
-
fastlane_session_password = ENV["CRYPTEX_PASSWORD"]
|
133
|
-
spaceship_cookie_path = "#{File.expand_path('~')}/.fastlane/spaceship/#{fastlane_session_username}/cookie"
|
134
|
-
|
135
|
-
if !fastlane_session_username;
|
136
|
-
UI.user_error!("No FASTLANE_ENV_USERNAME var at <root>/fastlane/.env\nFASTLANE_ENV_USERNAME is used to authenticate with the App Store for iOS releases.")
|
137
|
-
elsif !fastlane_session_git_url;
|
138
|
-
UI.user_error!("No FASTLANE_ENV_GIT_URL var at <root>/fastlane/.env\nFASTLANE_ENV_GIT_URL is used to store the App Store Connect session to upload releases on CI.")
|
139
|
-
elsif !fastlane_session_password;
|
140
|
-
UI.user_error!("No CRYPTEX_PASSWORD var at <root>/fastlane/.env\nCRYPTEX_PASSWORD is used to encrypt/decrypt the App Store Connect session.")
|
141
|
-
else
|
142
|
-
UI.message "Please enter the 6 digit 2FA code if one is sent to your device; otherwise the script will continue automatically."
|
143
|
-
|
144
|
-
`fastlane spaceauth -u #{fastlane_session_username.shellescape}`
|
145
|
-
|
146
|
-
other_action.cryptex(
|
147
|
-
type: "import",
|
148
|
-
in: spaceship_cookie_path,
|
149
|
-
key: "FASTLANE_SESSION",
|
150
|
-
git_url: fastlane_session_git_url
|
151
|
-
)
|
152
|
-
|
153
|
-
UI.message "Uploaded FASTLANE_SESSION variable securely to git repository."
|
154
|
-
end
|
155
|
-
end
|
156
124
|
|
157
125
|
def self.description
|
158
126
|
"Simplify releases for React Native apps"
|
159
127
|
end
|
160
128
|
|
161
129
|
def self.authors
|
162
|
-
["cball"]
|
130
|
+
["cball", "isaiahgrey93"]
|
163
131
|
end
|
164
132
|
|
165
133
|
def self.return_value
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/react_native_release_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class ReadFastlaneSessionAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
require 'fastlane/plugin/cryptex'
|
9
|
+
|
10
|
+
fastlane_session_git_url = ENV["FASTLANE_ENV_GIT_URL"]
|
11
|
+
fastlane_session_username = ENV["FASTLANE_ENV_USERNAME"]
|
12
|
+
fastlane_session_password = ENV["CRYPTEX_PASSWORD"]
|
13
|
+
|
14
|
+
if !fastlane_session_username
|
15
|
+
UI.user_error!("No FASTLANE_ENV_USERNAME var at <root>/fastlane/.env\nFASTLANE_ENV_USERNAME is used to authenticate with the App Store for iOS releases.")
|
16
|
+
elsif !fastlane_session_git_url
|
17
|
+
UI.user_error!("No FASTLANE_ENV_GIT_URL var at <root>/fastlane/.env\nFASTLANE_ENV_GIT_URL is used to store the App Store Connect session to upload releases on CI.")
|
18
|
+
elsif !fastlane_session_password
|
19
|
+
UI.user_error!("No CRYPTEX_PASSWORD var at <root>/fastlane/.env\nCRYPTEX_PASSWORD is used to encrypt/decrypt the App Store Connect session.")
|
20
|
+
else
|
21
|
+
UI.message "Reading fastlane session.."
|
22
|
+
|
23
|
+
fastlane_session_cookie_path = Tempfile.new('')
|
24
|
+
|
25
|
+
other_action.cryptex(
|
26
|
+
type: "export",
|
27
|
+
out: fastlane_session_cookie_path.path,
|
28
|
+
key: "FASTLANE_SESSION",
|
29
|
+
git_url: ENV["FASTLANE_ENV_GIT_URL"]
|
30
|
+
)
|
31
|
+
|
32
|
+
fastlane_session = (open fastlane_session_cookie_path.path).read
|
33
|
+
|
34
|
+
UI.message fastlane_session_cookie_path.path
|
35
|
+
UI.message fastlane_session
|
36
|
+
|
37
|
+
ENV["FASTLANE_SESSION"] = fastlane_session
|
38
|
+
|
39
|
+
UI.success "Read FASTLANE_SESSION from remote repository."
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.description
|
44
|
+
"Simplify 2FA authentication for App Store Connect"
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.authors
|
48
|
+
["cball", "isaiahgrey93"]
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.return_value
|
52
|
+
# If your method provides a return value, you can describe here what it does
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.details
|
56
|
+
"Fetches an encrypted cookie for authenticating with App Store connecting. Handles fetching and decrypting the cookie before setting to the local env."
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.is_supported?(platform)
|
60
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
61
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
62
|
+
#
|
63
|
+
[:ios, :android].include?(platform)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-react_native_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Ball
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane-plugin-android_versioning
|
@@ -173,7 +173,9 @@ files:
|
|
173
173
|
- LICENSE
|
174
174
|
- README.md
|
175
175
|
- lib/fastlane/plugin/react_native_release.rb
|
176
|
+
- lib/fastlane/plugin/react_native_release/actions/create_fastlane_session_action.rb
|
176
177
|
- lib/fastlane/plugin/react_native_release/actions/react_native_release_action.rb
|
178
|
+
- lib/fastlane/plugin/react_native_release/actions/read_fastlane_session_action.rb
|
177
179
|
- lib/fastlane/plugin/react_native_release/helper/react_native_release_helper.rb
|
178
180
|
- lib/fastlane/plugin/react_native_release/version.rb
|
179
181
|
homepage: https://github.com/echobind/fastlane-plugin-react_native_release
|
@@ -195,8 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
195
197
|
- !ruby/object:Gem::Version
|
196
198
|
version: '0'
|
197
199
|
requirements: []
|
198
|
-
|
199
|
-
rubygems_version: 2.7.9
|
200
|
+
rubygems_version: 3.0.3
|
200
201
|
signing_key:
|
201
202
|
specification_version: 4
|
202
203
|
summary: Simplify releases for React Native apps.
|