5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-15 11:07:14 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
dependabot[bot]
681c641aba Bump actions/checkout from 5.0.0 to 6.0.1 (#712)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5.0.0
to 6.0.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v6.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Update all references from v5 and v4 to v6 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2314">actions/checkout#2314</a></li>
<li>Add worktree support for persist-credentials includeIf by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2327">actions/checkout#2327</a></li>
<li>Clarify v6 README by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2328">actions/checkout#2328</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v6...v6.0.1">https://github.com/actions/checkout/compare/v6...v6.0.1</a></p>
<h2>v6.0.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Update README to include Node.js 24 support details and requirements
by <a href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li>
<li>Persist creds to a separate file by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li>
<li>v6-beta by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2298">actions/checkout#2298</a></li>
<li>update readme/changelog for v6 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2311">actions/checkout#2311</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v5.0.0...v6.0.0">https://github.com/actions/checkout/compare/v5.0.0...v6.0.0</a></p>
<h2>v6-beta</h2>
<h2>What's Changed</h2>
<p>Updated persist-credentials to store the credentials under
<code>$RUNNER_TEMP</code> instead of directly in the local git
config.</p>
<p>This requires a minimum Actions Runner version of <a
href="https://github.com/actions/runner/releases/tag/v2.329.0">v2.329.0</a>
to access the persisted credentials for <a
href="https://docs.github.com/en/actions/tutorials/use-containerized-services/create-a-docker-container-action">Docker
container action</a> scenarios.</p>
<h2>v5.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Port v6 cleanup to v5 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v5...v5.0.1">https://github.com/actions/checkout/compare/v5...v5.0.1</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/blob/main/CHANGELOG.md">actions/checkout's
changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>v6.0.0</h2>
<ul>
<li>Persist creds to a separate file by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2286">actions/checkout#2286</a></li>
<li>Update README to include Node.js 24 support details and requirements
by <a href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2248">actions/checkout#2248</a></li>
</ul>
<h2>v5.0.1</h2>
<ul>
<li>Port v6 cleanup to v5 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2301">actions/checkout#2301</a></li>
</ul>
<h2>v5.0.0</h2>
<ul>
<li>Update actions checkout to use node 24 by <a
href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2226">actions/checkout#2226</a></li>
</ul>
<h2>v4.3.1</h2>
<ul>
<li>Port v6 cleanup to v4 by <a
href="https://github.com/ericsciple"><code>@​ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2305">actions/checkout#2305</a></li>
</ul>
<h2>v4.3.0</h2>
<ul>
<li>docs: update README.md by <a
href="https://github.com/motss"><code>@​motss</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1971">actions/checkout#1971</a></li>
<li>Add internal repos for checking out multiple repositories by <a
href="https://github.com/mouismail"><code>@​mouismail</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1977">actions/checkout#1977</a></li>
<li>Documentation update - add recommended permissions to Readme by <a
href="https://github.com/benwells"><code>@​benwells</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2043">actions/checkout#2043</a></li>
<li>Adjust positioning of user email note and permissions heading by <a
href="https://github.com/joshmgross"><code>@​joshmgross</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2044">actions/checkout#2044</a></li>
<li>Update README.md by <a
href="https://github.com/nebuk89"><code>@​nebuk89</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2194">actions/checkout#2194</a></li>
<li>Update CODEOWNERS for actions by <a
href="https://github.com/TingluoHuang"><code>@​TingluoHuang</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/2224">actions/checkout#2224</a></li>
<li>Update package dependencies by <a
href="https://github.com/salmanmkc"><code>@​salmanmkc</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2236">actions/checkout#2236</a></li>
</ul>
<h2>v4.2.2</h2>
<ul>
<li><code>url-helper.ts</code> now leverages well-known environment
variables by <a href="https://github.com/jww3"><code>@​jww3</code></a>
in <a
href="https://redirect.github.com/actions/checkout/pull/1941">actions/checkout#1941</a></li>
<li>Expand unit test coverage for <code>isGhes</code> by <a
href="https://github.com/jww3"><code>@​jww3</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1946">actions/checkout#1946</a></li>
</ul>
<h2>v4.2.1</h2>
<ul>
<li>Check out other refs/* by commit if provided, fall back to ref by <a
href="https://github.com/orhantoy"><code>@​orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1924">actions/checkout#1924</a></li>
</ul>
<h2>v4.2.0</h2>
<ul>
<li>Add Ref and Commit outputs by <a
href="https://github.com/lucacome"><code>@​lucacome</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1180">actions/checkout#1180</a></li>
<li>Dependency updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>- <a
href="https://redirect.github.com/actions/checkout/pull/1777">actions/checkout#1777</a>,
<a
href="https://redirect.github.com/actions/checkout/pull/1872">actions/checkout#1872</a></li>
</ul>
<h2>v4.1.7</h2>
<ul>
<li>Bump the minor-npm-dependencies group across 1 directory with 4
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1739">actions/checkout#1739</a></li>
<li>Bump actions/checkout from 3 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1697">actions/checkout#1697</a></li>
<li>Check out other refs/* by commit by <a
href="https://github.com/orhantoy"><code>@​orhantoy</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1774">actions/checkout#1774</a></li>
<li>Pin actions/checkout's own workflows to a known, good, stable
version. by <a href="https://github.com/jww3"><code>@​jww3</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1776">actions/checkout#1776</a></li>
</ul>
<h2>v4.1.6</h2>
<ul>
<li>Check platform to set archive extension appropriately by <a
href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1732">actions/checkout#1732</a></li>
</ul>
<h2>v4.1.5</h2>
<ul>
<li>Update NPM dependencies by <a
href="https://github.com/cory-miller"><code>@​cory-miller</code></a> in
<a
href="https://redirect.github.com/actions/checkout/pull/1703">actions/checkout#1703</a></li>
<li>Bump github/codeql-action from 2 to 3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1694">actions/checkout#1694</a></li>
<li>Bump actions/setup-node from 1 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1696">actions/checkout#1696</a></li>
<li>Bump actions/upload-artifact from 2 to 4 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/1695">actions/checkout#1695</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e8c483db8"><code>8e8c483</code></a>
Clarify v6 README (<a
href="https://redirect.github.com/actions/checkout/issues/2328">#2328</a>)</li>
<li><a
href="033fa0dc0b"><code>033fa0d</code></a>
Add worktree support for persist-credentials includeIf (<a
href="https://redirect.github.com/actions/checkout/issues/2327">#2327</a>)</li>
<li><a
href="c2d88d3ecc"><code>c2d88d3</code></a>
Update all references from v5 and v4 to v6 (<a
href="https://redirect.github.com/actions/checkout/issues/2314">#2314</a>)</li>
<li><a
href="1af3b93b68"><code>1af3b93</code></a>
update readme/changelog for v6 (<a
href="https://redirect.github.com/actions/checkout/issues/2311">#2311</a>)</li>
<li><a
href="71cf2267d8"><code>71cf226</code></a>
v6-beta (<a
href="https://redirect.github.com/actions/checkout/issues/2298">#2298</a>)</li>
<li><a
href="069c695914"><code>069c695</code></a>
Persist creds to a separate file (<a
href="https://redirect.github.com/actions/checkout/issues/2286">#2286</a>)</li>
<li><a
href="ff7abcd0c3"><code>ff7abcd</code></a>
Update README to include Node.js 24 support details and requirements (<a
href="https://redirect.github.com/actions/checkout/issues/2248">#2248</a>)</li>
<li>See full diff in <a
href="08c6903cd8...8e8c483db8">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/checkout&package-manager=github_actions&previous-version=5.0.0&new-version=6.0.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 17:36:34 +01:00
dependabot[bot]
2e85713bb0 Bump actions/setup-node from 6.0.0 to 6.1.0 (#715)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from
6.0.0 to 6.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/setup-node/releases">actions/setup-node's
releases</a>.</em></p>
<blockquote>
<h2>v6.1.0</h2>
<h2>What's Changed</h2>
<h3>Enhancement:</h3>
<ul>
<li>Remove always-auth configuration handling by <a
href="https://github.com/priyagupta108"><code>@​priyagupta108</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1436">actions/setup-node#1436</a></li>
</ul>
<h3>Dependency updates:</h3>
<ul>
<li>Upgrade <code>@​actions/cache</code> from 4.0.3 to 4.1.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/actions/setup-node/pull/1384">actions/setup-node#1384</a></li>
<li>Upgrade actions/checkout from 5 to 6 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/actions/setup-node/pull/1439">actions/setup-node#1439</a></li>
<li>Upgrade js-yaml from 3.14.1 to 3.14.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/actions/setup-node/pull/1435">actions/setup-node#1435</a></li>
</ul>
<h3>Documentation update:</h3>
<ul>
<li>Add example for restore-only cache in documentation by <a
href="https://github.com/aparnajyothi-y"><code>@​aparnajyothi-y</code></a>
in <a
href="https://redirect.github.com/actions/setup-node/pull/1419">actions/setup-node#1419</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/setup-node/compare/v6...v6.1.0">https://github.com/actions/setup-node/compare/v6...v6.1.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="395ad32622"><code>395ad32</code></a>
Bump js-yaml from 3.14.1 to 3.14.2 (<a
href="https://redirect.github.com/actions/setup-node/issues/1435">#1435</a>)</li>
<li><a
href="a4d2e2bbca"><code>a4d2e2b</code></a>
Bump actions/checkout from 5 to 6 (<a
href="https://redirect.github.com/actions/setup-node/issues/1439">#1439</a>)</li>
<li><a
href="b9b25d45f7"><code>b9b25d4</code></a>
Remove always-auth configuration handling from action (<a
href="https://redirect.github.com/actions/setup-node/issues/1436">#1436</a>)</li>
<li><a
href="633bb92bc0"><code>633bb92</code></a>
Bump <code>@​actions/cache</code> from 4.0.3 to 4.1.0 (<a
href="https://redirect.github.com/actions/setup-node/issues/1384">#1384</a>)</li>
<li><a
href="dda4788290"><code>dda4788</code></a>
Add example for restore-only cache in documentation (<a
href="https://redirect.github.com/actions/setup-node/issues/1419">#1419</a>)</li>
<li>See full diff in <a
href="2028fbc5c2...395ad32622">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-node&package-manager=github_actions&previous-version=6.0.0&new-version=6.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 17:27:03 +01:00
Kevin Stillhammer
58b6d7b303 fix: add OS version to cache key to prevent binary incompatibility (#716)
## Summary

- Adds OS name and version (e.g., `ubuntu-22.04`, `macos-14`,
`windows-2022`) to cache keys to prevent binary incompatibility when
GitHub updates runner images
- Fixes issue where cached uv binaries compiled against older
glibc/library versions fail on newer runner OS versions

## Changes

- Added `getOSNameVersion()` function to `src/utils/platforms.ts` with
OS-specific detection for Linux (via `/etc/os-release`), macOS (Darwin
kernel version mapping), and Windows
- Updated cache key format to include OS version, bumped `CACHE_VERSION`
to `"2"`
- Added `cache-key` output to expose the generated cache key for
debugging
- Added `test-cache-key-os-version` job testing across multiple OS
versions
- Updated `docs/caching.md` with cache key documentation

Closes #703
2025-12-13 17:25:42 +01:00
github-actions[bot]
e8b52af86e chore: update known checksums for 0.9.17 (#714)
chore: update known checksums for 0.9.17

Co-authored-by: eifinger <eifinger@users.noreply.github.com>
2025-12-10 08:18:18 +01:00
13 changed files with 552 additions and 55 deletions

View File

@@ -41,7 +41,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false

View File

@@ -21,14 +21,14 @@ jobs:
permissions:
security-events: write # for zizmor
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Actionlint
uses: eifinger/actionlint-action@213860089b7cf97d640aa67567898fabeb132746 # v1.9.3
- name: Run zizmor
uses: zizmorcore/zizmor-action@e639db99335bc9038abc0e066dfcd72e23d26fb4 # v0.3.0
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: .nvmrc
cache: npm
@@ -51,7 +51,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install latest version
@@ -76,7 +76,7 @@ jobs:
test-uv-no-modify-path:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install with UV_NO_MODIFY_PATH set
@@ -125,7 +125,7 @@ jobs:
expected-version: "0.1.0"
resolution-strategy: "lowest"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install version ${{ matrix.input.version-input }} with strategy ${{ matrix.input.resolution-strategy || 'highest' }}
@@ -154,7 +154,7 @@ jobs:
matrix:
version-input: ["latest", ">=0.8"]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install version ${{ matrix.version-input }}
@@ -182,7 +182,7 @@ jobs:
- working-directory: "__tests__/fixtures/uv-toml-project"
expected-version: "0.5.15"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install version from ${{ matrix.input.working-directory }}
@@ -208,7 +208,7 @@ jobs:
- version-file: "__tests__/fixtures/.tool-versions"
expected-version: "0.5.15"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install version from ${{ matrix.input.version-file }}
@@ -225,7 +225,7 @@ jobs:
test-malformed-pyproject-file-fallback:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install using malformed pyproject.toml
@@ -245,7 +245,7 @@ jobs:
- os: macos-latest
checksum: "a70cbfbf3bb5c08b2f84963b4f12c94e08fbb2468ba418a3bfe1066fbe9e7218"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Checksum matches expected
@@ -259,7 +259,7 @@ jobs:
test-with-explicit-token:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install default version
@@ -272,7 +272,7 @@ jobs:
test-uvx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install default version
@@ -285,7 +285,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install default version
@@ -296,7 +296,7 @@ jobs:
test-tilde-expansion-tool-dirs:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -321,7 +321,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install latest version
@@ -344,7 +344,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install latest version
@@ -381,14 +381,64 @@ jobs:
runs-on: ubuntu-latest
container: alpine
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install latest version
id: setup-uv
uses: ./
with:
enable-cache: true
- name: Verify cache key contains alpine
run: |
echo "Cache key: $CACHE_KEY"
if echo "$CACHE_KEY" | grep -qv "alpine"; then
echo "Cache key does not contain 'alpine'"
exit 1
fi
shell: sh
env:
CACHE_KEY: ${{ steps.setup-uv.outputs.cache-key }}
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-cache-key-os-version:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
expected-os: "ubuntu-22.04"
- os: ubuntu-24.04
expected-os: "ubuntu-24.04"
- os: macos-14
expected-os: "macos-14"
- os: macos-15
expected-os: "macos-15"
- os: windows-2022
expected-os: "windows-2022"
- os: windows-2025
expected-os: "windows-2025"
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup uv
id: setup-uv
uses: ./
with:
enable-cache: true
- name: Verify cache key contains OS version
run: |
echo "Cache key: $CACHE_KEY"
if [[ "$CACHE_KEY" != *"${{ matrix.expected-os }}"* ]]; then
echo "Cache key does not contain expected OS version: ${{ matrix.expected-os }}"
exit 1
fi
shell: bash
env:
CACHE_KEY: ${{ steps.setup-uv.outputs.cache-key }}
test-setup-cache:
runs-on: ${{ matrix.os }}
strategy:
@@ -396,7 +446,7 @@ jobs:
enable-cache: ["true", "false", "auto"]
os: ["ubuntu-latest", "selfhosted-ubuntu-arm64", "windows-latest"]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -415,7 +465,7 @@ jobs:
os: ["ubuntu-latest", "selfhosted-ubuntu-arm64", "windows-latest"]
needs: test-setup-cache
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Restore with cache
@@ -449,7 +499,7 @@ jobs:
test-setup-cache-requirements-txt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -465,7 +515,7 @@ jobs:
runs-on: ubuntu-latest
needs: test-setup-cache-requirements-txt
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Restore with cache
@@ -489,7 +539,7 @@ jobs:
test-setup-cache-dependency-glob:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -506,7 +556,7 @@ jobs:
runs-on: ubuntu-latest
needs: test-setup-cache-dependency-glob
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Change pyproject.toml
@@ -534,7 +584,7 @@ jobs:
test-setup-cache-save-cache-false:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -550,7 +600,7 @@ jobs:
runs-on: ubuntu-latest
needs: test-setup-cache-save-cache-false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Restore with cache
@@ -570,7 +620,7 @@ jobs:
test-setup-cache-restore-cache-false:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -585,7 +635,7 @@ jobs:
runs-on: ubuntu-latest
needs: test-setup-cache-restore-cache-false
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Restore with cache
@@ -615,7 +665,7 @@ jobs:
expected-cache-dir: "/home/ubuntu/.cache/uv"
runs-on: ${{ matrix.inputs.os }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -633,7 +683,7 @@ jobs:
test-cache-local-cache-disabled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup without cache
@@ -652,7 +702,7 @@ jobs:
test-cache-local-cache-disabled-but-explicit-path:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup without cache
@@ -672,7 +722,7 @@ jobs:
test-setup-cache-local:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup with cache
@@ -687,7 +737,7 @@ jobs:
runs-on: selfhosted-ubuntu-arm64
needs: test-setup-cache-local
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Restore with cache
@@ -710,7 +760,7 @@ jobs:
test-tilde-expansion-cache-local-path:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Create cache directory
@@ -726,7 +776,7 @@ jobs:
test-tilde-expansion-cache-dependency-glob:
runs-on: selfhosted-ubuntu-arm64
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Create cache directory
@@ -761,7 +811,7 @@ jobs:
test-no-python-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Fake pyproject.toml at root
@@ -776,7 +826,7 @@ jobs:
test-custom-manifest-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install from custom manifest file
@@ -795,7 +845,7 @@ jobs:
test-absolute-path:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Create requirements.txt
@@ -815,7 +865,7 @@ jobs:
test-relative-path:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: mkdir
@@ -839,7 +889,7 @@ jobs:
test-cache-prune-force:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Setup uv
@@ -856,7 +906,7 @@ jobs:
test-cache-dir-from-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Verify uv cache dir is not populated
@@ -881,7 +931,7 @@ jobs:
test-cache-python-installs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Verify Python install dir is not populated
@@ -908,7 +958,7 @@ jobs:
runs-on: ubuntu-latest
needs: test-cache-python-installs
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Verify Python install dir does not exist
@@ -952,7 +1002,7 @@ jobs:
expected-python-dir: "/home/ubuntu/.local/share/uv/python"
runs-on: ${{ matrix.inputs.os }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install latest version
@@ -971,7 +1021,7 @@ jobs:
test-act:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Install act
@@ -1002,6 +1052,7 @@ jobs:
- test-python-version
- test-activate-environment
- test-musl
- test-cache-key-os-version
- test-cache-local
- test-cache-local-cache-disabled
- test-cache-local-cache-disabled-but-explicit-path

View File

@@ -15,10 +15,10 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version: "20"
- name: Update known versions

View File

@@ -17,7 +17,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: true # needed for git push below
- name: Update Major Minor Tags

View File

@@ -89,6 +89,8 @@ outputs:
description: "The path to the installed uvx binary."
cache-hit:
description: "A boolean value to indicate a cache entry was found"
cache-key:
description: "The cache key used for storing/restoring the cache"
venv:
description: "Path to the activated venv if activate-environment is true"
runs:

77
dist/save-cache/index.js generated vendored
View File

@@ -90609,10 +90609,11 @@ const inputs_1 = __nccwpck_require__(9612);
const platforms_1 = __nccwpck_require__(8361);
exports.STATE_CACHE_KEY = "cache-key";
exports.STATE_CACHE_MATCHED_KEY = "cache-matched-key";
const CACHE_VERSION = "1";
const CACHE_VERSION = "2";
async function restoreCache() {
const cacheKey = await computeKeys();
core.saveState(exports.STATE_CACHE_KEY, cacheKey);
core.setOutput("cache-key", cacheKey);
if (!inputs_1.restoreCache) {
core.info("restore-cache is false. Skipping restore cache step.");
return;
@@ -90652,9 +90653,10 @@ async function computeKeys() {
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
const pythonVersion = await getPythonVersion();
const platform = await (0, platforms_1.getPlatform)();
const osNameVersion = (0, platforms_1.getOSNameVersion)();
const pruned = inputs_1.pruneCache ? "-pruned" : "";
const python = inputs_1.cachePython ? "-py" : "";
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${osNameVersion}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
}
async function getPythonVersion() {
if (inputs_1.pythonVersion !== "") {
@@ -91282,9 +91284,15 @@ var __importStar = (this && this.__importStar) || (function () {
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getArch = getArch;
exports.getPlatform = getPlatform;
exports.getOSNameVersion = getOSNameVersion;
const node_fs_1 = __importDefault(__nccwpck_require__(3024));
const node_os_1 = __importDefault(__nccwpck_require__(8161));
const core = __importStar(__nccwpck_require__(7484));
const exec = __importStar(__nccwpck_require__(5236));
function getArch() {
@@ -91342,6 +91350,63 @@ async function isMuslOs() {
return false;
}
}
/**
* Returns OS name and version for cache key differentiation.
* Examples: "ubuntu-22.04", "macos-14", "windows-2022"
* Throws if OS detection fails.
*/
function getOSNameVersion() {
const platform = process.platform;
if (platform === "linux") {
return getLinuxOSNameVersion();
}
if (platform === "darwin") {
return getMacOSNameVersion();
}
if (platform === "win32") {
return getWindowsNameVersion();
}
throw new Error(`Unsupported platform: ${platform}`);
}
function getLinuxOSNameVersion() {
const files = ["/etc/os-release", "/usr/lib/os-release"];
for (const file of files) {
try {
const content = node_fs_1.default.readFileSync(file, "utf8");
const id = parseOsReleaseValue(content, "ID");
const versionId = parseOsReleaseValue(content, "VERSION_ID");
if (id && versionId) {
return `${id}-${versionId}`;
}
}
catch {
// Try next file
}
}
throw new Error("Failed to determine Linux distribution. " +
"Could not read /etc/os-release or /usr/lib/os-release");
}
function parseOsReleaseValue(content, key) {
const regex = new RegExp(`^${key}=["']?([^"'\\n]*)["']?$`, "m");
const match = content.match(regex);
return match?.[1];
}
function getMacOSNameVersion() {
const darwinVersion = Number.parseInt(node_os_1.default.release().split(".")[0], 10);
if (Number.isNaN(darwinVersion)) {
throw new Error(`Failed to parse macOS version from: ${node_os_1.default.release()}`);
}
const macosVersion = darwinVersion - 9;
return `macos-${macosVersion}`;
}
function getWindowsNameVersion() {
const version = node_os_1.default.version();
const match = version.match(/Windows(?: Server)? (\d+)/);
if (!match) {
throw new Error(`Failed to parse Windows version from: ${version}`);
}
return `windows-${match[1]}`;
}
/***/ }),
@@ -91482,6 +91547,14 @@ module.exports = require("node:fs");
/***/ }),
/***/ 8161:
/***/ ((module) => {
"use strict";
module.exports = require("node:os");
/***/ }),
/***/ 6760:
/***/ ((module) => {

95
dist/setup/index.js generated vendored
View File

@@ -91512,10 +91512,11 @@ const inputs_1 = __nccwpck_require__(9612);
const platforms_1 = __nccwpck_require__(8361);
exports.STATE_CACHE_KEY = "cache-key";
exports.STATE_CACHE_MATCHED_KEY = "cache-matched-key";
const CACHE_VERSION = "1";
const CACHE_VERSION = "2";
async function restoreCache() {
const cacheKey = await computeKeys();
core.saveState(exports.STATE_CACHE_KEY, cacheKey);
core.setOutput("cache-key", cacheKey);
if (!inputs_1.restoreCache) {
core.info("restore-cache is false. Skipping restore cache step.");
return;
@@ -91555,9 +91556,10 @@ async function computeKeys() {
const suffix = inputs_1.cacheSuffix ? `-${inputs_1.cacheSuffix}` : "";
const pythonVersion = await getPythonVersion();
const platform = await (0, platforms_1.getPlatform)();
const osNameVersion = (0, platforms_1.getOSNameVersion)();
const pruned = inputs_1.pruneCache ? "-pruned" : "";
const python = inputs_1.cachePython ? "-py" : "";
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
return `setup-uv-${CACHE_VERSION}-${(0, platforms_1.getArch)()}-${platform}-${osNameVersion}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
}
async function getPythonVersion() {
if (inputs_1.pythonVersion !== "") {
@@ -91699,6 +91701,24 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KNOWN_CHECKSUMS = void 0;
// AUTOGENERATED_DO_NOT_EDIT
exports.KNOWN_CHECKSUMS = {
"aarch64-apple-darwin-0.9.17": "a1e1464aa1d04d5e5fa700aa2f2e10397d1114e835dbd56be25ba65c9a31bd99",
"aarch64-pc-windows-msvc-0.9.17": "28423a27ad1d82347c00411a6792567119b3c1cfe775d3312c0e08a6b489be5b",
"aarch64-unknown-linux-gnu-0.9.17": "e9eba97b7169e47fd3c926e409f0b714820f0befc23b3ae062780586a793e4cc",
"aarch64-unknown-linux-musl-0.9.17": "f6f48a301f8e855765af42ef50257af0cebc9c5439dfdcbc188142941aea45ca",
"arm-unknown-linux-musleabihf-0.9.17": "4d80f3509b6351882a64c1dd08f72a80e2b27f055a996295ef1f935bc3efcdde",
"armv7-unknown-linux-gnueabihf-0.9.17": "30a6c041429e2176062573f33c5c44307cb756264224bcb005723a6e18cff34c",
"armv7-unknown-linux-musleabihf-0.9.17": "6b034dc63735c2a4541430cbece688e28bce51a09e2ad1ea2c1646a6b24cf1c3",
"i686-pc-windows-msvc-0.9.17": "6e93737710e31bf73fcc3b4b6da616bd341e9c6baf1162ddc1e7f65884063f50",
"i686-unknown-linux-gnu-0.9.17": "d2426a6d10bedd83524599bb0fbe0ba22e681ed45e892b4fd29086b424daf02a",
"i686-unknown-linux-musl-0.9.17": "988c7702a2e88092b30f16fb7f8c18284a8062044cf57e6abd1dfeae82aa6377",
"powerpc64-unknown-linux-gnu-0.9.17": "5ad301d9fa15e0791ef96abd83f0ed97e7ac1191b4b7578caaad3151633fb17c",
"powerpc64le-unknown-linux-gnu-0.9.17": "4958185c5febf22f1c4c84944334cb0d9262c2c2c93faf30c1e0abd26f9d94fa",
"riscv64gc-unknown-linux-gnu-0.9.17": "feed7cc7b5fc8a99e683ee1761cf99e3da12b60a2a413b7b87a0447726a66369",
"s390x-unknown-linux-gnu-0.9.17": "a297518913a0f0e4af1bce434440ca9d415728aaf828c7def0e913aa5c46da8f",
"x86_64-apple-darwin-0.9.17": "249e7fb18d45c06ba283c48f0a8e586ecc5fbb9e8dad0923c4169a7c4db815b2",
"x86_64-pc-windows-msvc-0.9.17": "ebc76197bf3e1a58f9dac6f70f49b0ebd3e6907ab35289ce228bce5ba8a3f201",
"x86_64-unknown-linux-gnu-0.9.17": "0114d54f9aafd07516cf1cadfe72afa970f5fd293fbe82dd924b8a7b42c984d8",
"x86_64-unknown-linux-musl-0.9.17": "ab616c1851e7b1ed377a9ff3997dcee184bea7eda0b20bc8607abba6c469cbad",
"aarch64-apple-darwin-0.9.16": "db6d7fb299c35dc9bbbeb89cfa9aa55a9584f637d370c0a4c62a50df9c9294a7",
"aarch64-pc-windows-msvc-0.9.16": "591c73f47dfec72f9d242eebcb36197f27ad652a59d70e70db5c52018684d78e",
"aarch64-unknown-linux-gnu-0.9.16": "a8e9e3f7e621e212d9663ea28827bd8fb9ec11c453ae88d520b48e969e9ff5db",
@@ -96773,9 +96793,15 @@ var __importStar = (this && this.__importStar) || (function () {
return result;
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getArch = getArch;
exports.getPlatform = getPlatform;
exports.getOSNameVersion = getOSNameVersion;
const node_fs_1 = __importDefault(__nccwpck_require__(3024));
const node_os_1 = __importDefault(__nccwpck_require__(8161));
const core = __importStar(__nccwpck_require__(7484));
const exec = __importStar(__nccwpck_require__(5236));
function getArch() {
@@ -96833,6 +96859,63 @@ async function isMuslOs() {
return false;
}
}
/**
* Returns OS name and version for cache key differentiation.
* Examples: "ubuntu-22.04", "macos-14", "windows-2022"
* Throws if OS detection fails.
*/
function getOSNameVersion() {
const platform = process.platform;
if (platform === "linux") {
return getLinuxOSNameVersion();
}
if (platform === "darwin") {
return getMacOSNameVersion();
}
if (platform === "win32") {
return getWindowsNameVersion();
}
throw new Error(`Unsupported platform: ${platform}`);
}
function getLinuxOSNameVersion() {
const files = ["/etc/os-release", "/usr/lib/os-release"];
for (const file of files) {
try {
const content = node_fs_1.default.readFileSync(file, "utf8");
const id = parseOsReleaseValue(content, "ID");
const versionId = parseOsReleaseValue(content, "VERSION_ID");
if (id && versionId) {
return `${id}-${versionId}`;
}
}
catch {
// Try next file
}
}
throw new Error("Failed to determine Linux distribution. " +
"Could not read /etc/os-release or /usr/lib/os-release");
}
function parseOsReleaseValue(content, key) {
const regex = new RegExp(`^${key}=["']?([^"'\\n]*)["']?$`, "m");
const match = content.match(regex);
return match?.[1];
}
function getMacOSNameVersion() {
const darwinVersion = Number.parseInt(node_os_1.default.release().split(".")[0], 10);
if (Number.isNaN(darwinVersion)) {
throw new Error(`Failed to parse macOS version from: ${node_os_1.default.release()}`);
}
const macosVersion = darwinVersion - 9;
return `macos-${macosVersion}`;
}
function getWindowsNameVersion() {
const version = node_os_1.default.version();
const match = version.match(/Windows(?: Server)? (\d+)/);
if (!match) {
throw new Error(`Failed to parse Windows version from: ${version}`);
}
return `windows-${match[1]}`;
}
/***/ }),
@@ -97198,6 +97281,14 @@ module.exports = require("node:fs");
/***/ }),
/***/ 8161:
/***/ ((module) => {
"use strict";
module.exports = require("node:os");
/***/ }),
/***/ 6760:
/***/ ((module) => {

18
dist/update-known-versions/index.js generated vendored
View File

@@ -28196,6 +28196,24 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.KNOWN_CHECKSUMS = void 0;
// AUTOGENERATED_DO_NOT_EDIT
exports.KNOWN_CHECKSUMS = {
"aarch64-apple-darwin-0.9.17": "a1e1464aa1d04d5e5fa700aa2f2e10397d1114e835dbd56be25ba65c9a31bd99",
"aarch64-pc-windows-msvc-0.9.17": "28423a27ad1d82347c00411a6792567119b3c1cfe775d3312c0e08a6b489be5b",
"aarch64-unknown-linux-gnu-0.9.17": "e9eba97b7169e47fd3c926e409f0b714820f0befc23b3ae062780586a793e4cc",
"aarch64-unknown-linux-musl-0.9.17": "f6f48a301f8e855765af42ef50257af0cebc9c5439dfdcbc188142941aea45ca",
"arm-unknown-linux-musleabihf-0.9.17": "4d80f3509b6351882a64c1dd08f72a80e2b27f055a996295ef1f935bc3efcdde",
"armv7-unknown-linux-gnueabihf-0.9.17": "30a6c041429e2176062573f33c5c44307cb756264224bcb005723a6e18cff34c",
"armv7-unknown-linux-musleabihf-0.9.17": "6b034dc63735c2a4541430cbece688e28bce51a09e2ad1ea2c1646a6b24cf1c3",
"i686-pc-windows-msvc-0.9.17": "6e93737710e31bf73fcc3b4b6da616bd341e9c6baf1162ddc1e7f65884063f50",
"i686-unknown-linux-gnu-0.9.17": "d2426a6d10bedd83524599bb0fbe0ba22e681ed45e892b4fd29086b424daf02a",
"i686-unknown-linux-musl-0.9.17": "988c7702a2e88092b30f16fb7f8c18284a8062044cf57e6abd1dfeae82aa6377",
"powerpc64-unknown-linux-gnu-0.9.17": "5ad301d9fa15e0791ef96abd83f0ed97e7ac1191b4b7578caaad3151633fb17c",
"powerpc64le-unknown-linux-gnu-0.9.17": "4958185c5febf22f1c4c84944334cb0d9262c2c2c93faf30c1e0abd26f9d94fa",
"riscv64gc-unknown-linux-gnu-0.9.17": "feed7cc7b5fc8a99e683ee1761cf99e3da12b60a2a413b7b87a0447726a66369",
"s390x-unknown-linux-gnu-0.9.17": "a297518913a0f0e4af1bce434440ca9d415728aaf828c7def0e913aa5c46da8f",
"x86_64-apple-darwin-0.9.17": "249e7fb18d45c06ba283c48f0a8e586ecc5fbb9e8dad0923c4169a7c4db815b2",
"x86_64-pc-windows-msvc-0.9.17": "ebc76197bf3e1a58f9dac6f70f49b0ebd3e6907ab35289ce228bce5ba8a3f201",
"x86_64-unknown-linux-gnu-0.9.17": "0114d54f9aafd07516cf1cadfe72afa970f5fd293fbe82dd924b8a7b42c984d8",
"x86_64-unknown-linux-musl-0.9.17": "ab616c1851e7b1ed377a9ff3997dcee184bea7eda0b20bc8607abba6c469cbad",
"aarch64-apple-darwin-0.9.16": "db6d7fb299c35dc9bbbeb89cfa9aa55a9584f637d370c0a4c62a50df9c9294a7",
"aarch64-pc-windows-msvc-0.9.16": "591c73f47dfec72f9d242eebcb36197f27ad652a59d70e70db5c52018684d78e",
"aarch64-unknown-linux-gnu-0.9.16": "a8e9e3f7e621e212d9663ea28827bd8fb9ec11c453ae88d520b48e969e9ff5db",

View File

@@ -2,6 +2,34 @@
This document covers all caching-related configuration options for setup-uv.
## Cache key
The cache key is automatically generated based on:
- **Architecture**: CPU architecture (e.g., `x86_64`, `aarch64`)
- **Platform**: OS platform type (e.g., `unknown-linux-gnu`, `unknown-linux-musl`, `apple-darwin`,
`pc-windows-msvc`)
- **OS version**: OS name and version (e.g., `ubuntu-22.04`, `macos-14`, `windows-2022`)
- **Python version**: The Python version in use
- **Cache options**: Whether pruning and Python caching are enabled
- **Dependency hash**: Hash of files matching `cache-dependency-glob`
- **Suffix**: Optional `cache-suffix` if provided
Including the OS version ensures that caches are not shared between different OS versions,
preventing binary incompatibility issues when runner images change.
The computed cache key is available as the `cache-key` output:
```yaml
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Print cache key
run: echo "Cache key: ${{ steps.setup-uv.outputs.cache-key }}"
```
## Enable caching
> [!NOTE]

View File

@@ -13,15 +13,16 @@ import {
restoreCache as shouldRestoreCache,
workingDirectory,
} from "../utils/inputs";
import { getArch, getPlatform } from "../utils/platforms";
import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms";
export const STATE_CACHE_KEY = "cache-key";
export const STATE_CACHE_MATCHED_KEY = "cache-matched-key";
const CACHE_VERSION = "1";
const CACHE_VERSION = "2";
export async function restoreCache(): Promise<void> {
const cacheKey = await computeKeys();
core.saveState(STATE_CACHE_KEY, cacheKey);
core.setOutput("cache-key", cacheKey);
if (!shouldRestoreCache) {
core.info("restore-cache is false. Skipping restore cache step.");
@@ -72,9 +73,10 @@ async function computeKeys(): Promise<string> {
const suffix = cacheSuffix ? `-${cacheSuffix}` : "";
const pythonVersion = await getPythonVersion();
const platform = await getPlatform();
const osNameVersion = getOSNameVersion();
const pruned = pruneCache ? "-pruned" : "";
const python = cachePython ? "-py" : "";
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${pythonVersion}${pruned}${python}${cacheDependencyPathHash}${suffix}`;
}
async function getPythonVersion(): Promise<string> {

View File

@@ -1,5 +1,41 @@
// AUTOGENERATED_DO_NOT_EDIT
export const KNOWN_CHECKSUMS: { [key: string]: string } = {
"aarch64-apple-darwin-0.9.17":
"a1e1464aa1d04d5e5fa700aa2f2e10397d1114e835dbd56be25ba65c9a31bd99",
"aarch64-pc-windows-msvc-0.9.17":
"28423a27ad1d82347c00411a6792567119b3c1cfe775d3312c0e08a6b489be5b",
"aarch64-unknown-linux-gnu-0.9.17":
"e9eba97b7169e47fd3c926e409f0b714820f0befc23b3ae062780586a793e4cc",
"aarch64-unknown-linux-musl-0.9.17":
"f6f48a301f8e855765af42ef50257af0cebc9c5439dfdcbc188142941aea45ca",
"arm-unknown-linux-musleabihf-0.9.17":
"4d80f3509b6351882a64c1dd08f72a80e2b27f055a996295ef1f935bc3efcdde",
"armv7-unknown-linux-gnueabihf-0.9.17":
"30a6c041429e2176062573f33c5c44307cb756264224bcb005723a6e18cff34c",
"armv7-unknown-linux-musleabihf-0.9.17":
"6b034dc63735c2a4541430cbece688e28bce51a09e2ad1ea2c1646a6b24cf1c3",
"i686-pc-windows-msvc-0.9.17":
"6e93737710e31bf73fcc3b4b6da616bd341e9c6baf1162ddc1e7f65884063f50",
"i686-unknown-linux-gnu-0.9.17":
"d2426a6d10bedd83524599bb0fbe0ba22e681ed45e892b4fd29086b424daf02a",
"i686-unknown-linux-musl-0.9.17":
"988c7702a2e88092b30f16fb7f8c18284a8062044cf57e6abd1dfeae82aa6377",
"powerpc64-unknown-linux-gnu-0.9.17":
"5ad301d9fa15e0791ef96abd83f0ed97e7ac1191b4b7578caaad3151633fb17c",
"powerpc64le-unknown-linux-gnu-0.9.17":
"4958185c5febf22f1c4c84944334cb0d9262c2c2c93faf30c1e0abd26f9d94fa",
"riscv64gc-unknown-linux-gnu-0.9.17":
"feed7cc7b5fc8a99e683ee1761cf99e3da12b60a2a413b7b87a0447726a66369",
"s390x-unknown-linux-gnu-0.9.17":
"a297518913a0f0e4af1bce434440ca9d415728aaf828c7def0e913aa5c46da8f",
"x86_64-apple-darwin-0.9.17":
"249e7fb18d45c06ba283c48f0a8e586ecc5fbb9e8dad0923c4169a7c4db815b2",
"x86_64-pc-windows-msvc-0.9.17":
"ebc76197bf3e1a58f9dac6f70f49b0ebd3e6907ab35289ce228bce5ba8a3f201",
"x86_64-unknown-linux-gnu-0.9.17":
"0114d54f9aafd07516cf1cadfe72afa970f5fd293fbe82dd924b8a7b42c984d8",
"x86_64-unknown-linux-musl-0.9.17":
"ab616c1851e7b1ed377a9ff3997dcee184bea7eda0b20bc8607abba6c469cbad",
"aarch64-apple-darwin-0.9.16":
"db6d7fb299c35dc9bbbeb89cfa9aa55a9584f637d370c0a4c62a50df9c9294a7",
"aarch64-pc-windows-msvc-0.9.16":

View File

@@ -1,3 +1,5 @@
import fs from "node:fs";
import os from "node:os";
import * as core from "@actions/core";
import * as exec from "@actions/exec";
export type Platform =
@@ -74,3 +76,71 @@ async function isMuslOs(): Promise<boolean> {
return false;
}
}
/**
* Returns OS name and version for cache key differentiation.
* Examples: "ubuntu-22.04", "macos-14", "windows-2022"
* Throws if OS detection fails.
*/
export function getOSNameVersion(): string {
const platform = process.platform;
if (platform === "linux") {
return getLinuxOSNameVersion();
}
if (platform === "darwin") {
return getMacOSNameVersion();
}
if (platform === "win32") {
return getWindowsNameVersion();
}
throw new Error(`Unsupported platform: ${platform}`);
}
function getLinuxOSNameVersion(): string {
const files = ["/etc/os-release", "/usr/lib/os-release"];
for (const file of files) {
try {
const content = fs.readFileSync(file, "utf8");
const id = parseOsReleaseValue(content, "ID");
const versionId = parseOsReleaseValue(content, "VERSION_ID");
if (id && versionId) {
return `${id}-${versionId}`;
}
} catch {
// Try next file
}
}
throw new Error(
"Failed to determine Linux distribution. " +
"Could not read /etc/os-release or /usr/lib/os-release",
);
}
function parseOsReleaseValue(content: string, key: string): string | undefined {
const regex = new RegExp(`^${key}=["']?([^"'\\n]*)["']?$`, "m");
const match = content.match(regex);
return match?.[1];
}
function getMacOSNameVersion(): string {
const darwinVersion = Number.parseInt(os.release().split(".")[0], 10);
if (Number.isNaN(darwinVersion)) {
throw new Error(`Failed to parse macOS version from: ${os.release()}`);
}
const macosVersion = darwinVersion - 9;
return `macos-${macosVersion}`;
}
function getWindowsNameVersion(): string {
const version = os.version();
const match = version.match(/Windows(?: Server)? (\d+)/);
if (!match) {
throw new Error(`Failed to parse Windows version from: ${version}`);
}
return `windows-${match[1]}`;
}

View File

@@ -1,4 +1,130 @@
[
{
"arch": "aarch64",
"artifactName": "uv-aarch64-apple-darwin.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-aarch64-apple-darwin.tar.gz",
"platform": "apple-darwin",
"version": "0.9.17"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-aarch64-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.17"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-aarch64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-aarch64-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.17"
},
{
"arch": "arm",
"artifactName": "uv-arm-unknown-linux-musleabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-arm-unknown-linux-musleabihf.tar.gz",
"platform": "unknown-linux-musleabihf",
"version": "0.9.17"
},
{
"arch": "armv7",
"artifactName": "uv-armv7-unknown-linux-gnueabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-armv7-unknown-linux-gnueabihf.tar.gz",
"platform": "unknown-linux-gnueabihf",
"version": "0.9.17"
},
{
"arch": "armv7",
"artifactName": "uv-armv7-unknown-linux-musleabihf.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-armv7-unknown-linux-musleabihf.tar.gz",
"platform": "unknown-linux-musleabihf",
"version": "0.9.17"
},
{
"arch": "i686",
"artifactName": "uv-i686-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-i686-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.17"
},
{
"arch": "i686",
"artifactName": "uv-i686-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-i686-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "i686",
"artifactName": "uv-i686-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-i686-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.17"
},
{
"arch": "powerpc64",
"artifactName": "uv-powerpc64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-powerpc64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "powerpc64le",
"artifactName": "uv-powerpc64le-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-powerpc64le-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "riscv64gc",
"artifactName": "uv-riscv64gc-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-riscv64gc-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "s390x",
"artifactName": "uv-s390x-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-s390x-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-apple-darwin.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-x86_64-apple-darwin.tar.gz",
"platform": "apple-darwin",
"version": "0.9.17"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-pc-windows-msvc.zip",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-x86_64-pc-windows-msvc.zip",
"platform": "pc-windows-msvc",
"version": "0.9.17"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-unknown-linux-gnu.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-x86_64-unknown-linux-gnu.tar.gz",
"platform": "unknown-linux-gnu",
"version": "0.9.17"
},
{
"arch": "x86_64",
"artifactName": "uv-x86_64-unknown-linux-musl.tar.gz",
"downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.9.17/uv-x86_64-unknown-linux-musl.tar.gz",
"platform": "unknown-linux-musl",
"version": "0.9.17"
},
{
"arch": "aarch64",
"artifactName": "uv-aarch64-apple-darwin.tar.gz",