From af4afb19b61eebdd23571b8a82de122ca3e8e642 Mon Sep 17 00:00:00 2001 From: Vane Skubic Date: Tue, 29 Jul 2025 09:18:32 +0200 Subject: [PATCH 1/3] refactor: change `infisical.sh` to use variables for `secretPath` and `workspaceId` --- scripts/infisical.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/infisical.sh b/scripts/infisical.sh index 6601174..74a7738 100755 --- a/scripts/infisical.sh +++ b/scripts/infisical.sh @@ -35,9 +35,12 @@ if [ "$EAS_BUILD_PROFILE" = "production" ]; then fi echo "Using environment: $ENVIRONMENT" +SECRET_PATH="/native" +WORKSPACE_ID="650c0ca916f6d380e9193251" + # Fetch secrets and create .env file echo "Fetching secrets and creating .env file..." -curl "https://app.infisical.com/api/v3/secrets/raw?environment=$ENVIRONMENT&secretPath=/native&workspaceId=650c0ca916f6d380e9193251" \ +curl "https://app.infisical.com/api/v3/secrets/raw?environment=$ENVIRONMENT&secretPath=$SECRET_PATH&workspaceId=$WORKSPACE_ID" \ --header "Authorization: Bearer $INFISICAL_TOKEN" | \ use_jq -r '.secrets[] | "\(.secretKey)=\(.secretValue)"' > .env From b97a2f12283cf81452c3c7b2d7727f4be5c908c6 Mon Sep 17 00:00:00 2001 From: Vane Skubic Date: Tue, 29 Jul 2025 09:20:03 +0200 Subject: [PATCH 2/3] fix: changed distribution mode for `preview` build environment & added autoIncrement app version --- app.json | 4 ++-- eas.json | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.json b/app.json index a606769..4f4e6e7 100644 --- a/app.json +++ b/app.json @@ -38,8 +38,8 @@ "@sentry/react-native/expo", { "url": "https://sentry.io/", - "organization": "sentry org slug, or use the `SENTRY_ORG` environment variable", - "project": "sentry project name, or use the `SENTRY_PROJECT` environment variable" + "organization": "CHANGE THIS: sentry org slug, or use the `SENTRY_ORG` environment variable", + "project": "CHANGE THIS: sentry project name, or use the `SENTRY_PROJECT` environment variable" } ] ] diff --git a/eas.json b/eas.json index c0843df..562d3d9 100644 --- a/eas.json +++ b/eas.json @@ -1,7 +1,8 @@ { "cli": { "version": ">= 3.13.3", - "promptToConfigurePushNotifications": false + "promptToConfigurePushNotifications": false, + "appVersionSource": "remote" }, "build": { "development": { @@ -9,9 +10,11 @@ "distribution": "internal" }, "preview": { - "distribution": "internal" + "distribution": "store", + "autoIncrement": true }, "production": { + "autoIncrement": true, "android": { "image": "latest" }, From 0d4c22991f1186e6a3a30080589141713b2d3e1c Mon Sep 17 00:00:00 2001 From: Vane Skubic Date: Tue, 29 Jul 2025 09:21:04 +0200 Subject: [PATCH 3/3] fix: added manual mappings for `runtimeEnv` (otherwise env doesnt work on build) --- env.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/env.ts b/env.ts index 60b6ce3..b4772f1 100644 --- a/env.ts +++ b/env.ts @@ -11,10 +11,11 @@ const env = createEnv({ }, /** - * What object holds the environment variables at runtime. This is usually - * `process.env` or `import.meta.env`. + * What object holds the environment variables at runtime. Map these manually like below. */ - runtimeEnv: process.env, + runtimeEnv: { + EXPO_PUBLIC_API_URL: process.env.EXPO_PUBLIC_API_URL, + }, }); export default env;