mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
feat: UPM private registry on windows runner.
This commit is contained in:
parent
461ecf7cea
commit
753a7b978d
@ -261,6 +261,10 @@ inputs:
|
|||||||
default: 'false'
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
|
description: 'Skip the activation/deactivation of Unity. This assumes Unity is already activated.'
|
||||||
|
scopedRegistryUrl:
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
description: 'Scoped registry to use for resolving package dependencies. Only applicable if packageMode is true.'
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
volume:
|
volume:
|
||||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
34
dist/platforms/windows/build.ps1
vendored
34
dist/platforms/windows/build.ps1
vendored
@ -24,6 +24,40 @@ Write-Output "$('Using build path "')$($Env:BUILD_PATH)$('" to save file "')$($E
|
|||||||
$Env:BUILD_PATH_FULL="$Env:GITHUB_WORKSPACE\$Env:BUILD_PATH"
|
$Env:BUILD_PATH_FULL="$Env:GITHUB_WORKSPACE\$Env:BUILD_PATH"
|
||||||
$Env:CUSTOM_BUILD_PATH="$Env:BUILD_PATH_FULL\$Env:BUILD_FILE"
|
$Env:CUSTOM_BUILD_PATH="$Env:BUILD_PATH_FULL\$Env:BUILD_FILE"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Setup token for private package registry.
|
||||||
|
#
|
||||||
|
|
||||||
|
if ($null -ne ${env:PRIVATE_REGISTRY_TOKEN})
|
||||||
|
{
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "###########################"
|
||||||
|
Write-Output "# Private Registry #"
|
||||||
|
Write-Output "###########################"
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "Private registry token detected, creating .upmconfig.toml and .npmrc"
|
||||||
|
|
||||||
|
$UPM_CONFIG_TOML_PATH="$env:USERPROFILE\.upmconfig.toml"
|
||||||
|
Write-Output "Creating toml at path: $UPM_CONFIG_TOML_PATH"
|
||||||
|
|
||||||
|
#$NPMRC_PATH="$env:USERPROFILE\.npmrc"
|
||||||
|
#Write-Output "Creating npmrc at path: $NPMRC_PATH"
|
||||||
|
|
||||||
|
@"
|
||||||
|
[npmAuth."${env:SCOPED_REGISTRY_URL}"]
|
||||||
|
token = "${env:PRIVATE_REGISTRY_TOKEN}"
|
||||||
|
alwaysAuth = true
|
||||||
|
"@ | Set-Content -Path "$env:USERPROFILE\.upmconfig.toml"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Write-Output ""
|
||||||
|
Write-Output "###########################"
|
||||||
|
Write-Output "# Test Test #"
|
||||||
|
Write-Output "###########################"
|
||||||
|
Write-Output ""
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set the build method, must reference one of:
|
# Set the build method, must reference one of:
|
||||||
#
|
#
|
||||||
|
@ -94,6 +94,8 @@ class BuildParameters {
|
|||||||
public cacheUnityInstallationOnMac!: boolean;
|
public cacheUnityInstallationOnMac!: boolean;
|
||||||
public unityHubVersionOnMac!: string;
|
public unityHubVersionOnMac!: string;
|
||||||
public dockerWorkspacePath!: string;
|
public dockerWorkspacePath!: string;
|
||||||
|
public scopedRegistryUrl!: string;
|
||||||
|
public upmRegistryToken!: string;
|
||||||
|
|
||||||
public static shouldUseRetainedWorkspaceMode(buildParameters: BuildParameters) {
|
public static shouldUseRetainedWorkspaceMode(buildParameters: BuildParameters) {
|
||||||
return buildParameters.maxRetainedWorkspaces > 0 && CloudRunner.lockedWorkspace !== ``;
|
return buildParameters.maxRetainedWorkspaces > 0 && CloudRunner.lockedWorkspace !== ``;
|
||||||
@ -218,6 +220,8 @@ class BuildParameters {
|
|||||||
cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac,
|
cacheUnityInstallationOnMac: Input.cacheUnityInstallationOnMac,
|
||||||
unityHubVersionOnMac: Input.unityHubVersionOnMac,
|
unityHubVersionOnMac: Input.unityHubVersionOnMac,
|
||||||
dockerWorkspacePath: Input.dockerWorkspacePath,
|
dockerWorkspacePath: Input.dockerWorkspacePath,
|
||||||
|
scopedRegistryUrl: Input.scopedRegistryUrl,
|
||||||
|
upmRegistryToken: Input.upmRegistryToken,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ class ImageEnvironmentFactory {
|
|||||||
name: 'USYM_UPLOAD_AUTH_TOKEN',
|
name: 'USYM_UPLOAD_AUTH_TOKEN',
|
||||||
value: process.env.USYM_UPLOAD_AUTH_TOKEN,
|
value: process.env.USYM_UPLOAD_AUTH_TOKEN,
|
||||||
},
|
},
|
||||||
|
{ name: 'SCOPED_REGISTRY_URL', value: parameters.scopedRegistryUrl },
|
||||||
|
{ name: 'PRIVATE_REGISTRY_TOKEN', value: process.env.UPM_REGISTRY_TOKEN },
|
||||||
{ name: 'PROJECT_PATH', value: parameters.projectPath },
|
{ name: 'PROJECT_PATH', value: parameters.projectPath },
|
||||||
{ name: 'BUILD_TARGET', value: parameters.targetPlatform },
|
{ name: 'BUILD_TARGET', value: parameters.targetPlatform },
|
||||||
{ name: 'BUILD_NAME', value: parameters.buildName },
|
{ name: 'BUILD_NAME', value: parameters.buildName },
|
||||||
|
@ -241,6 +241,18 @@ class Input {
|
|||||||
return Input.getInput('dockerCpuLimit') ?? os.cpus().length.toString();
|
return Input.getInput('dockerCpuLimit') ?? os.cpus().length.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get scopedRegistryUrl(): string {
|
||||||
|
const input = Input.getInput('scopedRegistryUrl') ?? '';
|
||||||
|
|
||||||
|
return input !== '' ? input : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
static get upmRegistryToken(): string {
|
||||||
|
const input = Input.getInput('UPM_REGISTRY_TOKEN') ?? '';
|
||||||
|
|
||||||
|
return input !== '' ? input : '';
|
||||||
|
}
|
||||||
|
|
||||||
static get dockerMemoryLimit(): string {
|
static get dockerMemoryLimit(): string {
|
||||||
const bytesInMegabyte = 1024 * 1024;
|
const bytesInMegabyte = 1024 * 1024;
|
||||||
|
|
||||||
|
@ -190,6 +190,8 @@ class SetupMac {
|
|||||||
process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;
|
process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;
|
||||||
process.env.MANUAL_EXIT = buildParameters.manualExit.toString();
|
process.env.MANUAL_EXIT = buildParameters.manualExit.toString();
|
||||||
process.env.ENABLE_GPU = buildParameters.enableGpu.toString();
|
process.env.ENABLE_GPU = buildParameters.enableGpu.toString();
|
||||||
|
process.env.PRIVATE_REGISTRY_TOKEN = buildParameters.upmRegistryToken;
|
||||||
|
process.env.SCOPED_REGISTRY_URL = buildParameters.scopedRegistryUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user