TestFlight - Differentiate Between Test and Prod Builds

We have a use case where we want to have two different builds of our app in TestFlight: one for the test environment and another for production. Each build has a different .env file associated with it, containing different values based on the environment. The test build will only be used by internal testers, whereas the production build will be used by both internal and external testers.

I know there was a way years ago to append a suffix to the build number, something like 0.18.1-test, so we could specify which build specifically uses the test environment variables. However, when I try to submit a build to TestFlight with any alpha characters in the build number, App Store Connect rejects it with the error message: '0.18.1-test' is not a valid value for the attribute 'cfBundleShortVersionString'.

Are there any current best practices or official guidelines from Apple on handling a scenario like this? What's the recommended approach for differentiating between test and production builds in TestFlight?

Our first solution was to place all our test builds in VS App Center and production builds in TestFlight. However, Microsoft recently announced that VS App Center is being retired next year and recommends using TestFlight instead for iOS builds. So, we're looking for a solution that will work with TestFlight going forward.