@ahmedsamirelsaka/react-native-local-release 2.0.0-rc.1 → 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 +12 -1
- package/README.md +4 -4
- package/package.json +1 -1
- package/template/fastlane/lib/rn_local_release.rb +54 -0
- package/docs/PUBLISHING.md +0 -128
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
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
|
+
|
|
9
|
+
## 2.0.0-rc.2
|
|
10
|
+
|
|
11
|
+
- Remove maintainer-only `docs/PUBLISHING.md` from the published package and GitHub tree.
|
|
12
|
+
- README / docs scrubbed for public launch (no local paths or token-setup checklists).
|
|
13
|
+
|
|
3
14
|
## 2.0.0-rc.1
|
|
4
15
|
|
|
5
16
|
Security-first rewrite for bare React Native apps (release candidate).
|
|
@@ -23,7 +34,7 @@ Security-first rewrite for bare React Native apps (release candidate).
|
|
|
23
34
|
- CI: SHA-pinned actions, npm provenance publish workflow, Dependabot.
|
|
24
35
|
|
|
25
36
|
### Migration
|
|
26
|
-
1. Install `2.0.0-rc.
|
|
37
|
+
1. Install `2.0.0-rc.3` (or newer) from npm (dist-tag `next`).
|
|
27
38
|
2. Run `rn-local-release migrate --project .` (or reinstall; existing config is merged).
|
|
28
39
|
3. Prefer Keychain credentials: `rn-local-release configure --project .`
|
|
29
40
|
4. Confirm `.gitignore` includes `logs/`, `versions/`, and the marked credential block.
|
package/README.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Security-first local Fastlane release toolkit for **bare** React Native apps (iOS + Android).
|
|
4
4
|
|
|
5
|
-
Package: `@ahmedsamirelsaka/react-native-local-release`
|
|
6
|
-
Version: **2.0.0-rc.
|
|
5
|
+
Package: [`@ahmedsamirelsaka/react-native-local-release`](https://www.npmjs.com/package/@ahmedsamirelsaka/react-native-local-release)
|
|
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.1** (GitHub Release ready; npm `next` tag after you add `NPM
|
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
24
|
# From your React Native app root
|
|
25
|
-
npx @ahmedsamirelsaka/react-native-local-release@2.0.0-rc.
|
|
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.
|
|
28
|
+
# "devDependencies": { "@ahmedsamirelsaka/react-native-local-release": "2.0.0-rc.3" }
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Useful flags:
|
package/package.json
CHANGED
|
@@ -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"),
|
package/docs/PUBLISHING.md
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
# Publishing to npm (`@ahmedsamirelsaka/react-native-local-release`)
|
|
2
|
-
|
|
3
|
-
CI and GitHub Releases already work. npm publish fails with **`ENEEDAUTH`** until **you** add registry credentials. This cannot be done by the CI bot alone.
|
|
4
|
-
|
|
5
|
-
Choose **Path A** (fastest) or **Path B** (OIDC, no long-lived token).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Path A — Automation token (recommended for first publish)
|
|
10
|
-
|
|
11
|
-
### 1. Create / sign in to npm
|
|
12
|
-
|
|
13
|
-
1. Open https://www.npmjs.com/signup (or https://www.npmjs.com/login).
|
|
14
|
-
2. Prefer username **`ahmedsamirelsaka`** so the scope `@ahmedsamirelsaka` matches the package name.
|
|
15
|
-
If you already use another username, either:
|
|
16
|
-
- change `package.json` `"name"` to `@YOUR_NPM_USER/react-native-local-release`, or
|
|
17
|
-
- create an npm **Organization** named `ahmedsamirelsaka` and add yourself as owner.
|
|
18
|
-
|
|
19
|
-
### 2. Enable 2FA (required for publishing)
|
|
20
|
-
|
|
21
|
-
npm → **Account** → **Access Tokens** / Security → enable 2FA (auth-and-writes or auth-only + granular tokens).
|
|
22
|
-
|
|
23
|
-
### 3. Create an Automation token
|
|
24
|
-
|
|
25
|
-
1. https://www.npmjs.com/settings/~/tokens
|
|
26
|
-
(or Organization → Access Tokens if publishing under an org)
|
|
27
|
-
2. **Generate New Token** → **Granular Access Token** (preferred) or classic **Automation**.
|
|
28
|
-
3. Settings that work:
|
|
29
|
-
- **Type:** Automation (classic) **or** Granular with permission **Read and write** on packages
|
|
30
|
-
- **Packages:** allow `@ahmedsamirelsaka/react-native-local-release` (or entire `@ahmedsamirelsaka` scope)
|
|
31
|
-
- **Organizations:** your org if applicable
|
|
32
|
-
4. Copy the token once (`npm_…`). Store it in a password manager.
|
|
33
|
-
|
|
34
|
-
### 4. Add the token to GitHub
|
|
35
|
-
|
|
36
|
-
**Option 1 — Environment secret (matches the workflow):**
|
|
37
|
-
|
|
38
|
-
1. https://github.com/AhmedSamirElsaka/react-native-local-release/settings/environments
|
|
39
|
-
2. Open environment **`npm-publish`** (already created).
|
|
40
|
-
3. **Environment secrets** → **Add secret**
|
|
41
|
-
- Name: `NPM_TOKEN`
|
|
42
|
-
- Value: paste the npm token
|
|
43
|
-
|
|
44
|
-
**Option 2 — Repository secret:**
|
|
45
|
-
|
|
46
|
-
1. https://github.com/AhmedSamirElsaka/react-native-local-release/settings/secrets/actions
|
|
47
|
-
2. **New repository secret** → `NPM_TOKEN` → paste token
|
|
48
|
-
|
|
49
|
-
> The workflow reads `${{ secrets.NPM_TOKEN }}`. Environment secrets are visible only to jobs that use `environment: npm-publish` (this one does).
|
|
50
|
-
|
|
51
|
-
### 5. Re-run publish
|
|
52
|
-
|
|
53
|
-
Either:
|
|
54
|
-
|
|
55
|
-
- Actions → failed **Publish npm + GitHub Release assets** run → **Re-run failed jobs**
|
|
56
|
-
|
|
57
|
-
Or from a terminal:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
cd /Users/ahmedsamir/work/react-native-local-release
|
|
61
|
-
git push origin :refs/tags/v2.0.0-rc.1
|
|
62
|
-
git tag -f -a v2.0.0-rc.1 -m "2.0.0-rc.1"
|
|
63
|
-
git push origin v2.0.0-rc.1
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### 6. Verify
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npm view @ahmedsamirelsaka/react-native-local-release version --tag next
|
|
70
|
-
npx @ahmedsamirelsaka/react-native-local-release@next --help
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
RC is published under dist-tag **`next`** (not `latest`) until you cut a stable `2.0.0`.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Path B — Trusted Publishing (OIDC, no `NPM_TOKEN`)
|
|
78
|
-
|
|
79
|
-
Best after the package exists once, or if npm allows first-time trusted publish for your account.
|
|
80
|
-
|
|
81
|
-
1. Publish **once** with Path A (creates the package), **or** follow npm’s current “Trusted Publisher” UI for new packages.
|
|
82
|
-
2. Open the package on npm → **Settings** → **Trusted Publisher** / **Provenance**:
|
|
83
|
-
- **Repository:** `AhmedSamirElsaka/react-native-local-release`
|
|
84
|
-
- **Workflow:** `publish.yml` (file under `.github/workflows/publish.yml`)
|
|
85
|
-
- **Environment:** `npm-publish`
|
|
86
|
-
3. Remove `NPM_TOKEN` later if you want OIDC-only.
|
|
87
|
-
4. Re-run the tag workflow. Job already has `permissions.id-token: write`.
|
|
88
|
-
|
|
89
|
-
Docs: https://docs.npmjs.com/trusted-publishers
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Optional: publish once from your laptop
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
cd /Users/ahmedsamir/work/react-native-local-release
|
|
97
|
-
npm login # or: npm login --auth-type=web
|
|
98
|
-
npm whoami
|
|
99
|
-
npm test
|
|
100
|
-
npm publish --access public --tag next --provenance
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Use the same version already in `package.json` (`2.0.0-rc.1`). Do **not** re-publish the same version if CI already succeeded.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Checklist
|
|
108
|
-
|
|
109
|
-
| Step | Status |
|
|
110
|
-
|------|--------|
|
|
111
|
-
| CI green on `main` | Done by repo |
|
|
112
|
-
| GitHub Release `v2.0.0-rc.1` + tarball | Done |
|
|
113
|
-
| npm account + `@ahmedsamirelsaka` scope | **You** |
|
|
114
|
-
| `NPM_TOKEN` on `npm-publish` env (or Trusted Publisher) | **You** |
|
|
115
|
-
| Re-run publish workflow | **You** |
|
|
116
|
-
| `npm view …@next` works | Confirm |
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## After it works
|
|
121
|
-
|
|
122
|
-
Consumers:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
npx @ahmedsamirelsaka/react-native-local-release@next install --project .
|
|
126
|
-
# or pin exactly:
|
|
127
|
-
npm i -D @ahmedsamirelsaka/react-native-local-release@2.0.0-rc.1
|
|
128
|
-
```
|