Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to release a build for staging env #353

Closed
v4irajvimu opened this issue Sep 18, 2022 · 8 comments
Closed

How to release a build for staging env #353

v4irajvimu opened this issue Sep 18, 2022 · 8 comments

Comments

@v4irajvimu
Copy link

Hi Team,

I have followed multiple env files in the app.

  • .env.development
  • .env.production
  • .env-staging

I have set three different values for the API_BASE_URL since I need to connect to the backend according to the environment.
currently working with debug mode by setting environment like this => APP_ENV=staging react-native start

My question is when I release a build using Xcode archive, how to set the .env.staging file values? it is always picking the .env.production values. I need to get a build that app connected to staging backend URL

@github-actions
Copy link

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/353

@goatandsheep
Copy link
Owner

@felipejh
Copy link

felipejh commented Apr 7, 2023

take a look here https://github.com/goatandsheep/react-native-dotenv/wiki/Multi-env-troubleshooting#xcode

Sorry, but there is no information is not clear about how to run iOS in a staging mode.
I've built in production and debug through Xcode. But I could not run in a staging mode.

I created the schema for staging, selecting staging for run and archive.

@badalsaibo
Copy link

badalsaibo commented Dec 12, 2023

@felipejh Did you fix this? I need to create an archive in Xcode using the .env.development file, but it always picks the .env even in debug config

cc @goatandsheep

@leofolive
Copy link

@badalsaibo did you fix this?

@goatandsheep
Copy link
Owner

It is working for me for Android and iOS yes after extensive testing. I will need to overhaul the documentation but the rough docs are in wiki. I'm almost caught up. Should be on it this weekend.

@badalsaibo
Copy link

@badalsaibo did you fix this?

I didn't. I have to manually change the .env contents for production and dev while creating archive for iOS

@leofolive
Copy link

leofolive commented Apr 4, 2024

@goatandsheep
The issue arises during the execution of a build in release mode on XCODE. Our objective is to have it use a designated .env file customized for release mode, rather than falling back to the default .env file. For instance, when building in release mode using .env.development, it consistently reverts to .env, causing complications in an application with multiple levels of testing in release mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants