mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-05-18 07:04:45 +00:00
Add input python-version (#174)
This commit is contained in:
parent
420915557e
commit
ee4fa33003
7 changed files with 44 additions and 8 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
checkSum,
|
||||
enableCache,
|
||||
githubToken,
|
||||
pythonVersion,
|
||||
toolBinDir,
|
||||
toolDir,
|
||||
version,
|
||||
|
@ -45,12 +46,13 @@ async function run(): Promise<void> {
|
|||
addUvToPath(setupResult.uvDir);
|
||||
addToolBinToPath();
|
||||
setToolDir();
|
||||
core.setOutput("uv-version", setupResult.version);
|
||||
core.info(`Successfully installed uv version ${setupResult.version}`);
|
||||
|
||||
setupPython();
|
||||
addMatchers();
|
||||
setCacheDir(cacheLocalPath);
|
||||
|
||||
core.setOutput("uv-version", setupResult.version);
|
||||
core.info(`Successfully installed uv version ${setupResult.version}`);
|
||||
|
||||
if (enableCache) {
|
||||
await restoreCache(setupResult.version);
|
||||
}
|
||||
|
@ -133,6 +135,13 @@ function setToolDir(): void {
|
|||
}
|
||||
}
|
||||
|
||||
function setupPython(): void {
|
||||
if (pythonVersion !== "") {
|
||||
core.exportVariable("UV_PYTHON", pythonVersion);
|
||||
core.info(`Set UV_PYTHON to ${pythonVersion}`);
|
||||
}
|
||||
}
|
||||
|
||||
function setCacheDir(cacheLocalPath: string): void {
|
||||
core.exportVariable("UV_CACHE_DIR", cacheLocalPath);
|
||||
core.info(`Set UV_CACHE_DIR to ${cacheLocalPath}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue