Skip to content

Commit 2269511

Browse files
authored
Add uv-path and uvx-path output (#341)
Closes: #338
1 parent bf8ec1e commit 2269511

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed

.github/workflows/test.yml

+5
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@v4
4343
- name: Install latest version
44+
id: setup-uv
4445
uses: ./
4546
- run: uv sync
4647
working-directory: __tests__/fixtures/uv-project
4748
shell: bash
49+
- name: Check uv-path is set
50+
run: ${{ steps.setup-uv.outputs.uv-path }} --version
51+
- name: Check uvx-path is set
52+
run: ${{ steps.setup-uv.outputs.uvx-path }} --version
4853

4954
test-specific-version:
5055
runs-on: ubuntu-latest

action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ inputs:
5757
outputs:
5858
uv-version:
5959
description: "The installed uv version. Useful when using latest."
60+
uv-path:
61+
description: "The path to the installed uv binary."
62+
uvx-path:
63+
description: "The path to the installed uvx binary."
6064
cache-hit:
6165
description: "A boolean value to indicate a cache entry was found"
6266
runs:

dist/setup/index.js

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup-uv.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function run(): Promise<void> {
4444
}
4545
const setupResult = await setupUv(platform, arch, checkSum, githubToken);
4646

47-
addUvToPath(setupResult.uvDir);
47+
addUvToPathAndOutput(setupResult.uvDir);
4848
addToolBinToPath();
4949
setToolDir();
5050
await setupPython();
@@ -129,7 +129,9 @@ async function determineVersion(): Promise<string> {
129129
return await resolveVersion(versionFromConfigFile || "latest", githubToken);
130130
}
131131

132-
function addUvToPath(cachedPath: string): void {
132+
function addUvToPathAndOutput(cachedPath: string): void {
133+
core.setOutput("uv-path", `${cachedPath}${path.sep}uv`);
134+
core.setOutput("uvx-path", `${cachedPath}${path.sep}uvx`);
133135
core.addPath(cachedPath);
134136
core.info(`Added ${cachedPath} to the path`);
135137
}

0 commit comments

Comments
 (0)