Binary Package Authentication with .netrc

When using the Swift Package Manager CLI, it is possible to authenticate with a .netrc file in the user's home directory or in another location chosen by the user using the --netrc-file argument.

However, when using Xcode to manage dependencies, this behavior seems to be only partially implemented.

Specifically, Xcode uses the .netrc file in the user's home directory for the Git repository, but it does not use the .netrc file for downloading the binary package, so it is unable to actually download the binary.

Xcode also does not seem to have a way to specify that a different .netrc file should be used.

Both of the above issues are true in the Xcode GUI as well as the xcodebuild CLI.

The problem I have is when running CI Jobs - GitLab CI provides a CI_JOB_TOKEN environment variable that is unique to the job, but it is only valid while the job is running. I can't write to the .netrc in the home directory because there can be multiple simultaneous jobs running on the same machine that need to use their own credentials.

Is there any better way to set the correct credentials for my xcodebuild runs in CI?


Note: Cross-posted to StackOverflow

Binary Package Authentication with .netrc
 
 
Q