Skip to content

Commit eba7e93

Browse files
authored
feat: support private scoped registry on ubuntu (#272)
1 parent 5817131 commit eba7e93

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

dist/platforms/ubuntu/run_tests.sh

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,25 @@ echo "Using custom parameters $CUSTOM_PARAMETERS."
3636

3737
echo "Using Unity version \"$UNITY_VERSION\" to test."
3838

39+
#
40+
# Setup token for private package registry.
41+
#
42+
43+
if [ -n "$PRIVATE_REGISTRY_TOKEN" ]; then
44+
echo "Private registry token detected, creating .upmconfig.toml"
45+
46+
UPM_CONFIG_TOML_PATH="$HOME/.upmconfig.toml"
47+
echo "Creating toml at path: $UPM_CONFIG_TOML_PATH"
48+
49+
touch $UPM_CONFIG_TOML_PATH
50+
51+
cat > "$UPM_CONFIG_TOML_PATH" <<EOF
52+
[npmAuth."$SCOPED_REGISTRY_URL"]
53+
token = "$PRIVATE_REGISTRY_TOKEN"
54+
alwaysAuth = true
55+
EOF
56+
fi
57+
3958
#
4059
# Create an empty project for testing if in package mode
4160
#
@@ -120,20 +139,6 @@ if [ "$PACKAGE_MODE" = "true" ]; then
120139

121140
UNITY_PROJECT_PATH="$TEMP_PROJECT_PATH"
122141

123-
if [ -n "$PRIVATE_REGISTRY_TOKEN" ]; then
124-
echo "Private registry token detected, creating .upmconfig.toml"
125-
126-
UPM_CONFIG_TOML_PATH="$HOME/.upmconfig.toml"
127-
echo "Creating toml at path: $UPM_CONFIG_TOML_PATH"
128-
129-
touch $UPM_CONFIG_TOML_PATH
130-
131-
cat > "$UPM_CONFIG_TOML_PATH" <<EOF
132-
[npmAuth."$SCOPED_REGISTRY_URL"]
133-
token = "$PRIVATE_REGISTRY_TOKEN"
134-
alwaysAuth = true
135-
EOF
136-
fi
137142

138143
fi
139144

@@ -280,4 +285,4 @@ if [ -d "$FULL_COVERAGE_RESULTS_PATH" ]; then
280285
chmod -R a+r "$FULL_COVERAGE_RESULTS_PATH"
281286
else
282287
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."
283-
fi
288+
fi

0 commit comments

Comments
 (0)