Doesn't work with Xcode Cloud environment variables
This plugin is almost exactly what I was looking for.
Even though the format of the .env file makes it seem like these are variables in the environment, they are not. The plugin is just parsing that file line by line. Because of this, the plugin will only build when the .env file is present, and is incompatible with actual environment variables.
I'm not exactly sure what changes would be needed to make this work with actual environment variables, but probably something in the project that tells the plugin which variables it needs to look for.
This tool does have support for this already! But I forgot to document it 😅. You may want to combo it with a ci_post_clone.sh script to generate a .env file with just the keys exported. See this section I just added to the README for the format
Ahhh, I see it in there now. I'm still a little fuzzy on how you'd use it that way... wouldn't you then have to commit the .env file? And locally, I guess you'd also have "real" environment variables in your .zsh or something?
Personally for CI I have a ci_scripts/ci_post_clone.sh script that copies a pre-existing ci_scripts/ci_env file to .env.
Locally I have .env in my .gitignore and have included the relevant keys there.