feat: support private scoped registry on ubuntu

pull/272/head
Nic van Dessel 2024-05-31 11:11:55 -07:00
parent 5817131b76
commit a742d69e7a
No known key found for this signature in database
GPG Key ID: 88AE94AD8B681486
1 changed files with 20 additions and 15 deletions

View File

@ -36,6 +36,25 @@ echo "Using custom parameters $CUSTOM_PARAMETERS."
echo "Using Unity version \"$UNITY_VERSION\" to test." echo "Using Unity version \"$UNITY_VERSION\" to test."
#
# Setup token for private package registry.
#
if [ -n "$PRIVATE_REGISTRY_TOKEN" ]; then
echo "Private registry token detected, creating .upmconfig.toml"
UPM_CONFIG_TOML_PATH="$HOME/.upmconfig.toml"
echo "Creating toml at path: $UPM_CONFIG_TOML_PATH"
touch $UPM_CONFIG_TOML_PATH
cat > "$UPM_CONFIG_TOML_PATH" <<EOF
[npmAuth."$SCOPED_REGISTRY_URL"]
token = "$PRIVATE_REGISTRY_TOKEN"
alwaysAuth = true
EOF
fi
# #
# Create an empty project for testing if in package mode # Create an empty project for testing if in package mode
# #
@ -120,20 +139,6 @@ if [ "$PACKAGE_MODE" = "true" ]; then
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH" UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"
if [ -n "$PRIVATE_REGISTRY_TOKEN" ]; then
echo "Private registry token detected, creating .upmconfig.toml"
UPM_CONFIG_TOML_PATH="$HOME/.upmconfig.toml"
echo "Creating toml at path: $UPM_CONFIG_TOML_PATH"
touch $UPM_CONFIG_TOML_PATH
cat > "$UPM_CONFIG_TOML_PATH" <<EOF
[npmAuth."$SCOPED_REGISTRY_URL"]
token = "$PRIVATE_REGISTRY_TOKEN"
alwaysAuth = true
EOF
fi
fi fi
@ -280,4 +285,4 @@ if [ -d "$FULL_COVERAGE_RESULTS_PATH" ]; then
chmod -R a+r "$FULL_COVERAGE_RESULTS_PATH" chmod -R a+r "$FULL_COVERAGE_RESULTS_PATH"
else else
echo "Coverage results directory does not exist. If you are expecting coverage results, please make sure the Code Coverage package is installed in your unity project and that it is set up correctly." echo "Coverage results directory does not exist. If you are expecting coverage results, please make sure the Code Coverage package is installed in your unity project and that it is set up correctly."
fi fi