fastlane-plugin-react_native_release 0.2.0 → 0.3.0

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: ee98da4bcfc71b60217f18a86054634b499afd825b01d9f5f11b9da0fb359e1c
4
- data.tar.gz: 31635f82e7280de68aab4290d20bfa58c236a2834792fe8c619817067c56834d
3
+ metadata.gz: 1c6db2dcb8566ef24876fd189f29f38cd3cbecdd59c8ce89e7df399b10e6902c
4
+ data.tar.gz: 2626f9f632f1fa7deaa98ec880171692c3c05db8bea3bc1fe70bed115cad312b
5
5
  SHA512:
6
- metadata.gz: f7193937eb0b711acf7812d67b1dcdf75dcfda9cd18fcc22c98086322a3731eda9daa34a9c2c4c3e08502384b147b5d717ba376210a122f2e83dab6b52601312
7
- data.tar.gz: 2765b2a4409a5562741cd6b9c9c08140f2402058b3427a655e20e127808defb183f6220cd55dae642a48eefd9e933a85892fe4b45be436a31ce3ab915f573dc4
6
+ metadata.gz: bf7a63f2298aa414a703ad735465802f4268e2d3f0c7e2f5023d96338447c811b88f8bd68ca26d67a8b5a274054ee4c12baa9021d237d9c9b706842951e375fb
7
+ data.tar.gz: da7e7e339c2e834d17d829db5f4e5df449c1fb1c52b6d5b5cf0e5c039f7c510efb47550fd326210a76afad6221958fa4022ab605af98edb91dd4e4176d3f9dda
data/README.md CHANGED
@@ -23,6 +23,30 @@ Use `agvtool` to get and set a version across your project. From the `ios` direc
23
23
 
24
24
  :exclamation: If you don't complete these steps, releases will fail. :exclamation:
25
25
 
26
+ ### Configuring builds to TestFlight and AppStore Connect on CI
27
+
28
+ To upload builds to TestFlight or AppStore Connect, your CI will need a session cookie that was generated with a 2FA code. React Native Release generates and stores this code securely in Github, when the local release script runs, and CI consumes the cookie during the IOS build upload step for jobs uploading to TestFlight or AppStore Connect.
29
+
30
+ To enable the fastlane session add an `.env` file at `<root>/fastlane/.env` with the following configuration.
31
+
32
+ | KEY | TYPE | DESCRIPTION |
33
+ |-----|------|-------------|
34
+ | FASTLANE_ENV_GIT_URL | String | The repository where the hashed session token will be stored. **Ensure this repository before running the release script!** (Must be a separate repository solely for securely storing the session token). |
35
+ | FASTLANE_ENV_USERNAME | String | The Apple Developer Account email to authenticate with 2FA and generate a session token for. |
36
+
37
+ Note: Apple requires 2FA on all accounts now and the IOS build steps will fail if you attempt to upload to TestFlight or AppStore Connect without a session token.
38
+
39
+ #### Important!
40
+
41
+ Before running the release script, we will need to authenticate locally and generate an initial token to store credentials in the keychain to be used in the release script.
42
+
43
+ 1. Using the same *Apple Developer Account* (`FASTLANE_ENV_USERNAME`) in the `<root>/fastlane/.env` authenticate on [AppStore Connect](https://appstoreconnect.apple.com/login).
44
+
45
+ 2. Then run `fastlane spaceauth -u {YOUR FASTLANE_ENV_USERNAME}`, enter your Apple Developer Account password and complete the 2FA code if prompted.
46
+
47
+ These steps are required for every machine, otherwise the release script will fail.
48
+
49
+
26
50
  ## About React Native Release
27
51
 
28
52
  Simplify releases for React Native apps.
@@ -8,6 +8,11 @@ module Fastlane
8
8
 
9
9
  def self.run(params)
10
10
  require 'fastlane/plugin/android_versioning'
11
+
12
+ if UI.select("Generate a fastlane session token? (The session token is used to authenticate with the App Store to upload iOS releases.)", ["yes", "no"]) === 'yes'
13
+ create_fastlane_session
14
+ end
15
+
11
16
  target = UI.select "Select a release type:", VALID_TARGETS
12
17
  is_beta = target.include?('beta')
13
18
  is_hotfix = params[:hotfix] === true
@@ -80,7 +85,7 @@ module Fastlane
80
85
  target = options[:target]
81
86
 
82
87
  sh "git checkout #{target}"
83
- sh "git merge origin/#{branch} -m 'Merge #{branch} -> #{target} [skip ci]'" do |status|
88
+ sh "git merge origin/#{branch} --no-ff -m 'Merge #{branch} -> #{target} [skip ci]' " do |status|
84
89
  unless status.success?
85
90
  UI.error "Failed to merge #{branch} into #{target}"
86
91
  end
@@ -118,6 +123,38 @@ module Fastlane
118
123
  UI.select("Update Version?: ", ["none", "major", "minor", "patch"])
119
124
  end
120
125
 
126
+ #
127
+ def self.create_fastlane_session()
128
+ require 'fastlane/plugin/cryptex'
129
+
130
+ UI.message "Generating a new FASTLANE_SESSION."
131
+
132
+ file = Tempfile.new('')
133
+
134
+ fastlane_session_git_url = ENV["FASTLANE_ENV_GIT_URL"]
135
+ fastlane_session_username = ENV["FASTLANE_ENV_USERNAME"]
136
+
137
+ if !fastlane_session_username;
138
+ 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.")
139
+ elsif !fastlane_session_git_url;
140
+ 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.")
141
+ else
142
+ system "yes | fastlane spaceauth -u #{fastlane_session_username}"
143
+ system "pbpaste > #{file.path}"
144
+
145
+ UI.message "File created at: #{file.path}"
146
+
147
+ other_action.cryptex(
148
+ type: "import",
149
+ in: file.path,
150
+ key: "FASTLANE_SESSION",
151
+ git_url: fastlane_session_git_url
152
+ )
153
+
154
+ UI.message "Uploaded FASTLANE_SESSION securely to git repository."
155
+ end
156
+ end
157
+
121
158
  def self.description
122
159
  "Simplify releases for React Native apps"
123
160
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module ReactNativeRelease
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.0
4
+ version: 0.3.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-04-17 00:00:00.000000000 Z
11
+ date: 2019-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane-plugin-android_versioning
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: fastlane-plugin-cryptex
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.4
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: pry
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
196
  version: '0'
183
197
  requirements: []
184
198
  rubyforge_project:
185
- rubygems_version: 2.7.8
199
+ rubygems_version: 2.7.9
186
200
  signing_key:
187
201
  specification_version: 4
188
202
  summary: Simplify releases for React Native apps.