@ahmedsamirelsaka/react-native-local-release 2.0.0-rc.2 → 2.0.0-rc.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0-rc.3
4
+
5
+ - Fix: Fastlane now materializes Android signing passwords from macOS Keychain when `credentials.provider` is `keychain`.
6
+ `yarn release:beta` (direct Fastlane) no longer fails with `Missing MYAPP_UPLOAD_STORE_PASSWORD` after a Keychain install.
7
+ - Treat literal empty quotes in `.env` / `keystore.properties` as empty values.
8
+
3
9
  ## 2.0.0-rc.2
4
10
 
5
11
  - Remove maintainer-only `docs/PUBLISHING.md` from the published package and GitHub tree.
@@ -28,7 +34,7 @@ Security-first rewrite for bare React Native apps (release candidate).
28
34
  - CI: SHA-pinned actions, npm provenance publish workflow, Dependabot.
29
35
 
30
36
  ### Migration
31
- 1. Install `2.0.0-rc.2` (or newer) from npm (dist-tag `next`).
37
+ 1. Install `2.0.0-rc.3` (or newer) from npm (dist-tag `next`).
32
38
  2. Run `rn-local-release migrate --project .` (or reinstall; existing config is merged).
33
39
  3. Prefer Keychain credentials: `rn-local-release configure --project .`
34
40
  4. Confirm `.gitignore` includes `logs/`, `versions/`, and the marked credential block.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Security-first local Fastlane release toolkit for **bare** React Native apps (iOS + Android).
4
4
 
5
5
  Package: [`@ahmedsamirelsaka/react-native-local-release`](https://www.npmjs.com/package/@ahmedsamirelsaka/react-native-local-release)
6
- Version: **2.0.0-rc.2** (npm dist-tag `next`)
6
+ Version: **2.0.0-rc.3** (npm dist-tag `next`)
7
7
 
8
8
  ## Supported
9
9
 
@@ -22,10 +22,10 @@ Version: **2.0.0-rc.2** (npm dist-tag `next`)
22
22
 
23
23
  ```bash
24
24
  # From your React Native app root
25
- npx @ahmedsamirelsaka/react-native-local-release@2.0.0-rc.2 install --project .
25
+ npx @ahmedsamirelsaka/react-native-local-release@2.0.0-rc.3 install --project .
26
26
 
27
27
  # Prefer an exact version in package.json so daily commands do not float:
28
- # "devDependencies": { "@ahmedsamirelsaka/react-native-local-release": "2.0.0-rc.2" }
28
+ # "devDependencies": { "@ahmedsamirelsaka/react-native-local-release": "2.0.0-rc.3" }
29
29
  ```
30
30
 
31
31
  Useful flags:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahmedsamirelsaka/react-native-local-release",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.3",
4
4
  "description": "Security-first local Fastlane release toolkit for React Native iOS and Android",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -122,19 +122,73 @@ def load_keystore_properties
122
122
  props
123
123
  end
124
124
 
125
+ def keychain_service_name
126
+ "rn-local-release:#{File.basename(repo_root)}"
127
+ end
128
+
129
+ def keychain_get(account)
130
+ return nil unless FastlaneCore::Helper.mac?
131
+
132
+ out, status = Open3.capture2(
133
+ "security",
134
+ "find-generic-password",
135
+ "-s",
136
+ keychain_service_name,
137
+ "-a",
138
+ account,
139
+ "-w"
140
+ )
141
+ return nil unless status.success?
142
+
143
+ value = out.to_s.strip
144
+ value.empty? ? nil : value
145
+ rescue StandardError
146
+ nil
147
+ end
148
+
149
+ # Keychain provider stores passwords in macOS Keychain and intentionally leaves
150
+ # them blank in fastlane/.env + android/keystore.properties. Yarn release:*
151
+ # invokes Fastlane directly, so Fastlane must materialize them itself.
152
+ def materialize_keychain_secrets!
153
+ return unless config.dig("credentials", "provider").to_s == "keychain"
154
+ return unless FastlaneCore::Helper.mac?
155
+
156
+ {
157
+ "MYAPP_UPLOAD_STORE_PASSWORD" => keychain_get("MYAPP_UPLOAD_STORE_PASSWORD"),
158
+ "MYAPP_UPLOAD_KEY_PASSWORD" => keychain_get("MYAPP_UPLOAD_KEY_PASSWORD"),
159
+ "MYAPP_UPLOAD_KEY_ALIAS" => keychain_get("MYAPP_UPLOAD_KEY_ALIAS"),
160
+ "ASC_KEY_ID" => keychain_get("ASC_KEY_ID"),
161
+ "ASC_ISSUER_ID" => keychain_get("ASC_ISSUER_ID")
162
+ }.each do |key, value|
163
+ next if value.nil? || value.empty?
164
+ next unless ENV[key].to_s.strip.empty?
165
+
166
+ ENV[key] = value
167
+ end
168
+ end
169
+
125
170
  def signing_value(name, default: nil)
171
+ materialize_keychain_secrets!
172
+
126
173
  from_env = ENV[name].to_s.strip
174
+ # dotenv / Keychain installs may leave literal empty quotes in .env
175
+ from_env = "" if from_env == '""' || from_env == "''"
127
176
  return from_env unless from_env.empty?
128
177
 
129
178
  from_file = load_keystore_properties[name].to_s.strip
179
+ from_file = "" if from_file == '""' || from_file == "''"
130
180
  return from_file unless from_file.empty?
131
181
 
182
+ from_keychain = keychain_get(name)
183
+ return from_keychain unless from_keychain.nil? || from_keychain.empty?
184
+
132
185
  return default unless default.nil?
133
186
 
134
187
  UI.user_error!("Missing #{name}. Set it in fastlane/.env, Keychain, or android/keystore.properties.")
135
188
  end
136
189
 
137
190
  def apply_android_signing_env!
191
+ materialize_keychain_secrets!
138
192
  {
139
193
  "MYAPP_UPLOAD_STORE_FILE" => signing_value("MYAPP_UPLOAD_STORE_FILE", default: "keystore.jks"),
140
194
  "MYAPP_UPLOAD_STORE_PASSWORD" => signing_value("MYAPP_UPLOAD_STORE_PASSWORD"),