Compare commits

...

28 Commits

Author SHA1 Message Date
dependabot[bot]
8df9e7cd69 chore(deps-dev): bump @biomejs/biome from 2.5.9 to 2.5.11
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 2.5.9 to 2.5.11.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.5.11/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-version: 2.5.11
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-28 10:53:52 +00:00
github-actions[bot]
227a0f6bea chore: update known checksums for 0.12.19 (#1068)
chore: update known checksums for 0.12.19

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-25 08:48:57 +02:00
github-actions[bot]
525b679e45 chore: update known checksums for 0.12.18 (#1065)
chore: update known checksums for 0.12.18

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-23 08:08:47 +02:00
Kevin Stillhammer
c18668ad3c chore(deps): roll up Dependabot updates (#1059)
Co-authored-by: Amp <amp@ampcode.com>
2026-09-21 08:40:50 +02:00
github-actions[bot]
ffe1476305 chore: update known checksums for 0.12.17 (#1058)
chore: update known checksums for 0.12.17

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-20 10:50:13 +02:00
github-actions[bot]
f5548c5552 chore: update known checksums for 0.12.16 (#1057)
chore: update known checksums for 0.12.16

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-18 08:48:58 +02:00
Kevin Stillhammer
a761a4e9af Disable automatic cache saves for merge queues (#1056)
Amp-Thread-ID:
https://ampcode.com/threads/T-01a0af68-f950-77dc-b9ae-9402987584c8

Closes: #1052

Co-authored-by: Amp <amp@ampcode.com>
2026-09-17 15:56:38 +02:00
github-actions[bot]
3377a30666 chore: update known checksums for 0.12.15 (#1054)
chore: update known checksums for 0.12.15

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-16 08:10:10 +02:00
github-actions[bot]
dfb5f38677 chore: update known checksums for 0.12.14 (#1053)
chore: update known checksums for 0.12.14

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-15 07:41:36 +02:00
github-actions[bot]
45c121f982 chore: update known checksums for 0.12.13 (#1045)
chore: update known checksums for 0.12.13

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-11 08:30:39 +02:00
github-actions[bot]
8073452fd4 docs: update version references to v10.1.0 (#1044)
Update `uses: astral-sh/setup-uv@...` references in documentation to
`bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0`.

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-10 21:27:24 +02:00
Kevin Stillhammer
bec219d24c chore(deps-dev): roll up Dependabot updates (#1043)
## Summary

- bump `@biomejs/biome` from 2.5.7 to 2.5.8 (#1042)
- bump `@types/node` from 26.1.2 to 26.2.0 (#1039)
- bump `esbuild` from 0.28.1 to 0.28.2 (#1040)
- update the Biome schema URL to 2.5.8

The TypeScript 7.0.2 update from #1029 is intentionally excluded:
`ts-jest` currently declares TypeScript `<7`, and the update causes all
unit suites to fail during ts-jest configuration.

## Validation

- `npm run all` (npm 11.10.0)

Refs: pi-session 01a08ca1-d3b3-7190-a02e-9a955e1b58b0
2026-09-10 21:10:42 +02:00
marcel
b90ec40d15 fix: respect no proxy directive (#1037)
Closes #1034
2026-09-10 20:40:43 +02:00
github-actions[bot]
421feb646d chore: update known checksums for 0.12.12 (#1041)
chore: update known checksums for 0.12.12

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-10 08:32:00 +02:00
William Woodruff
f634bf473a Expose a Python "identity" output (#1036)
https://github.com/pyca/cryptography/pull/15572#discussion_r3913508686
has the context for this: TL;DR our current `python-version` output
mirrors the "request" version exactly, which means that it's
insufficient for any downstream that needs to manage its own cache keys
(since caches shouldn't be shared across release candidates, but the `uv
python` request version doesn't include RC numbers).

The first commit here was my attempt to fix this by exposing the runtime
Python version, but this too is imprecise: the runtime version doesn't
indicate the interpreter variant (e.g. freethreading), which is also
important to capture in the cache identity.

My solution here is to expose `python-runtime-id`, which is just the
`key` of the active Python version from `uv python list
--output-format=json`.

---------

Signed-off-by: William Woodruff <william@yossarian.net>
2026-09-09 18:45:52 +02:00
github-actions[bot]
a6772c8f0a chore: update known checksums for 0.12.10/0.12.11 (#1038)
chore: update known checksums for 0.12.11

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-09 08:15:09 +02:00
github-actions[bot]
e105c8fb1d chore: update known checksums for 0.12.9 (#1035)
chore: update known checksums for 0.12.9

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-02 08:21:50 +02:00
zaniebot
cd13f92170 Verify downloads with astral-sh/versions checksums (#1033)
`setup-uv` currently ignores the `sha256` supplied by the default
`astral-sh/versions` manifest when a selected artifact is newer than its
bundled checksum table, allowing that download to proceed without
validation. Use the manifest checksum as a fallback after explicit and
bundled checksums, and reject manifest entries that do not provide one.
This preserves the stronger pinned hashes for known releases while
verifying newer releases without requiring an action update. Part of
#1032.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: William Woodruff <william@yossarian.net>
Co-authored-by: Kevin Stillhammer <kevin.stillhammer@gmail.com>
2026-09-01 17:07:32 +02:00
github-actions[bot]
3aef7b92c5 chore: update known checksums for 0.12.7/0.12.8 (#1031)
chore: update known checksums for 0.12.8

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-09-01 09:00:23 +02:00
github-actions[bot]
d08d816a1e chore: update known checksums for 0.12.6 (#1030)
chore: update known checksums for 0.12.6

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-08-26 08:35:28 +02:00
zaniebot
19b4d1e990 Harden npm install defaults (#1026)
CI already disables npm lifecycle scripts, but ordinary installs from
the repository still run them. Set `ignore-scripts = true` in `.npmrc`
so developer and maintenance installs use the same default. Keep the
existing seven-day `min-release-age` policy for new resolutions. Require
`npm>=11.10.0` through `engines.npm` and `engine-strict`, while
retaining `devEngines` for newer clients; older installers can otherwise
ignore `devEngines` and the age setting. Pin the build and checksum
workflows to Node.js `24.19.0` so their bundled `npm` supports the
policy. Explicit project commands such as `npm run package` remain
available.

Related: astral-sh/ruff-action#401 applies the matching `npm` defaults,
and astral-sh/ruff-action#411 adds the same legacy-aware version floor.
astral-sh/ruff#27837 applies the install-script default to Ruff's
JavaScript projects. astral-sh/setup-uv#1027 separately adds
registry-signature and provenance verification.

---------

Co-authored-by: zaniebot <242828183+zaniebot@users.noreply.github.com>
2026-08-20 17:38:03 +02:00
William Woodruff
7211c71869 Use JSON + a typed wrapper instead of TS codegen (#1025)
Signed-off-by: William Woodruff <william@yossarian.net>
2026-08-19 17:54:07 -04:00
github-actions[bot]
5ec49509d7 chore: update known checksums for 0.12.5 (#1020)
chore: update known checksums for 0.12.5

Co-authored-by: eifinger <1481961+eifinger@users.noreply.github.com>
2026-08-16 22:24:06 +02:00
William Woodruff
92a7c9ffa6 Use self-repo syntax for all in-repo actions/reusable workflows (#1024)
With the self-repo syntax, we also shouldn't need any of these
`actions/checkout` calls.

Signed-off-by: William Woodruff <william@yossarian.net>

---------

Signed-off-by: William Woodruff <william@yossarian.net>
2026-08-16 22:14:36 +02:00
William Woodruff
51a7fe0131 Pin one-shot tools (#1022)
This just adds some pins to the action tests; these tests don't rely on
the packages under test being unpinned.

---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-08-16 21:44:17 +02:00
William Woodruff
42bafdadf9 Add dependency cooldowns (#1021)
This does two things:

- Bumps our Dependabot-side cooldowns to 30d
- Adds an NPM-side 7d cooldown

The idea is to give automated cooldowns a longer period, whereas humans
doing maintenance/manual bumps can opt into a newer package as needed.

---

<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
2026-08-16 21:41:43 +02:00
Kevin Stillhammer
b555614122 ci: remove obsolete direct push attempts (#1019)
## Summary
- remove direct pushes to `main` from the docs update workflow
- remove the same dead push path from the known-checksums workflow
- create update pull requests directly when changes exist

Direct pushes cannot satisfy the repository rule requiring changes
through pull requests.

## Validation
- `npm ci --ignore-scripts`
- `npm run all`
- `actionlint .github/workflows/update-docs.yml
.github/workflows/update-known-checksums.yml`
- `uvx zizmor .github/workflows/update-docs.yml
.github/workflows/update-known-checksums.yml`

Refs: pi-session 019fff9d-7357-783c-8529-65bc5bf562c2
2026-08-14 11:40:50 +02:00
github-actions[bot]
a1e5847df3 docs: update version references to v10.0.1 (#1018)
Update `uses: astral-sh/setup-uv@...` references in documentation to
`20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1`.

Co-authored-by: eifinger <eifinger@users.noreply.github.com>
2026-08-14 11:10:35 +02:00
38 changed files with 7427 additions and 11527 deletions

1
.gitattributes vendored
View File

@@ -1,2 +1,3 @@
* text=auto eol=lf * text=auto eol=lf
dist/** -diff linguist-generated=true dist/** -diff linguist-generated=true
src/download/checksum/known-checksums.json linguist-generated=true

View File

@@ -8,6 +8,10 @@ self-hosted-runner:
# Empty array means no configuration variable is allowed. # Empty array means no configuration variable is allowed.
config-variables: null config-variables: null
paths: paths:
.github/workflows/**/*.{yml,yaml}:
ignore:
- 'specifying action "\$/" in invalid format because ref is missing'
- 'reusable workflow call "\$/.+" at "uses" is not following the format'
.github/workflows/test.yml: .github/workflows/test.yml:
ignore: ignore:
- 'invalid runner name.+' - 'invalid runner name.+'

View File

@@ -5,11 +5,11 @@ updates:
schedule: schedule:
interval: daily interval: daily
cooldown: cooldown:
default-days: 7 default-days: 30
- package-ecosystem: npm - package-ecosystem: npm
directory: / directory: /
schedule: schedule:
interval: daily interval: daily
cooldown: cooldown:
default-days: 7 default-days: 30

View File

@@ -47,7 +47,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
source-root: src source-root: src
@@ -59,7 +59,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7
# ℹ️ Command-line programs to run using the OS shell. # ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@@ -73,4 +73,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5595ccaf912efad79be6eef63a5619ff05969be3 # v4.37.6 uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7

View File

@@ -116,7 +116,7 @@ jobs:
name: Update docs name: Update docs
needs: needs:
- release - release
uses: ./.github/workflows/update-docs.yml uses: $/.github/workflows/update-docs.yml
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write

View File

@@ -56,7 +56,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
- run: uv sync - run: uv sync
working-directory: __tests__/fixtures/uv-project working-directory: __tests__/fixtures/uv-project
shell: bash shell: bash
@@ -81,7 +81,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install with UV_NO_MODIFY_PATH set - name: Install with UV_NO_MODIFY_PATH set
id: setup-uv id: setup-uv
uses: ./ uses: $/
env: env:
UV_NO_MODIFY_PATH: 1 UV_NO_MODIFY_PATH: 1
- run: | - run: |
@@ -130,7 +130,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install version ${{ matrix.input.version-input }} with strategy ${{ matrix.input.resolution-strategy || 'highest' }} - name: Install version ${{ matrix.input.version-input }} with strategy ${{ matrix.input.resolution-strategy || 'highest' }}
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
version: ${{ matrix.input.version-input }} version: ${{ matrix.input.version-input }}
resolution-strategy: ${{ matrix.input.resolution-strategy || 'highest' }} resolution-strategy: ${{ matrix.input.resolution-strategy || 'highest' }}
@@ -154,11 +154,8 @@ jobs:
matrix: matrix:
version-input: ["latest", ">=0.8"] version-input: ["latest", ">=0.8"]
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install version ${{ matrix.version-input }} - name: Install version ${{ matrix.version-input }}
uses: ./ uses: $/
with: with:
version: ${{ matrix.version-input }} version: ${{ matrix.version-input }}
- name: Latest version gets installed - name: Latest version gets installed
@@ -198,7 +195,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Install version from ${{ matrix.input.working-directory }} - name: Install version from ${{ matrix.input.working-directory }}
uses: ./ uses: $/
with: with:
working-directory: ${{ matrix.input.working-directory }} working-directory: ${{ matrix.input.working-directory }}
- name: Correct version gets installed - name: Correct version gets installed
@@ -224,7 +221,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Install version from ${{ matrix.input.version-file }} - name: Install version from ${{ matrix.input.version-file }}
uses: ./ uses: $/
with: with:
version-file: ${{ matrix.input.version-file }} version-file: ${{ matrix.input.version-file }}
- name: Correct version gets installed - name: Correct version gets installed
@@ -242,7 +239,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install versions from .tool-versions - name: Install versions from .tool-versions
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
version-file: "__tests__/fixtures/.tool-versions" version-file: "__tests__/fixtures/.tool-versions"
- name: Verify Python version from .tool-versions - name: Verify Python version from .tool-versions
@@ -267,7 +264,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install using malformed pyproject.toml - name: Install using malformed pyproject.toml
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
working-directory: "__tests__/fixtures/malformed-pyproject-toml-project" working-directory: "__tests__/fixtures/malformed-pyproject-toml-project"
- run: uv --help - run: uv --help
@@ -286,7 +283,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Checksum matches expected - name: Checksum matches expected
uses: ./ uses: $/
with: with:
version: "0.3.2" version: "0.3.2"
checksum: ${{ matrix.inputs.checksum }} checksum: ${{ matrix.inputs.checksum }}
@@ -300,7 +297,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Install default version - name: Install default version
uses: ./ uses: $/
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
- run: uv sync - run: uv sync
@@ -309,12 +306,9 @@ jobs:
test-uvx: test-uvx:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install default version - name: Install default version
uses: ./ uses: $/
- run: uvx ruff --version - run: uvx ruff@0.14.10 --version
test-tool-install: test-tool-install:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@@ -322,12 +316,9 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, macos-latest, macos-14, windows-latest] os: [ubuntu-latest, macos-latest, macos-14, windows-latest]
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install default version - name: Install default version
uses: ./ uses: $/
- run: uv tool install ruff - run: uv tool install ruff==0.14.10
- run: ruff --version - run: ruff --version
test-python-version: test-python-version:
@@ -341,7 +332,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
python-version: 3.13.1t python-version: 3.13.1t
- name: Verify UV_PYTHON is set to correct version - name: Verify UV_PYTHON is set to correct version
@@ -356,9 +347,14 @@ jobs:
if [ "$PYTHON_VERSION" != "3.13.1t" ]; then if [ "$PYTHON_VERSION" != "3.13.1t" ]; then
exit 1 exit 1
fi fi
if [ -n "$PYTHON_RUNTIME_ID" ]; then
echo "python-runtime-id should be empty without environment activation"
exit 1
fi
shell: bash shell: bash
env: env:
PYTHON_VERSION: ${{ steps.setup-uv.outputs.python-version }} PYTHON_VERSION: ${{ steps.setup-uv.outputs.python-version }}
PYTHON_RUNTIME_ID: ${{ steps.setup-uv.outputs.python-runtime-id }}
- run: uv sync - run: uv sync
working-directory: __tests__/fixtures/uv-project working-directory: __tests__/fixtures/uv-project
@@ -368,12 +364,9 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
python-version: 3.13.1t python-version: 3.13.1t
activate-environment: true activate-environment: true
@@ -407,12 +400,9 @@ jobs:
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
python-version: 3.13.1t python-version: 3.13.1t
activate-environment: true activate-environment: true
@@ -454,13 +444,19 @@ jobs:
raise SystemExit(f"Python is not running from custom venv: {sys.executable}") raise SystemExit(f"Python is not running from custom venv: {sys.executable}")
PY PY
shell: bash shell: bash
- name: Verify Python runtime ID from custom venv
run: |
case "$PYTHON_RUNTIME_ID" in
cpython-3.13.1+freethreaded-*) ;;
*) echo "Wrong Python runtime ID: $PYTHON_RUNTIME_ID"; exit 1 ;;
esac
shell: bash
env:
PYTHON_RUNTIME_ID: ${{ steps.setup-uv.outputs.python-runtime-id }}
test-activate-environment-no-project: test-activate-environment-no-project:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create incompatible pyproject.toml - name: Create incompatible pyproject.toml
run: | run: |
cat > pyproject.toml <<'EOF' cat > pyproject.toml <<'EOF'
@@ -476,7 +472,7 @@ jobs:
shell: bash shell: bash
- name: Install latest version with no-project - name: Install latest version with no-project
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
python-version: 3.13.1t python-version: 3.13.1t
activate-environment: true activate-environment: true
@@ -506,7 +502,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Install latest version - name: Install latest version
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
- run: uv sync - run: uv sync
@@ -521,7 +517,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
- name: Verify cache key contains alpine - name: Verify cache key contains alpine
@@ -555,12 +551,9 @@ jobs:
- os: windows-2025 - os: windows-2025
expected-os: "windows-2025" expected-os: "windows-2025"
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup uv - name: Setup uv
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
- name: Verify cache key contains OS version - name: Verify cache key contains OS version
@@ -585,7 +578,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: ${{ matrix.enable-cache }} enable-cache: ${{ matrix.enable-cache }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }} cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }}
@@ -605,7 +598,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: ${{ matrix.enable-cache }} enable-cache: ${{ matrix.enable-cache }}
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }} cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-${{ matrix.os }}-${{ matrix.enable-cache }}
@@ -638,7 +631,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt
@@ -655,7 +648,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-requirements-txt
@@ -678,7 +671,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
@@ -700,7 +693,7 @@ jobs:
echo 'dev-dependencies = []' >> __tests__/fixtures/uv-project/pyproject.toml echo 'dev-dependencies = []' >> __tests__/fixtures/uv-project/pyproject.toml
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
@@ -723,7 +716,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
save-cache: false save-cache: false
@@ -740,7 +733,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-false cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-save-cache-false
@@ -759,7 +752,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-restore-cache-false cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-setup-cache-restore-cache-false
@@ -775,7 +768,7 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
restore-cache: false restore-cache: false
@@ -798,11 +791,8 @@ jobs:
expected-cache-dir: "D:\\a\\_temp\\setup-uv-cache" expected-cache-dir: "D:\\a\\_temp\\setup-uv-cache"
runs-on: ${{ matrix.inputs.os }} runs-on: ${{ matrix.inputs.os }}
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-local cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-local
@@ -816,11 +806,8 @@ jobs:
test-cache-local-cache-disabled: test-cache-local-cache-disabled:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup without cache - name: Setup without cache
uses: ./ uses: $/
with: with:
enable-cache: false enable-cache: false
@@ -835,11 +822,8 @@ jobs:
test-cache-local-cache-disabled-but-explicit-path: test-cache-local-cache-disabled-but-explicit-path:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Setup without cache - name: Setup without cache
uses: ./ uses: $/
with: with:
enable-cache: false enable-cache: false
cache-local-path: /tmp/uv-cache-disabled cache-local-path: /tmp/uv-cache-disabled
@@ -861,7 +845,7 @@ jobs:
- name: Fake pyproject.toml at root - name: Fake pyproject.toml at root
run: cp __tests__/fixtures/old-python-constraint-project/pyproject.toml pyproject.toml run: cp __tests__/fixtures/old-python-constraint-project/pyproject.toml pyproject.toml
- name: Setup with cache - name: Setup with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
- run: uv sync - run: uv sync
@@ -874,7 +858,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Install from custom manifest file - name: Install from custom manifest file
uses: ./ uses: $/
with: with:
manifest-file: "https://raw.githubusercontent.com/astral-sh/setup-uv/${{ github.ref }}/__tests__/download/custom-manifest.ndjson" manifest-file: "https://raw.githubusercontent.com/astral-sh/setup-uv/${{ github.ref }}/__tests__/download/custom-manifest.ndjson"
- run: uv sync - run: uv sync
@@ -889,12 +873,9 @@ jobs:
test-download-from-astral-mirror-false: test-download-from-astral-mirror-false:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install with download-from-astral-mirror disabled - name: Install with download-from-astral-mirror disabled
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
download-from-astral-mirror: false download-from-astral-mirror: false
- name: Verify uv is installed - name: Verify uv is installed
@@ -903,14 +884,11 @@ jobs:
test-absolute-path: test-absolute-path:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Create requirements.txt - name: Create requirements.txt
run: echo "uv==0.6.17" > /tmp/setup-uv-requirements.txt run: echo "uv==0.6.17" > /tmp/setup-uv-requirements.txt
- name: Install from requirements file - name: Install from requirements file
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
version-file: "/tmp/setup-uv-requirements.txt" version-file: "/tmp/setup-uv-requirements.txt"
- name: Correct version gets installed - name: Correct version gets installed
@@ -923,16 +901,13 @@ jobs:
test-relative-path: test-relative-path:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: mkdir - name: mkdir
run: mkdir -p /tmp/setup-uv-test-relative-path run: mkdir -p /tmp/setup-uv-test-relative-path
- name: Create requirements.txt - name: Create requirements.txt
run: echo "uv==0.6.17" > /tmp/setup-uv-test-relative-path/setup-uv-requirements.txt run: echo "uv==0.6.17" > /tmp/setup-uv-test-relative-path/setup-uv-requirements.txt
- name: Install from requirements file - name: Install from requirements file
id: setup-uv id: setup-uv
uses: ./ uses: $/
with: with:
version-file: "./setup-uv-requirements.txt" version-file: "./setup-uv-requirements.txt"
working-directory: "/tmp/setup-uv-test-relative-path" working-directory: "/tmp/setup-uv-test-relative-path"
@@ -951,7 +926,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup uv - name: Setup uv
uses: ./ uses: $/
with: with:
cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-prune-force cache-suffix: ${{ github.run_id }}-${{ github.run_attempt }}-test-cache-prune-force
- name: Create long running python script - name: Create long running python script
@@ -974,7 +949,7 @@ jobs:
exit 1 exit 1
fi fi
- name: Setup uv - name: Setup uv
uses: ./ uses: $/
with: with:
working-directory: __tests__/fixtures/cache-dir-defined-project working-directory: __tests__/fixtures/cache-dir-defined-project
- run: uv sync - run: uv sync
@@ -995,7 +970,7 @@ jobs:
with: with:
persist-credentials: false persist-credentials: false
- name: Setup uv with cache and python cache enabled - name: Setup uv with cache and python cache enabled
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-python: true cache-python: true
@@ -1022,7 +997,7 @@ jobs:
exit 1 exit 1
fi fi
- name: Setup uv with cache - name: Setup uv with cache
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-python: true cache-python: true
@@ -1050,7 +1025,7 @@ jobs:
fi fi
- name: Restore with cache - name: Restore with cache
id: restore id: restore
uses: ./ uses: $/
with: with:
enable-cache: true enable-cache: true
cache-python: true cache-python: true
@@ -1081,12 +1056,9 @@ jobs:
expected-python-dir: "D:\\a\\_temp\\uv-python-dir" expected-python-dir: "D:\\a\\_temp\\uv-python-dir"
runs-on: ${{ matrix.inputs.os }} runs-on: ${{ matrix.inputs.os }}
steps: steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install latest version - name: Install latest version
id: setup-uv id: setup-uv
uses: ./ uses: $/
- name: Check Python dir is expected dir - name: Check Python dir is expected dir
run: | run: |
if [ "$UV_PYTHON_INSTALL_DIR" != "${{ matrix.inputs.expected-python-dir }}" ]; then if [ "$UV_PYTHON_INSTALL_DIR" != "${{ matrix.inputs.expected-python-dir }}" ]; then
@@ -1097,21 +1069,6 @@ jobs:
- name: Install python works - name: Install python works
run: uv python install run: uv python install
test-act:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install act
run: gh extension install https://github.com/nektos/gh-act
env:
GH_TOKEN: ${{ github.token }}
- name: Run test-uvx with act
run: gh act -j test-uvx -P ubuntu-latest=catthehacker/ubuntu:act-latest
env:
GH_TOKEN: ${{ github.token }}
test-workflow-run: test-workflow-run:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -1187,7 +1144,6 @@ jobs:
- test-cache-python-installs - test-cache-python-installs
- test-restore-python-installs - test-restore-python-installs
- test-python-install-dir - test-python-install-dir
- test-act
- test-workflow-run - test-workflow-run
- validate-typings - validate-typings
if: always() if: always()

View File

@@ -60,20 +60,8 @@ jobs:
else else
echo "changes-exist=false" >> "$GITHUB_OUTPUT" echo "changes-exist=false" >> "$GITHUB_OUTPUT"
fi fi
- name: Commit and push changes
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
id: commit-and-push
continue-on-error: true
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add .
git commit -m "docs: update version references to $NEW_VERSION"
git push origin HEAD:refs/heads/main
env:
NEW_VERSION: ${{ steps.tag-info.outputs.tag }}
- name: Create Pull Request - name: Create Pull Request
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }} if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with: with:
commit-message: "docs: update version references to ${{ steps.tag-info.outputs.tag }}" commit-message: "docs: update version references to ${{ steps.tag-info.outputs.tag }}"

View File

@@ -26,7 +26,7 @@ jobs:
id: update-known-checksums id: update-known-checksums
run: run:
node dist/update-known-checksums/index.cjs node dist/update-known-checksums/index.cjs
src/download/checksum/known-checksums.ts src/download/checksum/known-checksums.json
- name: Check for changes - name: Check for changes
id: changes-exist id: changes-exist
run: | run: |
@@ -39,21 +39,8 @@ jobs:
- name: Compile changes - name: Compile changes
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }} if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
run: npm ci --ignore-scripts && npm run all run: npm ci --ignore-scripts && npm run all
- name: Commit and push changes
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
id: commit-and-push
continue-on-error: true
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add .
git commit -m "chore: update known checksums for $LATEST_VERSION"
git push origin HEAD:refs/heads/main
env:
LATEST_VERSION: ${{ steps.update-known-checksums.outputs.latest-version }}
- name: Create Pull Request - name: Create Pull Request
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }} if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with: with:
commit-message: "chore: update known checksums" commit-message: "chore: update known checksums"

3
.npmrc Normal file
View File

@@ -0,0 +1,3 @@
engine-strict = true
ignore-scripts = true
min-release-age = 7

2
.nvmrc
View File

@@ -1 +1 @@
24 24.19.0

View File

@@ -26,7 +26,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
``` ```
If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version) If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)
@@ -42,7 +42,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
```yaml ```yaml
- name: Install uv with all available options - name: Install uv with all available options
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
# The version of uv to install, e.g., "0.5.0", "latest", or "latest-known" (default: searches for version in config files, then latest) # The version of uv to install, e.g., "0.5.0", "latest", or "latest-known" (default: searches for version in config files, then latest)
version: "" version: ""
@@ -90,8 +90,8 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
# Whether to restore the cache if found # Whether to restore the cache if found
restore-cache: "true" restore-cache: "true"
# Whether to save the cache after the run # Whether to save the cache after the run: true, false, or auto (disabled for merge_group events)
save-cache: "true" save-cache: "auto"
# Suffix for the cache key # Suffix for the cache key
cache-suffix: "" cache-suffix: ""
@@ -138,6 +138,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
- `cache-hit`: A boolean value to indicate a cache entry was found. - `cache-hit`: A boolean value to indicate a cache entry was found.
- `venv`: Path to the activated venv if activate-environment is true. - `venv`: Path to the activated venv if activate-environment is true.
- `python-version`: The Python version that was set. - `python-version`: The Python version that was set.
- `python-runtime-id`: An opaque identifier reported by uv for the activated venv's Python runtime. Empty when `activate-environment` is false.
- `python-cache-hit`: A boolean value to indicate the Python cache entry was found. - `python-cache-hit`: A boolean value to indicate the Python cache entry was found.
### Python version ### Python version
@@ -156,7 +157,7 @@ python 3.13
``` ```
```yaml ```yaml
- uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: ".tool-versions" version-file: ".tool-versions"
``` ```
@@ -167,7 +168,7 @@ a warning.
```yaml ```yaml
- name: Install the latest version of uv and set the python version to 3.13t - name: Install the latest version of uv and set the python version to 3.13t
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: 3.13t python-version: 3.13t
- run: uv pip install --python=3.13t pip - run: uv pip install --python=3.13t pip
@@ -185,7 +186,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install the latest version of uv and set the python version - name: Install the latest version of uv and set the python version
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Test with python ${{ matrix.python-version }} - name: Test with python ${{ matrix.python-version }}
@@ -202,7 +203,7 @@ It also controls where [the venv gets created](#activate-environment), unless `v
```yaml ```yaml
- name: Install uv based on the config files in the working-directory - name: Install uv based on the config files in the working-directory
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
working-directory: my/subproject/dir working-directory: my/subproject/dir
``` ```
@@ -244,7 +245,7 @@ For example:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Test - name: Test
@@ -256,7 +257,7 @@ To install a specific version of Python, use
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Install Python 3.12 - name: Install Python 3.12
@@ -275,7 +276,7 @@ output:
uses: actions/checkout@main uses: actions/checkout@main
- name: Install the default version of uv - name: Install the default version of uv
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
- name: Print the installed version - name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
``` ```

View File

@@ -26,9 +26,49 @@ test("provided checksum beats known checksums", async () => {
"x86_64", "x86_64",
"unknown-linux-gnu", "unknown-linux-gnu",
"0.3.0", "0.3.0",
"incorrect-manifest-checksum",
); );
}); });
test("known checksums beat manifest checksums", async () => {
await expect(
validateChecksum(
undefined,
filePath,
"x86_64",
"unknown-linux-gnu",
"0.3.0",
validChecksum,
),
).rejects.toThrow("did not match");
});
test("manifest checksums are used when no known checksum exists", async () => {
await expect(
validateChecksum(
undefined,
filePath,
"aarch64",
"pc-windows-msvc",
"1.2.3",
"incorrect-manifest-checksum",
),
).rejects.toThrow("did not match");
});
test("empty manifest checksums are rejected", async () => {
await expect(
validateChecksum(
undefined,
filePath,
"aarch64",
"pc-windows-msvc",
"1.2.3",
"",
),
).rejects.toThrow("No checksum found");
});
type KnownVersionFixture = { version: string; known: boolean }; type KnownVersionFixture = { version: string; known: boolean };
it.each<KnownVersionFixture>([ it.each<KnownVersionFixture>([

View File

@@ -0,0 +1,27 @@
import { promises as fs } from "node:fs";
import os from "node:os";
import path from "node:path";
import { expect, test } from "@jest/globals";
import { updateChecksums } from "../../../src/download/checksum/update-known-checksums";
test("serializes checksum entries as JSON data", async () => {
const tempDirectory = await fs.mkdtemp(
path.join(os.tmpdir(), "setup-uv-checksums-test-"),
);
const outputPath = path.join(tempDirectory, "known-checksums.json");
const key = 'platform-1.0.0"\n};\nglobalThis.compromised = true;';
const checksum = 'checksum"\\\nvalue';
try {
await updateChecksums(outputPath, [
{ checksum, key },
{ checksum: "duplicate", key },
]);
const content = await fs.readFile(outputPath, "utf8");
expect(JSON.parse(content)).toEqual({ [key]: checksum });
expect(content.endsWith("\n")).toBe(true);
} finally {
await fs.rm(tempDirectory, { force: true, recursive: true });
}
});

View File

@@ -227,10 +227,10 @@ describe("download-version", () => {
expect(mockValidateChecksum).not.toHaveBeenCalled(); expect(mockValidateChecksum).not.toHaveBeenCalled();
}); });
it("uses built-in checksums for default manifest downloads", async () => { it("uses the default manifest checksum as a fallback", async () => {
mockGetArtifact.mockResolvedValue({ mockGetArtifact.mockResolvedValue({
archiveFormat: "tar.gz", archiveFormat: "tar.gz",
checksum: "manifest-checksum-that-should-be-ignored", checksum: "manifest-checksum",
downloadUrl: "https://example.com/uv.tar.gz", downloadUrl: "https://example.com/uv.tar.gz",
}); });
@@ -248,6 +248,7 @@ describe("download-version", () => {
"x86_64", "x86_64",
"unknown-linux-gnu", "unknown-linux-gnu",
"0.9.26", "0.9.26",
"manifest-checksum",
); );
}); });
@@ -400,6 +401,7 @@ describe("download-version", () => {
"x86_64", "x86_64",
"unknown-linux-gnu", "unknown-linux-gnu",
"0.9.26", "0.9.26",
"manifest-checksum",
); );
}); });
@@ -425,6 +427,7 @@ describe("download-version", () => {
"x86_64", "x86_64",
"unknown-linux-gnu", "unknown-linux-gnu",
"0.9.26", "0.9.26",
"manifest-checksum",
); );
}); });

View File

@@ -206,6 +206,51 @@ describe("loadInputs", () => {
expect(inputs.enableCache).toBe(true); expect(inputs.enableCache).toBe(true);
}); });
it("restores but does not save cache automatically for merge groups", () => {
mockInputs["working-directory"] = "/workspace";
mockInputs["enable-cache"] = "auto";
mockInputs["restore-cache"] = "true";
mockInputs["save-cache"] = "auto";
process.env.RUNNER_ENVIRONMENT = "github-hosted";
process.env.RUNNER_TEMP = "/runner-temp";
process.env.GITHUB_EVENT_NAME = "merge_group";
const inputs = loadInputs();
expect(inputs.enableCache).toBe(true);
expect(inputs.restoreCache).toBe(true);
expect(inputs.saveCache).toBe(false);
expect(mockInfo).toHaveBeenCalledWith(
"Cache saving is disabled for the merge_group event",
);
});
it.each([
["true", true],
["false", false],
])("honors save-cache %s for merge groups", (saveCacheInput, expected) => {
mockInputs["working-directory"] = "/workspace";
mockInputs["save-cache"] = saveCacheInput;
process.env.GITHUB_EVENT_NAME = "merge_group";
const inputs = loadInputs();
expect(inputs.saveCache).toBe(expected);
expect(mockInfo).not.toHaveBeenCalledWith(
"Cache saving is disabled for the merge_group event",
);
});
it("automatically saves cache for other events", () => {
mockInputs["working-directory"] = "/workspace";
mockInputs["save-cache"] = "auto";
process.env.GITHUB_EVENT_NAME = "push";
const inputs = loadInputs();
expect(inputs.saveCache).toBe(true);
});
it("uses cache-dir from pyproject.toml when present", () => { it("uses cache-dir from pyproject.toml when present", () => {
mockInputs["working-directory"] = createTempProject({ mockInputs["working-directory"] = createTempProject({
"pyproject.toml": `[project] "pyproject.toml": `[project]

View File

@@ -0,0 +1,86 @@
import { promisify } from "node:util";
import { beforeEach, expect, it, jest } from "@jest/globals";
import { createSetupInputs } from "../helpers/setup-inputs";
const mockExecFile =
jest.fn<
(...args: unknown[]) => Promise<{ stdout: string; stderr: string }>
>();
const inputs = createSetupInputs({
activateEnvironment: true,
pythonVersion: "3.15t",
});
jest.unstable_mockModule("node:child_process", () => ({
// execFile's custom promisifier returns both stdout and stderr.
execFile: Object.assign(mockExecFile, { [promisify.custom]: mockExecFile }),
}));
const { getPythonRuntimeId } = await import("../../src/utils/python-runtime");
beforeEach(() => {
mockExecFile.mockReset();
mockExecFile.mockResolvedValue({
stderr: "",
stdout: '[{"key":"cpython-3.13.1-linux-x86_64-gnu"}]\r\n',
});
});
it("does not query uv without environment activation", async () => {
expect(
await getPythonRuntimeId({ ...inputs, activateEnvironment: false }),
).toBe("");
expect(mockExecFile).not.toHaveBeenCalled();
});
it.each([
"cpython-3.13.1-linux-x86_64-gnu",
"cpython-3.15.0rc1+freethreaded-macos-aarch64-none",
"cpython-3.15.0rc2+freethreaded-windows-x86_64-none",
"pypy-3.11.15-linux-x86_64-gnu",
])("returns uv's opaque runtime key unchanged: %s", async (key) => {
mockExecFile.mockResolvedValue({
stderr: "",
stdout: `${JSON.stringify([{ key }])}\r\n`,
});
expect(await getPythonRuntimeId(inputs)).toBe(key);
});
it.each(['/runner temp/a "quoted" venv', "C:\\runner temp\\custom venv"])(
"queries the exact venv directory: %s",
async (venvPath) => {
await getPythonRuntimeId({ ...inputs, venvPath });
expect(mockExecFile).toHaveBeenCalledWith(
"uv",
[
"python",
"list",
venvPath,
"--only-installed",
"--output-format",
"json",
],
{ encoding: "utf8" },
);
},
);
it.each([
new Error("uv failed"),
"not JSON",
"null",
"{}",
"[]",
'[{"key":""}]',
'[{"key":123}]',
'[{"key":"first"},{"key":"second"}]',
])("rejects uv failure or invalid results: %s", async (result) => {
if (result instanceof Error) {
mockExecFile.mockRejectedValue(result);
} else {
mockExecFile.mockResolvedValue({ stderr: "", stdout: result });
}
await expect(getPythonRuntimeId(inputs)).rejects.toThrow(
"Failed to identify the activated environment's Python runtime:",
);
});

View File

@@ -33,7 +33,11 @@ inputs:
restore-cache: restore-cache:
type: boolean type: boolean
save-cache: save-cache:
type: boolean type: enum
allowed-values:
- "true"
- "false"
- auto
cache-suffix: cache-suffix:
type: string type: string
cache-local-path: cache-local-path:
@@ -79,5 +83,7 @@ outputs:
type: string type: string
python-version: python-version:
type: string type: string
python-runtime-id:
type: string
python-cache-hit: python-cache-hit:
type: boolean type: boolean

View File

@@ -51,8 +51,8 @@ inputs:
description: "Whether to restore the cache if found." description: "Whether to restore the cache if found."
default: "true" default: "true"
save-cache: save-cache:
description: "Whether to save the cache after the run." description: "Whether to save the cache after the run. 'auto' disables saving for merge_group events."
default: "true" default: "auto"
cache-suffix: cache-suffix:
description: "Suffix for the cache key" description: "Suffix for the cache key"
required: false required: false
@@ -107,6 +107,8 @@ outputs:
description: "Path to the activated venv if activate-environment is true" description: "Path to the activated venv if activate-environment is true"
python-version: python-version:
description: "The Python version that was set." description: "The Python version that was set."
python-runtime-id:
description: "An opaque identifier reported by uv for the activated venv's Python runtime. Empty when activate-environment is false."
python-cache-hit: python-cache-hit:
description: "A boolean value to indicate the Python cache entry was found" description: "A boolean value to indicate the Python cache entry was found"
runs: runs:

View File

@@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json", "$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
"assist": { "assist": {
"actions": { "actions": {
"source": { "source": {

578
dist/save-cache/index.cjs generated vendored
View File

@@ -63908,57 +63908,111 @@ ${codeblock}`, options);
} }
}; };
// node_modules/smol-toml/dist/util.js
function indexOfNewline(str, start = 0) {
let idx = str.indexOf("\n", start);
if (str.charCodeAt(idx - 1) === 13)
idx--;
return idx;
}
function skipComment(ctx) {
for (; ctx.p < ctx.s.length; ctx.p++) {
let c = ctx.s.charCodeAt(ctx.p);
if (c === 10)
break;
if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
ctx.p++;
break;
}
if (c < 32 && c !== 9 || c === 127) {
throw new TomlError("control characters are not allowed in comments", {
toml: ctx.s,
ptr: ctx.p
});
}
}
}
function skipVoid(ctx, banNewLines, banComments) {
let c;
while (1) {
while ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
ctx.p++;
if (banComments || c !== 35)
break;
skipComment(ctx);
}
}
function skipUntil(ctx, sep8, end) {
let ptr = ctx.p;
if (!end) {
ptr = indexOfNewline(ctx.s, ptr);
ctx.p = ptr < 0 ? ctx.s.length : ptr;
return;
}
for (; ctx.p < ctx.s.length; ctx.p++) {
let c = ctx.s.charCodeAt(ctx.p);
if (c === 35) {
skipComment(ctx);
} else if (c === end || c === sep8) {
return;
}
}
throw new TomlError("cannot find end of structure", {
toml: ctx.s,
ptr
});
}
// node_modules/smol-toml/dist/primitive.js // node_modules/smol-toml/dist/primitive.js
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
var LEADING_ZERO = /^[+-]?0[0-9_]/; var LEADING_ZERO = /^[+-]?0[0-9_]/;
function parseString(str, ptr) { function parseString(ctx) {
let c = str[ptr++]; let start = ctx.p;
let c = ctx.s.charCodeAt(ctx.p++);
let first = c; let first = c;
let isLiteral = c === "'"; let isLiteral = c === 39;
let isMultiline = c === str[ptr] && c === str[ptr + 1]; let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);
if (isMultiline) { if (isMultiline) {
if (str[ptr += 2] === "\n") if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10)
ptr++; ctx.p++;
else if (str[ptr] === "\r" && str[ptr + 1] === "\n") else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
ptr += 2; ctx.p += 2;
} }
let parsed = ""; let parsed = "";
let sliceStart = ptr; let sliceStart = ctx.p;
let state3 = 0; let state3 = 0;
for (let i = ptr; i < str.length; i++) { for (; ctx.p < ctx.s.length; ctx.p++) {
c = str[i]; c = ctx.s.charCodeAt(ctx.p);
if (isMultiline && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
state3 = state3 && 3; state3 = state3 && 3;
} else if (c < " " && c !== " " || c === "\x7F") { } else if (c < 32 && c !== 9 || c === 127) {
throw new TomlError("control characters are not allowed in strings", { throw new TomlError("control characters are not allowed in strings", {
toml: str, toml: ctx.s,
ptr: i ptr: ctx.p
}); });
} else if ((!state3 || state3 === 3) && c === first && (!isMultiline || str[i + 1] === first && str[i + 2] === first)) { } else if ((!state3 || state3 === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
if (isMultiline) { if (isMultiline) {
if (str[i + 3] === first) if (ctx.s.charCodeAt(ctx.p + 3) === first)
i++; ctx.p++;
if (str[i + 3] === first) if (ctx.s.charCodeAt(ctx.p + 3) === first)
i++; ctx.p++;
} }
return [ if (!state3)
// If we're in a newline escape still, then there's nothing to add. parsed += ctx.s.slice(sliceStart, ctx.p);
// Also try to avoid concat if there's nothing to add to parsed, or nothing has been added to parsed. ctx.p += isMultiline ? 3 : 1;
state3 ? parsed : parsed + str.slice(sliceStart, i), return parsed;
i + (isMultiline ? 3 : 1)
];
} else if (!state3) { } else if (!state3) {
if (!isLiteral && c === "\\") { if (!isLiteral && c === 92) {
parsed += str.slice(sliceStart, sliceStart = i); parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
state3 = 1; state3 = 1;
} }
} else if (state3 === 1) { } else if (state3 === 1) {
if (c === "x" || c === "u" || c === "U") { if (c === 120 || c === 117 || c === 85) {
let value = 0; let value = 0;
let len = c === "x" ? 2 : c === "u" ? 4 : 8; let len = c === 120 ? 2 : c === 117 ? 4 : 8;
for (let j = 0; j < len; j++, i++) { for (let j = 0; j < len; j++, ctx.p++) {
let hex = str.charCodeAt(i + 1); let hex = ctx.s.charCodeAt(ctx.p + 1);
let digit = ( let digit = (
/* 0-9 */ /* 0-9 */
hex >= 48 && hex <= 57 ? hex - 48 : ( hex >= 48 && hex <= 57 ? hex - 48 : (
@@ -63970,57 +64024,68 @@ function parseString(str, ptr) {
) )
); );
if (digit < 0) if (digit < 0)
throw new TomlError("invalid non-hex character in unicode escape", { toml: str, ptr: i + 1 }); throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
value = value << 4 | digit; value = value << 4 | digit;
} }
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) { if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
throw new TomlError("invalid unicode escape", { toml: str, ptr: i }); throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
} }
parsed += String.fromCodePoint(value); parsed += String.fromCodePoint(value);
sliceStart = i + 1; sliceStart = ctx.p + 1;
state3 = 0; state3 = 0;
} else if (c === " " || c === " ") { } else if (c === 32 || c === 9) {
state3 = 2; state3 = 2;
} else { } else {
if (c === "b") if (c === 98)
parsed += "\b"; parsed += "\b";
else if (c === "t") else if (c === 116)
parsed += " "; parsed += " ";
else if (c === "n") else if (c === 110)
parsed += "\n"; parsed += "\n";
else if (c === "f") else if (c === 102)
parsed += "\f"; parsed += "\f";
else if (c === "r") else if (c === 114)
parsed += "\r"; parsed += "\r";
else if (c === "e") else if (c === 101)
parsed += "\x1B"; parsed += "\x1B";
else if (c === '"') else if (c === 34)
parsed += '"'; parsed += '"';
else if (c === "\\") else if (c === 92)
parsed += "\\"; parsed += "\\";
else else
throw new TomlError("unrecognized escape sequence", { toml: str, ptr: i }); throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
sliceStart = i + 1; sliceStart = ctx.p + 1;
state3 = 0; state3 = 0;
} }
} else if (c !== " " && c !== " ") { } else if (c !== 32 && c !== 9) {
if (state3 === 2) { if (state3 === 2) {
throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
toml: str, toml: ctx.s,
ptr: sliceStart ptr: sliceStart
}); });
} }
state3 = !isLiteral && c === "\\" ? 1 : 0; state3 = !isLiteral && c === 92 ? 1 : 0;
sliceStart = i; sliceStart = ctx.p;
} }
} }
throw new TomlError("unfinished string", { toml: str, ptr }); throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
} }
function parseValue2(value, toml, ptr, integersAsBigInt) { function sliceAndTrimEndOf(ctx, start, end) {
if (value === "true") let value = ctx.s.slice(start, end);
return true; let commentIdx = value.indexOf("#");
if (value === "false") if (commentIdx > 0) {
return false; skipComment({ s: value, p: commentIdx, d: 0 });
value = value.slice(0, commentIdx);
}
return value.trimEnd();
}
function parseValue2(ctx, integersAsBigInt, end) {
let ptr = ctx.p;
let err = { toml: ctx.s, ptr };
skipUntil(ctx, 44, end);
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
if (!value)
throw new TomlError("incomplete declaration: value expected", err);
if (value === "-inf") if (value === "-inf")
return -Infinity; return -Infinity;
if (value === "inf" || value === "+inf") if (value === "inf" || value === "+inf")
@@ -64032,25 +64097,16 @@ function parseValue2(value, toml, ptr, integersAsBigInt) {
let isInt = INT_REGEX.test(value); let isInt = INT_REGEX.test(value);
if (isInt || FLOAT_REGEX.test(value)) { if (isInt || FLOAT_REGEX.test(value)) {
if (LEADING_ZERO.test(value)) { if (LEADING_ZERO.test(value)) {
throw new TomlError("leading zeroes are not allowed", { throw new TomlError("leading zeroes are not allowed", err);
toml,
ptr
});
} }
value = value.replace(/_/g, ""); value = value.replace(/_/g, "");
let numeric2 = +value; let numeric2 = +value;
if (isNaN(numeric2)) { if (isNaN(numeric2)) {
throw new TomlError("invalid number", { throw new TomlError("invalid number", err);
toml,
ptr
});
} }
if (isInt) { if (isInt) {
if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) { if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) {
throw new TomlError("integer value cannot be represented losslessly", { throw new TomlError("integer value cannot be represented losslessly", err);
toml,
ptr
});
} }
if (isInt || integersAsBigInt === true) if (isInt || integersAsBigInt === true)
numeric2 = BigInt(value); numeric2 = BigInt(value);
@@ -64058,279 +64114,184 @@ function parseValue2(value, toml, ptr, integersAsBigInt) {
return numeric2; return numeric2;
} }
const date = new TomlDate(value); const date = new TomlDate(value);
if (!date.isValid()) { if (!date.isValid())
throw new TomlError("invalid value", { throw new TomlError("invalid value", err);
toml,
ptr
});
}
return date; return date;
} }
// node_modules/smol-toml/dist/util.js // node_modules/smol-toml/dist/extract.js
function indexOfNewline(str, start = 0, end = str.length) { function extractValue(ctx, end, integersAsBigInt) {
let idx = str.indexOf("\n", start); let ptr = ctx.p;
if (str[idx - 1] === "\r") let c = ctx.s.charCodeAt(ptr);
idx--; if (c === 91 || c === 123) {
return idx <= end ? idx : -1; if (!ctx.d--) {
} throw new TomlError("document contains excessively nested structures. aborting.", {
function skipComment(str, ptr) { toml: ctx.s,
for (let i = ptr; i < str.length; i++) {
let c = str[i];
if (c === "\n")
return i;
if (c === "\r" && str[i + 1] === "\n")
return i + 1;
if (c < " " && c !== " " || c === "\x7F") {
throw new TomlError("control characters are not allowed in comments", {
toml: str,
ptr ptr
}); });
} }
let value = c === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
ctx.d++;
return value;
} }
return str.length; if (c === 34 || c === 39) {
} return parseString(ctx);
function skipVoid(str, ptr, banNewLines, banComments) {
let c;
while (1) {
while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n"))
ptr++;
if (banComments || c !== "#")
break;
ptr = skipComment(str, ptr);
} }
return ptr; if (c === 116) {
} if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
function skipUntil(str, ptr, sep8, end, banNewLines = false) { throw new TomlError("invalid value", { toml: ctx.s, ptr });
if (!end) { ctx.p++;
ptr = indexOfNewline(str, ptr); return true;
return ptr < 0 ? str.length : ptr;
} }
for (let i = ptr; i < str.length; i++) { if (c === 102) {
let c = str[i]; if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
if (c === "#") { throw new TomlError("invalid value", { toml: ctx.s, ptr });
i = indexOfNewline(str, i); ctx.p++;
if (i < 0) return false;
break;
} else if (c === sep8) {
return i + 1;
} else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) {
return i;
}
} }
throw new TomlError("cannot find end of structure", { return parseValue2(ctx, integersAsBigInt, end);
toml: str,
ptr
});
}
// node_modules/smol-toml/dist/extract.js
function sliceAndTrimEndOf(str, startPtr, endPtr) {
let value = str.slice(startPtr, endPtr);
let commentIdx = value.indexOf("#");
if (commentIdx > -1) {
skipComment(str, commentIdx);
value = value.slice(0, commentIdx);
}
return [value.trimEnd(), commentIdx];
}
function extractValue(str, ptr, end, depth, integersAsBigInt) {
if (depth === 0) {
throw new TomlError("document contains excessively nested structures. aborting.", {
toml: str,
ptr
});
}
let c = str[ptr];
if (c === "[" || c === "{") {
let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
if (end) {
endPtr2 = skipVoid(str, endPtr2);
if (str[endPtr2] === ",")
endPtr2++;
else if (str[endPtr2] !== end) {
throw new TomlError("expected comma or end of structure", {
toml: str,
ptr: endPtr2
});
}
}
return [value, endPtr2];
}
if (c === '"' || c === "'") {
let [parsed, endPtr2] = parseString(str, ptr);
if (end) {
endPtr2 = skipVoid(str, endPtr2);
if (str[endPtr2] && str[endPtr2] !== "," && str[endPtr2] !== end && str[endPtr2] !== "\n" && str[endPtr2] !== "\r") {
throw new TomlError("unexpected character encountered", {
toml: str,
ptr: endPtr2
});
}
if (str[endPtr2] === ",")
endPtr2++;
}
return [parsed, endPtr2];
}
let endPtr = skipUntil(str, ptr, ",", end);
let slice = sliceAndTrimEndOf(str, ptr, endPtr - (str[endPtr - 1] === "," ? 1 : 0));
if (!slice[0]) {
throw new TomlError("incomplete key-value declaration: no value specified", {
toml: str,
ptr
});
}
if (end && slice[1] > -1) {
endPtr = skipVoid(str, ptr + slice[1]);
if (str[endPtr] === ",")
endPtr++;
}
return [
parseValue2(slice[0], str, ptr, integersAsBigInt),
endPtr
];
} }
// node_modules/smol-toml/dist/struct.js // node_modules/smol-toml/dist/struct.js
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
function parseKey(str, ptr, end = "=") { function parseKey(ctx, end = "=") {
let dot = ptr - 1; let start = ctx.p;
let dot = start - 1;
let parsed = []; let parsed = [];
let endPtr = str.indexOf(end, ptr); let endPtr = ctx.s.indexOf(end, start);
if (endPtr < 0) { if (endPtr < 0) {
throw new TomlError("incomplete key-value: cannot find end of key", { throw new TomlError("incomplete key-value: cannot find end of key", {
toml: str, toml: ctx.s,
ptr ptr: start
}); });
} }
do { do {
let c = str[ptr = ++dot]; let c = ctx.s.charCodeAt(ctx.p = ++dot);
if (c !== " " && c !== " ") { if (c !== 32 && c !== 9) {
if (c === '"' || c === "'") { if (c === 34 || c === 39) {
if (c === str[ptr + 1] && c === str[ptr + 2]) { if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {
throw new TomlError("multiline strings are not allowed in keys", { throw new TomlError("multiline strings are not allowed in keys", {
toml: str, toml: ctx.s,
ptr ptr: ctx.p
}); });
} }
let [part, eos] = parseString(str, ptr); let part = parseString(ctx);
dot = str.indexOf(".", eos); dot = ctx.s.indexOf(".", ctx.p);
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
let newLine = indexOfNewline(strEnd); let newLine = indexOfNewline(strEnd);
if (newLine > -1) { if (newLine > -1) {
throw new TomlError("newlines are not allowed in keys", { throw new TomlError("newlines are not allowed in keys", {
toml: str, toml: ctx.s,
ptr: ptr + dot + newLine ptr: newLine
}); });
} }
if (strEnd.trimStart()) { if (strEnd.trimStart()) {
throw new TomlError("found extra tokens after the string part", { throw new TomlError("found extra tokens after the string part", {
toml: str, toml: ctx.s,
ptr: eos ptr: ctx.p
}); });
} }
if (endPtr < eos) { if (endPtr < ctx.p) {
endPtr = str.indexOf(end, eos); endPtr = ctx.s.indexOf(end, ctx.p);
if (endPtr < 0) { if (endPtr < 0) {
throw new TomlError("incomplete key-value: cannot find end of key", { throw new TomlError("incomplete key-value: cannot find end of key", {
toml: str, toml: ctx.s,
ptr ptr: start
}); });
} }
} }
parsed.push(part); parsed.push(part);
} else { } else {
dot = str.indexOf(".", ptr); dot = ctx.s.indexOf(".", ctx.p);
let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
if (!KEY_PART_RE.test(part)) { if (!KEY_PART_RE.test(part)) {
throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
toml: str, toml: ctx.s,
ptr ptr: ctx.p
}); });
} }
parsed.push(part.trimEnd()); parsed.push(part.trimEnd());
} }
} }
} while (dot + 1 && dot < endPtr); } while (dot + 1 && dot < endPtr);
return [parsed, skipVoid(str, endPtr + 1, true, true)]; ctx.p = endPtr + 1;
skipVoid(ctx, true, true);
return parsed;
} }
function parseInlineTable(str, ptr, depth, integersAsBigInt) { function parseInlineTable(ctx, integersAsBigInt) {
let res = {}; let res = {};
let seen = /* @__PURE__ */ new Set(); let seen = /* @__PURE__ */ new Set();
let c; let c;
ptr++; ctx.p++;
while ((c = str[ptr++]) !== "}" && c) { while (ctx.p < ctx.s.length) {
if (c === ",") { skipVoid(ctx);
throw new TomlError("expected value, found comma", { if ((c = ctx.s.charCodeAt(ctx.p)) === 125) {
toml: str, ctx.p++;
ptr: ptr - 1 return res;
}); }
} else if (c === "#") let k;
ptr = skipComment(str, ptr); let t = res;
else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { let hasOwn = false;
let k; let p = ctx.p;
let t = res; let key = parseKey(ctx);
let hasOwn = false; for (let i = 0; i < key.length; i++) {
let [key, keyEndPtr] = parseKey(str, ptr - 1); if (i)
for (let i = 0; i < key.length; i++) { t = hasOwn ? t[k] : t[k] = {};
if (i) k = key[i];
t = hasOwn ? t[k] : t[k] = {}; if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
k = key[i];
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
throw new TomlError("trying to redefine an already defined value", {
toml: str,
ptr
});
}
if (!hasOwn && k === "__proto__") {
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
}
}
if (hasOwn) {
throw new TomlError("trying to redefine an already defined value", { throw new TomlError("trying to redefine an already defined value", {
toml: str, toml: ctx.s,
ptr ptr: p
}); });
} }
let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); if (!hasOwn && k === "__proto__") {
seen.add(value); Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
t[k] = value; }
ptr = valueEndPtr; }
if (hasOwn) {
throw new TomlError("trying to redefine an already defined value", {
toml: ctx.s,
ptr: ctx.p
});
}
let value = extractValue(ctx, 125, integersAsBigInt);
seen.add(t[k] = value);
skipVoid(ctx);
if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) {
return res;
}
if (c !== 44) {
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
} }
} }
if (!c) { throw new TomlError("unfinished table encountered", {
throw new TomlError("unfinished table encountered", { toml: ctx.s,
toml: str, ptr: ctx.p
ptr });
});
}
return [res, ptr];
} }
function parseArray(str, ptr, depth, integersAsBigInt) { function parseArray(ctx, integersAsBigInt) {
let res = []; let res = [];
let c; let c;
ptr++; ctx.p++;
while ((c = str[ptr++]) !== "]" && c) { while (ctx.p < ctx.s.length) {
if (c === ",") { skipVoid(ctx);
throw new TomlError("expected value, found comma", { if ((c = ctx.s.charCodeAt(ctx.p)) === 93) {
toml: str, ctx.p++;
ptr: ptr - 1 return res;
}); }
} else if (c === "#") res.push(extractValue(ctx, 93, integersAsBigInt));
ptr = skipComment(str, ptr); skipVoid(ctx);
else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) {
let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); return res;
res.push(e[0]); }
ptr = e[1]; if (c !== 44) {
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
} }
} }
if (!c) { throw new TomlError("unfinished array encountered", {
throw new TomlError("unfinished array encountered", { toml: ctx.s,
toml: str, ptr: ctx.p
ptr });
});
}
return [res, ptr];
} }
// node_modules/smol-toml/dist/parse.js // node_modules/smol-toml/dist/parse.js
@@ -64394,25 +64355,29 @@ function peekTable(key, table, meta, type) {
return [k, t, state3.c]; return [k, t, state3.c];
} }
function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
let ctx = { s: toml, p: 0, d: maxDepth };
let res = {}; let res = {};
let meta = {}; let meta = {};
let tmp;
let tbl = res; let tbl = res;
let m = meta; let m = meta;
for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { skipVoid(ctx);
if (toml[ptr] === "[") { while (ctx.p < toml.length) {
let isTableArray = toml[++ptr] === "["; if (toml.charCodeAt(ctx.p) === 91) {
let k = parseKey(toml, ptr += +isTableArray, "]"); let isTableArray = toml.charCodeAt(++ctx.p) === 91;
tmp = ctx.p += +isTableArray;
let k = parseKey(ctx, "]");
if (isTableArray) { if (isTableArray) {
if (toml[k[1] - 1] !== "]") { if (toml.charCodeAt(ctx.p - 1) !== 93) {
throw new TomlError("expected end of table declaration", { throw new TomlError("expected end of table declaration", {
toml, toml,
ptr: k[1] - 1 ptr: ctx.p - 1
}); });
} }
k[1]++; ctx.p++;
} }
let p = peekTable( let p = peekTable(
k[0], k,
res, res,
meta, meta,
isTableArray ? 2 : 1 isTableArray ? 2 : 1
@@ -64421,16 +64386,16 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
if (!p) { if (!p) {
throw new TomlError("trying to redefine an already defined table or value", { throw new TomlError("trying to redefine an already defined table or value", {
toml, toml,
ptr ptr: tmp
}); });
} }
m = p[2]; m = p[2];
tbl = p[1]; tbl = p[1];
ptr = k[1];
} else { } else {
let k = parseKey(toml, ptr); tmp = ctx.p;
let k = parseKey(ctx);
let p = peekTable( let p = peekTable(
k[0], k,
tbl, tbl,
m, m,
0 0
@@ -64439,21 +64404,19 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
if (!p) { if (!p) {
throw new TomlError("trying to redefine an already defined table or value", { throw new TomlError("trying to redefine an already defined table or value", {
toml, toml,
ptr ptr: tmp
}); });
} }
let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); p[1][p[0]] = extractValue(ctx, void 0, integersAsBigInt);
p[1][p[0]] = v[0];
ptr = v[1];
} }
ptr = skipVoid(toml, ptr, true); skipVoid(ctx, true);
if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
throw new TomlError("each key-value declaration must be followed by an end-of-line", { throw new TomlError("each key-value declaration must be followed by an end-of-line", {
toml, toml,
ptr ptr: ctx.p
}); });
} }
ptr = skipVoid(toml, ptr); skipVoid(ctx);
} }
return res; return res;
} }
@@ -64490,7 +64453,7 @@ function loadInputs() {
const checksum = getInput("checksum"); const checksum = getInput("checksum");
const enableCache = getEnableCache(); const enableCache = getEnableCache();
const restoreCache2 = getInput("restore-cache") === "true"; const restoreCache2 = getInput("restore-cache") === "true";
const saveCache4 = getInput("save-cache") === "true"; const saveCache4 = getSaveCache();
const cacheSuffix = getInput("cache-suffix") || ""; const cacheSuffix = getInput("cache-suffix") || "";
const cacheLocalPath = getCacheLocalPath( const cacheLocalPath = getCacheLocalPath(
workingDirectory, workingDirectory,
@@ -64600,6 +64563,17 @@ function getEnableCache() {
} }
return enableCacheInput === "true"; return enableCacheInput === "true";
} }
function getSaveCache() {
const saveCacheInput = getInput("save-cache");
if (saveCacheInput === "auto") {
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
info2("Cache saving is disabled for the merge_group event");
return false;
}
return true;
}
return saveCacheInput === "true";
}
function getToolBinDir(workingDirectory) { function getToolBinDir(workingDirectory) {
const toolBinDirInput = getInput("tool-bin-dir"); const toolBinDirInput = getInput("tool-bin-dir");
if (toolBinDirInput !== "") { if (toolBinDirInput !== "") {
@@ -64899,8 +64873,8 @@ undici/lib/web/websocket/frame.js:
smol-toml/dist/date.js: smol-toml/dist/date.js:
smol-toml/dist/error.js: smol-toml/dist/error.js:
smol-toml/dist/primitive.js:
smol-toml/dist/util.js: smol-toml/dist/util.js:
smol-toml/dist/primitive.js:
smol-toml/dist/extract.js: smol-toml/dist/extract.js:
smol-toml/dist/struct.js: smol-toml/dist/struct.js:
smol-toml/dist/parse.js: smol-toml/dist/parse.js:

988
dist/setup/index.cjs generated vendored

File diff suppressed because it is too large Load Diff

339
dist/update-known-checksums/index.cjs generated vendored
View File

@@ -8542,7 +8542,7 @@ var require_proxy_agent = __commonJS({
return this.#client.destroy(err); return this.#client.destroy(err);
} }
}; };
var ProxyAgent3 = class extends DispatcherBase { var ProxyAgent2 = class extends DispatcherBase {
constructor(opts) { constructor(opts) {
super(); super();
if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) { if (!opts || typeof opts === "object" && !(opts instanceof URL2) && !opts.uri) {
@@ -8683,7 +8683,7 @@ var require_proxy_agent = __commonJS({
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
} }
} }
module2.exports = ProxyAgent3; module2.exports = ProxyAgent2;
} }
}); });
@@ -8693,14 +8693,14 @@ var require_env_http_proxy_agent = __commonJS({
"use strict"; "use strict";
var DispatcherBase = require_dispatcher_base(); var DispatcherBase = require_dispatcher_base();
var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols(); var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols();
var ProxyAgent3 = require_proxy_agent(); var ProxyAgent2 = require_proxy_agent();
var Agent = require_agent(); var Agent = require_agent();
var DEFAULT_PORTS = { var DEFAULT_PORTS = {
"http:": 80, "http:": 80,
"https:": 443 "https:": 443
}; };
var experimentalWarned = false; var experimentalWarned = false;
var EnvHttpProxyAgent = class extends DispatcherBase { var EnvHttpProxyAgent2 = class extends DispatcherBase {
#noProxyValue = null; #noProxyValue = null;
#noProxyEntries = null; #noProxyEntries = null;
#opts = null; #opts = null;
@@ -8717,13 +8717,13 @@ var require_env_http_proxy_agent = __commonJS({
this[kNoProxyAgent] = new Agent(agentOpts); this[kNoProxyAgent] = new Agent(agentOpts);
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
if (HTTP_PROXY) { if (HTTP_PROXY) {
this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY }); this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY });
} else { } else {
this[kHttpProxyAgent] = this[kNoProxyAgent]; this[kHttpProxyAgent] = this[kNoProxyAgent];
} }
const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
if (HTTPS_PROXY) { if (HTTPS_PROXY) {
this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY }); this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY });
} else { } else {
this[kHttpsProxyAgent] = this[kHttpProxyAgent]; this[kHttpsProxyAgent] = this[kHttpProxyAgent];
} }
@@ -8819,7 +8819,7 @@ var require_env_http_proxy_agent = __commonJS({
return process.env.no_proxy ?? process.env.NO_PROXY ?? ""; return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
} }
}; };
module2.exports = EnvHttpProxyAgent; module2.exports = EnvHttpProxyAgent2;
} }
}); });
@@ -18454,8 +18454,8 @@ var require_undici = __commonJS({
var Pool = require_pool(); var Pool = require_pool();
var BalancedPool = require_balanced_pool(); var BalancedPool = require_balanced_pool();
var Agent = require_agent(); var Agent = require_agent();
var ProxyAgent3 = require_proxy_agent(); var ProxyAgent2 = require_proxy_agent();
var EnvHttpProxyAgent = require_env_http_proxy_agent(); var EnvHttpProxyAgent2 = require_env_http_proxy_agent();
var RetryAgent = require_retry_agent(); var RetryAgent = require_retry_agent();
var errors = require_errors(); var errors = require_errors();
var util = require_util(); var util = require_util();
@@ -18477,8 +18477,8 @@ var require_undici = __commonJS({
module2.exports.Pool = Pool; module2.exports.Pool = Pool;
module2.exports.BalancedPool = BalancedPool; module2.exports.BalancedPool = BalancedPool;
module2.exports.Agent = Agent; module2.exports.Agent = Agent;
module2.exports.ProxyAgent = ProxyAgent3; module2.exports.ProxyAgent = ProxyAgent2;
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent2;
module2.exports.RetryAgent = RetryAgent; module2.exports.RetryAgent = RetryAgent;
module2.exports.RetryHandler = RetryHandler; module2.exports.RetryHandler = RetryHandler;
module2.exports.DecoratorHandler = DecoratorHandler; module2.exports.DecoratorHandler = DecoratorHandler;
@@ -31050,7 +31050,7 @@ var require_proxy_agent2 = __commonJS({
return this.#client.destroy(err); return this.#client.destroy(err);
} }
}; };
var ProxyAgent3 = class extends DispatcherBase { var ProxyAgent2 = class extends DispatcherBase {
constructor(opts) { constructor(opts) {
if (!opts || typeof opts === "object" && !(opts instanceof URL) && !opts.uri) { if (!opts || typeof opts === "object" && !(opts instanceof URL) && !opts.uri) {
throw new InvalidArgumentError("Proxy uri is mandatory"); throw new InvalidArgumentError("Proxy uri is mandatory");
@@ -31249,7 +31249,7 @@ var require_proxy_agent2 = __commonJS({
function throwProxyAuthError() { function throwProxyAuthError() {
throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor"); throw new InvalidArgumentError("Proxy-Authorization should be sent in ProxyAgent constructor");
} }
module2.exports = ProxyAgent3; module2.exports = ProxyAgent2;
} }
}); });
@@ -31259,13 +31259,13 @@ var require_env_http_proxy_agent2 = __commonJS({
"use strict"; "use strict";
var DispatcherBase = require_dispatcher_base2(); var DispatcherBase = require_dispatcher_base2();
var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols6(); var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols6();
var ProxyAgent3 = require_proxy_agent2(); var ProxyAgent2 = require_proxy_agent2();
var Agent = require_agent2(); var Agent = require_agent2();
var DEFAULT_PORTS = { var DEFAULT_PORTS = {
"http:": 80, "http:": 80,
"https:": 443 "https:": 443
}; };
var EnvHttpProxyAgent = class extends DispatcherBase { var EnvHttpProxyAgent2 = class extends DispatcherBase {
#noProxyValue = null; #noProxyValue = null;
#noProxyEntries = null; #noProxyEntries = null;
#opts = null; #opts = null;
@@ -31276,13 +31276,13 @@ var require_env_http_proxy_agent2 = __commonJS({
this[kNoProxyAgent] = new Agent(agentOpts); this[kNoProxyAgent] = new Agent(agentOpts);
const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY; const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
if (HTTP_PROXY) { if (HTTP_PROXY) {
this[kHttpProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTP_PROXY }); this[kHttpProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTP_PROXY });
} else { } else {
this[kHttpProxyAgent] = this[kNoProxyAgent]; this[kHttpProxyAgent] = this[kNoProxyAgent];
} }
const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY; const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY;
if (HTTPS_PROXY) { if (HTTPS_PROXY) {
this[kHttpsProxyAgent] = new ProxyAgent3({ ...agentOpts, uri: HTTPS_PROXY }); this[kHttpsProxyAgent] = new ProxyAgent2({ ...agentOpts, uri: HTTPS_PROXY });
} else { } else {
this[kHttpsProxyAgent] = this[kHttpProxyAgent]; this[kHttpsProxyAgent] = this[kHttpProxyAgent];
} }
@@ -31383,7 +31383,7 @@ var require_env_http_proxy_agent2 = __commonJS({
return process.env.no_proxy ?? process.env.NO_PROXY ?? ""; return process.env.no_proxy ?? process.env.NO_PROXY ?? "";
} }
}; };
module2.exports = EnvHttpProxyAgent; module2.exports = EnvHttpProxyAgent2;
} }
}); });
@@ -46513,9 +46513,9 @@ var require_undici2 = __commonJS({
var RoundRobinPool = require_round_robin_pool(); var RoundRobinPool = require_round_robin_pool();
var Agent = require_agent2(); var Agent = require_agent2();
var Dispatcher1Wrapper = require_dispatcher1_wrapper(); var Dispatcher1Wrapper = require_dispatcher1_wrapper();
var ProxyAgent3 = require_proxy_agent2(); var ProxyAgent2 = require_proxy_agent2();
var Socks5ProxyAgent = require_socks5_proxy_agent(); var Socks5ProxyAgent = require_socks5_proxy_agent();
var EnvHttpProxyAgent = require_env_http_proxy_agent2(); var EnvHttpProxyAgent2 = require_env_http_proxy_agent2();
var RetryAgent = require_retry_agent2(); var RetryAgent = require_retry_agent2();
var H2CClient = require_h2c_client(); var H2CClient = require_h2c_client();
var errors = require_errors2(); var errors = require_errors2();
@@ -46541,9 +46541,9 @@ var require_undici2 = __commonJS({
module2.exports.RoundRobinPool = RoundRobinPool; module2.exports.RoundRobinPool = RoundRobinPool;
module2.exports.Agent = Agent; module2.exports.Agent = Agent;
module2.exports.Dispatcher1Wrapper = Dispatcher1Wrapper; module2.exports.Dispatcher1Wrapper = Dispatcher1Wrapper;
module2.exports.ProxyAgent = ProxyAgent3; module2.exports.ProxyAgent = ProxyAgent2;
module2.exports.Socks5ProxyAgent = Socks5ProxyAgent; module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent; module2.exports.EnvHttpProxyAgent = EnvHttpProxyAgent2;
module2.exports.RetryAgent = RetryAgent; module2.exports.RetryAgent = RetryAgent;
module2.exports.H2CClient = H2CClient; module2.exports.H2CClient = H2CClient;
module2.exports.RetryHandler = RetryHandler; module2.exports.RetryHandler = RetryHandler;
@@ -47180,8 +47180,278 @@ var semver2 = __toESM(require_semver(), 1);
// src/download/checksum/known-version.ts // src/download/checksum/known-version.ts
var semver = __toESM(require_semver(), 1); var semver = __toESM(require_semver(), 1);
// src/download/checksum/known-checksums.ts // src/download/checksum/known-checksums.json
var KNOWN_CHECKSUMS = { var known_checksums_default = {
"aarch64-apple-darwin-0.12.19": "a9a8df1eedeb192f2e47e40e2faabfb387db4b850209118786d42f89dde3e0ba",
"aarch64-pc-windows-msvc-0.12.19": "115b54cb823bc48260670f5782001add6067ac8d98d18c8263a833704e287de9",
"aarch64-unknown-linux-gnu-0.12.19": "0804e9b164c64b6914182d5920c08551958a095986f10a3731056df701126436",
"aarch64-unknown-linux-musl-0.12.19": "ad8d8448a2ff642ba62c2f684d7dd22a03f8eb3fc9918c2c3e8ec975f4ed6710",
"arm-unknown-linux-musleabihf-0.12.19": "173b6b118e444dc3b3a0b6337dd87d66fa79835aa5e059d79e942ae33a850e20",
"armv7-unknown-linux-gnueabihf-0.12.19": "f47fe74244c4adcff20637c1aee2550dbc31c81ccf0b2a9537bf98b24bc4028a",
"armv7-unknown-linux-musleabihf-0.12.19": "0df353aac087509c47fe660837ca5d284858ef4a5eec4042cbcdeb0118ba0f1b",
"i686-pc-windows-msvc-0.12.19": "e1c2d19d1173a0e9f81ba3f95881ad741808133e372610889ff6870629218c7f",
"i686-unknown-linux-gnu-0.12.19": "952b0bae707e19b2b5d012b46519a2159be929273d466a1437759f0961be0b93",
"i686-unknown-linux-musl-0.12.19": "f923ac32e0e5139950fe1b63abab74d48cabb94b15c90637bc380dadcaf4da40",
"powerpc64le-unknown-linux-gnu-0.12.19": "e30649ad846a14bd96440efd45fdb60dcdf8db088fb143064aa78632048ad957",
"riscv64gc-unknown-linux-gnu-0.12.19": "50a83ea999ea861a6a853ae1ad0982baad96cc6451e46a5d7e366c4d9475f1bb",
"riscv64gc-unknown-linux-musl-0.12.19": "051de9eda7e09dab4c8a304ab2e119317649fee0e24efd0358f410d0c5b3407f",
"s390x-unknown-linux-gnu-0.12.19": "e6a9149ea122c1b3b9719ca3577c321376e3c400e004c3cc18231fdb1d35107b",
"x86_64-apple-darwin-0.12.19": "cb5fa57bafe68fc0fb94b17f06bee0b0b9a7feb94ccbd110445afa0696e39273",
"x86_64-pc-windows-msvc-0.12.19": "6dbb02d79e419522f1c500f0adb1cddcff0cda7d59b0d66ea7f5e3b4a1b2f5f0",
"x86_64-unknown-linux-gnu-0.12.19": "23bf5552d220e0842b65c862097b2ebaeba0064b74eda5e565e77fd25969d8c8",
"x86_64-unknown-linux-musl-0.12.19": "db7278c9f57981338fddff1fb250e11964bc0a4fafcb9eed8303fdb117dc067b",
"aarch64-apple-darwin-0.12.18": "cf40e0c6a202190ccd9e0406dcfdd5b2d6668a9a5c779b17948963df32aafe5b",
"aarch64-pc-windows-msvc-0.12.18": "17f27b1c64eacc757ae603579f116a014881e486c5e79ae81877980d4699e943",
"aarch64-unknown-linux-gnu-0.12.18": "afb6291f3f0a6b4521fc67b947822506c41dde5b60d2189dd8f3695b2ac8c9e7",
"aarch64-unknown-linux-musl-0.12.18": "0796973fb3eea8095078c3d0659bd17a5f6789a71b8dd85caff2483178f78ac3",
"arm-unknown-linux-musleabihf-0.12.18": "a37127fb331d5e6228efc1f8549d2447b50c907eee4629347f150a649083619c",
"armv7-unknown-linux-gnueabihf-0.12.18": "a38e82350e1e95d5526d1ab81d9b4eb676815c51646243b3b3fbc55b218732d1",
"armv7-unknown-linux-musleabihf-0.12.18": "41f0808328f65910bacdb487638475715f949900c7a23b393b3754e2156ff15a",
"i686-pc-windows-msvc-0.12.18": "e04c0f1fd9a8703761f9edd64d797ddb2c9a3e6eec0e2fed234a7bd2c2e868b9",
"i686-unknown-linux-gnu-0.12.18": "278dbc5dfc6bdde33a553fdba53174cc49daf512a857db1b3c1b5d663290196f",
"i686-unknown-linux-musl-0.12.18": "ebfdaaafc447fb2a7329cde879a7748b2ab40ecdcd3d5f04fc0a5d1ab79bb0bd",
"powerpc64le-unknown-linux-gnu-0.12.18": "332d174248230ed599a9df0e4e77d6921dbb42ca0fdfbe26eb2a6c999da936b3",
"riscv64gc-unknown-linux-gnu-0.12.18": "be88652a03225acbd6bf7204d006b244b0743c8c756a35137c209fa4ff731c41",
"riscv64gc-unknown-linux-musl-0.12.18": "29d34dcc833b99b09f78fa11c66fa3c490c3e37c4f0d754e7b84f7147850190e",
"s390x-unknown-linux-gnu-0.12.18": "ac412f7ab2a096a7302e0ae8828c7ef84db8a1f7ff97acba8ff8987d46d39cec",
"x86_64-apple-darwin-0.12.18": "2e4108f5395397c8bc5d43bf83d3bdbb2d0e92b90d0efa607756be704905fa33",
"x86_64-pc-windows-msvc-0.12.18": "cae6a3bc25239f83dffb467a4b180508d9da23986c04639ebfa44e43e6a84bff",
"x86_64-unknown-linux-gnu-0.12.18": "89eadd7c76fc063887959510d5ba0ab1264dfd5f1143b925ddb73021a40acf16",
"x86_64-unknown-linux-musl-0.12.18": "e38d97460b98ebfd31b197de0fe9fa578add4bc8ba0179b203dd3f87b99f98e6",
"aarch64-apple-darwin-0.12.17": "85f00cbdc6dd3e97eba4c31b4d014375a9fdfe8f570023b84e5102fc3456896b",
"aarch64-pc-windows-msvc-0.12.17": "3e1aa6849d77f0e00dc865e4afab5c5b32de053e21fe35bf5ad5cec3734ec976",
"aarch64-unknown-linux-gnu-0.12.17": "d636d1b678e9e7f367ecb22b46bd1cabbed234d6bc3b4d96365d2b507f72f86c",
"aarch64-unknown-linux-musl-0.12.17": "a6096da273d548cb9f277d237a01ac7344a39ef0f455c0e148e4dc9737c1596b",
"arm-unknown-linux-musleabihf-0.12.17": "16a98a65ef8545f7c32cf717683aac44248369ffaa41c43e665341489359c654",
"armv7-unknown-linux-gnueabihf-0.12.17": "796e101976e18a0f92d90b6f3efd289f77fbc5afd1aaa6fdedd3c84c209eabab",
"armv7-unknown-linux-musleabihf-0.12.17": "421c5f9c53d49088e705e7a64fea147082a2191178ea1d8c51d9ad758ca899f6",
"i686-pc-windows-msvc-0.12.17": "1d3653cb6eafd1e675e979d7cd8eeac1456202f8927a2216419993077a4c473f",
"i686-unknown-linux-gnu-0.12.17": "3faa79a70e2a1aa6eb3cd78eba02263f3e4b17b6be584a01429968f92ff74966",
"i686-unknown-linux-musl-0.12.17": "fc05220cfa1c6585e0e209877c228393b25a96e17cd43028b06566ac894cd078",
"powerpc64le-unknown-linux-gnu-0.12.17": "eb6dbedaaa622af32cba2388e0d2d47e34c8724d4214a129d614b96f071d8e53",
"riscv64gc-unknown-linux-gnu-0.12.17": "65b807b24357133c49d97ca9394ee7e13ca62822e1095376c809654b35f39cf2",
"riscv64gc-unknown-linux-musl-0.12.17": "87c339a735b578f285b961bebdefe0a671f3652477d1e84dc69cd1a829f45e92",
"s390x-unknown-linux-gnu-0.12.17": "d99f69f47fc5e0975d6e7a5745cf2332317015caffb3bb81e5154cc7b66fa77a",
"x86_64-apple-darwin-0.12.17": "8dcf05a8c809bb3c471d2b614788ba27a6e41298fc8c31ac84b5f4339fd468e5",
"x86_64-pc-windows-msvc-0.12.17": "a252121d5b59398fcb137c6ea448176459a44010f33f67e0072305a637119ca7",
"x86_64-unknown-linux-gnu-0.12.17": "fa82fd8dde8e8eefdecada6aa0889666556cfceb690d06e0c3bca49eb3070a63",
"x86_64-unknown-linux-musl-0.12.17": "6401c4665d8fa2a9893e087c91f585430738e3170f5398a1141483efb4a93310",
"aarch64-apple-darwin-0.12.16": "b6e03fae61704b1aa622f12b792a69483e837b83068e44f4fd34f8a07a8f74a3",
"aarch64-pc-windows-msvc-0.12.16": "9977129f89c4036edfcb200d2484755571e51fa74517f02e478c1d7bcc353b2e",
"aarch64-unknown-linux-gnu-0.12.16": "36d913ee9c647481d64f1a0a0485f85ff2feaee605c341fc22e73398f9212c26",
"aarch64-unknown-linux-musl-0.12.16": "5beba1f35c0922fd086cce850ce919e55bc4e873c4fcda891343526afdb4c5b3",
"arm-unknown-linux-musleabihf-0.12.16": "d91fa9dede60e851e4bb3ae8060300042bc6bf924476fae71898d2c08c46a9cf",
"armv7-unknown-linux-gnueabihf-0.12.16": "fbdfca5d4ace4a5abbf343c0f10a0b68c5eac0201073d2a504e32c57c0873669",
"armv7-unknown-linux-musleabihf-0.12.16": "f5a3b6c7fbd4c7ea66cbd704d821ffed0d20abbfa8a12c2e68d6dd22476d308b",
"i686-pc-windows-msvc-0.12.16": "0d4889cc6c4058f4fbc28f6c50ec09b528ef998547cac5c3425e1a0b8169e847",
"i686-unknown-linux-gnu-0.12.16": "0e8743e653ed124c526a9e86ee6a08fa6eee7618a3f12cc9033c74674bd2047f",
"i686-unknown-linux-musl-0.12.16": "f609686cbe67884eeb57daebd58eb0fef35f930dd92fd2c14e931da7515c7454",
"powerpc64le-unknown-linux-gnu-0.12.16": "312dc82f441debff371fe5fc0068b538787678d6d79edc86f028b011920a2f6a",
"riscv64gc-unknown-linux-gnu-0.12.16": "8b0142eee9d291c602218126e3fc558fe9bc1b7c8f1cc0b03dcd8df9f2f218a1",
"riscv64gc-unknown-linux-musl-0.12.16": "188af30f025c35569b302b84793a4c286f6740902885d054917375edbfd0193c",
"s390x-unknown-linux-gnu-0.12.16": "b90cc954c2cd52b695104e215189a0c8d9e6ceaee753c9be1a871bb8d969e9c3",
"x86_64-apple-darwin-0.12.16": "a42bcc9ce97eb8b364d7f162233a9c6b8c0ee25388e551d362809795127e0c31",
"x86_64-pc-windows-msvc-0.12.16": "f730454bf09019754e5e5abd71a8aa18683cb739cba0d9c720bac2e7c901160f",
"x86_64-unknown-linux-gnu-0.12.16": "8e5c6e5523dffc2dcf615bd995554c84c9feb4e577808a3fb8698a639d3f8d9c",
"x86_64-unknown-linux-musl-0.12.16": "a01206ffbd60f3a7ee30949be1863527986f5307494a064042c69ce7e6d44799",
"aarch64-apple-darwin-0.12.15": "dc304b9ed1b24174572290fba60ac3f6fe63c73a671f0439e62a91375841964d",
"aarch64-pc-windows-msvc-0.12.15": "a37c8e96cb1260488c8510b64c848533a3a82a2fdf9e905de7c2700ceebf6437",
"aarch64-unknown-linux-gnu-0.12.15": "0e9a3499b0587d449c9ff684c0160da607826e4af1cee220bc87f378702d3e08",
"aarch64-unknown-linux-musl-0.12.15": "93b801abb146e6431fb0434346a0162e65d3f0d1cd7360144d04c43488fd7f7d",
"arm-unknown-linux-musleabihf-0.12.15": "9b0204dbd368a7a5f84d3ef015684c3b0e830911641ebf4575f44ad4901c1b3e",
"armv7-unknown-linux-gnueabihf-0.12.15": "a0afe9cfc7dc4acc18e613f68c5b010b849323b3a3d6e9311b29d289dc94f95e",
"armv7-unknown-linux-musleabihf-0.12.15": "a113c782e6f96a56f73aba601cde73ddbe877e0a4179eabeb5b6e86be9bb75d9",
"i686-pc-windows-msvc-0.12.15": "cc8b28f77cf19f7ed88569d6d9163e503ebc94e1b70069889852bcf38839c559",
"i686-unknown-linux-gnu-0.12.15": "6fa19118f01ee547d5b9a3f4af389c5c929a34e0074a4313d3cdb3ce9c97fdcd",
"i686-unknown-linux-musl-0.12.15": "b66d6cf7916addeda13fbb61abe003ecc62f048e3a213d6bd2494ca7e8022989",
"powerpc64le-unknown-linux-gnu-0.12.15": "5f49c97ae7ec25c45513466e00a32cacb148f3824367c7e498c0b53a270bc1e2",
"riscv64gc-unknown-linux-gnu-0.12.15": "4c8f75c5969737b67621957010df5337bb721a8d48fdbb1620f5d35c3f1dd268",
"riscv64gc-unknown-linux-musl-0.12.15": "8c03514f57e517eb87a376deb3d6475045f6ce550956c6082910b4a529d08a47",
"s390x-unknown-linux-gnu-0.12.15": "1f5701cb5eedc5a34d3dd5896ca3bf509b15d382b3448f370df46e0a631889c1",
"x86_64-apple-darwin-0.12.15": "e9ca61775532368fe518ab03e7a354c7ecab8ccb3c7d941c775fcc4a362b801b",
"x86_64-pc-windows-msvc-0.12.15": "477bd99a84e34891f2bd4c9152ddeb74e971accccbc59c0f0301f11f08a32d46",
"x86_64-unknown-linux-gnu-0.12.15": "f97935763c04be3e692460a7aaeaaab8fc3b78fcf8b389da820b38ae7423a638",
"x86_64-unknown-linux-musl-0.12.15": "999c0c3da986953e508985c3932d283d2c62eb167b4f8d81e79f565e34104959",
"aarch64-apple-darwin-0.12.14": "dfed5683c5873d65eff8476eb93526059b81e5646a68305b5c94a26b29990894",
"aarch64-pc-windows-msvc-0.12.14": "46b930bdbb338099c7d9da711b751240eb97876eda6a553a2c28323967232041",
"aarch64-unknown-linux-gnu-0.12.14": "7fb91bd5d10529c60723eaec3caf44726f89280e5aeed78af8fc63fcad004c9b",
"aarch64-unknown-linux-musl-0.12.14": "571b5c73c9bcc294f8087f22613edb7c7ceb191f4dbf8cafd3f2ff15e6147d36",
"arm-unknown-linux-musleabihf-0.12.14": "6e0df0e690d5c29ce65ec6962d8b262a93e9951077f05d78943f858e7d6e9185",
"armv7-unknown-linux-gnueabihf-0.12.14": "c20a18bb275a6fc2599bc321d37e52650a449237c6111da203a1d73b45921b25",
"armv7-unknown-linux-musleabihf-0.12.14": "a128725e1e40226a9309d603cbb4c36e272932092a77f4d0478ef2fb8eacaa05",
"i686-pc-windows-msvc-0.12.14": "ddd9afd789c60a38d82f3021239e22daacc67b9ef0719345ee6f0dcc37ab93ae",
"i686-unknown-linux-gnu-0.12.14": "de65ccdb90dd818248161db761ae3b6713b1b3230a1b55068ad327598b3a14b8",
"i686-unknown-linux-musl-0.12.14": "268538a3b90c90f7d68d31ed781f0f2cb8618188019c8bb09ce0e7876bb54829",
"powerpc64le-unknown-linux-gnu-0.12.14": "6a6c2a91d6240700eb36895c3fb0533bd5e9c696a95e0a55f7a7ae844cbde537",
"riscv64gc-unknown-linux-gnu-0.12.14": "df2c854c77b1d32f75ef08282511b050066b3db9d7abc4dc2c23ea26227c6b74",
"riscv64gc-unknown-linux-musl-0.12.14": "c6d0824ebdf23811dfa659148ae2c224b385d07ae1b4c282e5bf6abe3d603a74",
"s390x-unknown-linux-gnu-0.12.14": "e01aec9706c88f93f90409eab42324571e2b2c9c2938aaa266ad048b37c52c6f",
"x86_64-apple-darwin-0.12.14": "e11a70264ceca38e929ecaeed953c323e517af7b960ebf9722d5918e8c7f0375",
"x86_64-pc-windows-msvc-0.12.14": "02cecb254f37f3396da625680796d3990164a590fb5611d46f719ad83e7b9a89",
"x86_64-unknown-linux-gnu-0.12.14": "18ef5c3888ae59828cb13f38d57e9389b8173ecc719eff163bfafc74b38f5936",
"x86_64-unknown-linux-musl-0.12.14": "df163630683e5a2106d3320e2a448fde8eda5e7b9b47f617c5c332769728e735",
"aarch64-apple-darwin-0.12.13": "7e6ddb9316acc00f2296c82ff4d99977870ee34b2f0ddcae9444d714db9364ed",
"aarch64-pc-windows-msvc-0.12.13": "1efb2654b06e7063d4ac1fc9d49a9bda9a6704d82f035b589a2751a592f14151",
"aarch64-unknown-linux-gnu-0.12.13": "2eaa5d94f5db7b3a1a092156b9420459e42ab0217d917fe74a876309cef9b5e9",
"aarch64-unknown-linux-musl-0.12.13": "f44bc1037a17889fe562fffd2002d4ed108e499fbe68b4f022af244dc7b8244f",
"arm-unknown-linux-musleabihf-0.12.13": "2c7644f891edcf1e74a1b9dde96ea4ba00b41301c936c87e843683656703ada2",
"armv7-unknown-linux-gnueabihf-0.12.13": "19252c4d21fce112817b9e07bef6b2e9c90cef80fe82659533105b37a772d067",
"armv7-unknown-linux-musleabihf-0.12.13": "54e2c10e4e6c18a3efbac645ea02d7e6b768ae2f975275595915a7039e802b75",
"i686-pc-windows-msvc-0.12.13": "4ddcdf859d3bd337a156a2fc567e685e4b3d61e07b4a2dbbed7aeb4325e116ac",
"i686-unknown-linux-gnu-0.12.13": "beb56f6eda61bc69a8acc1bca07929365aa5cd2e912e35c35003a45e266d8a0e",
"i686-unknown-linux-musl-0.12.13": "6c93a9703b6145266240cb2aeb31d3574c21b33570fddf92461707b906eb3a65",
"powerpc64le-unknown-linux-gnu-0.12.13": "cd45ac73fc711e717602a4dc0c9e19d9c6563d15b14515a9a5dd49b00172a8b6",
"riscv64gc-unknown-linux-gnu-0.12.13": "ff1fb4d7e4c1d3a4acc6eff69b2530e846964260469df345e0239059517c0a21",
"riscv64gc-unknown-linux-musl-0.12.13": "b88312b410c1183e33ae9fa7738f35b7cd7396b2aa0e82836d7e88dbf23e5fb5",
"s390x-unknown-linux-gnu-0.12.13": "d41e4784c2187c76970690a9e9a288231f5ec8d2160ad8464be74aa9c06717e8",
"x86_64-apple-darwin-0.12.13": "5e287ef61cb6a9b61b3a83fef124fd143e400468a7dac794230147a810e17119",
"x86_64-pc-windows-msvc-0.12.13": "a86c9dc7bad9b03f388583b7187c05fe9951c2e0d392217e8fd43d97787f6ec2",
"x86_64-unknown-linux-gnu-0.12.13": "745765a3b6e360ad76743599ae5c42e9278c7edf8bbff9fc76d05bf2623a04dd",
"x86_64-unknown-linux-musl-0.12.13": "4e2bfd0c9007b1032a50e539e965fd0a6037d87ad93ae1580d220a92d4c94098",
"aarch64-apple-darwin-0.12.12": "46740540b63fdee9a6cb2e19baf3f1f475b850c440a33e63455087a6871263f1",
"aarch64-pc-windows-msvc-0.12.12": "36559da51ecee83b2b1d80aa1a0ede2f80e2d9e5761fffcbb9e9366a7f3d022a",
"aarch64-unknown-linux-gnu-0.12.12": "fe08db50cc1b56cd1da7801065ed1103d27ed3f9571cd122386cfc7faf1b8df5",
"aarch64-unknown-linux-musl-0.12.12": "82e59fff633cbd96fb675f37c7a748c056d909a59ecf476f8ff0e5bee76b9b23",
"arm-unknown-linux-musleabihf-0.12.12": "72ac215cb44636c62de5a672c9ff822acd1ffd90b96f751c359902c8de11c75b",
"armv7-unknown-linux-gnueabihf-0.12.12": "ed00794f3750bcf405556ac28e8aff0480a4e309e4ab1505df9f96b83088b230",
"armv7-unknown-linux-musleabihf-0.12.12": "74220d4b9df5507f527478313f17190cdff1078532efb8547483804372f77f47",
"i686-pc-windows-msvc-0.12.12": "5d6ea94bc2fdbcd39710e0bac00db2a771aae05d09a34387841187958af48362",
"i686-unknown-linux-gnu-0.12.12": "ce4411f863d3bd0cf97699eecebce9331ae72d69cf57735806321bf60b637b03",
"i686-unknown-linux-musl-0.12.12": "b0a733aa67b9ea4d5dd28c1ae2c8393ce1be4b032c3d51642d6b05190f21fb6a",
"powerpc64le-unknown-linux-gnu-0.12.12": "b5d05f6cb74605da9bb371ee9f8128bb8611ba1fab324bd4abc6e70a83abe0c7",
"riscv64gc-unknown-linux-gnu-0.12.12": "7b0b054d9a7d7b2c32e9ca111b271091240c81cb41487bcbe65992a2baca9c97",
"riscv64gc-unknown-linux-musl-0.12.12": "d2324e24ad526bbc45ac8a40f4d846c315efef9d4c91bb25725f29ccf2382b8a",
"s390x-unknown-linux-gnu-0.12.12": "53135d16813f9ad961c809828da06f2339d49510c110668fe2e0353fef46b213",
"x86_64-apple-darwin-0.12.12": "0dc8cd6c961582b0d140b5398f96b23502885277fb3464241456a2435e460dfa",
"x86_64-pc-windows-msvc-0.12.12": "3d54912924c36e862c14f427d04f2ed70a99e8001d1c30caa101f6d5711626d5",
"x86_64-unknown-linux-gnu-0.12.12": "ab9b309d4586403f024e100abaceb396616e178a553e2500c36087d180f09509",
"x86_64-unknown-linux-musl-0.12.12": "0b0bbd7144f91d9b694e29c920fca3a060322bd134e8507e5eb92049a3e2edf0",
"aarch64-apple-darwin-0.12.11": "e01b69ee15e81918d5e8fc9cf39b3db7f59c5576e5e306cd9b7aeb2c7b7321c3",
"aarch64-pc-windows-msvc-0.12.11": "7a70f46305d28a95f913ef2888254a9f9c183a406daeeb8937134afc9ed434d2",
"aarch64-unknown-linux-gnu-0.12.11": "e9933d907fb9cd27d606d819bbded419f2844c0e2efc98225ecfa409288eb28d",
"aarch64-unknown-linux-musl-0.12.11": "de99cafdeb5ee6f61ac3acd6d9dc6a1ef166f9398fa5623c436246ee1ecea099",
"arm-unknown-linux-musleabihf-0.12.11": "dd8576a7194e69861cd9def865f3a26613bb116109f075e64925a38cdd509429",
"armv7-unknown-linux-gnueabihf-0.12.11": "8975dd185f9e34f93733fdcd7ae7ae552ecd7d3bd5792ff06ab3dc104f50e327",
"armv7-unknown-linux-musleabihf-0.12.11": "b1cb2600a61c8d780a7ef365f69f4a336e4657494e13b9a757b4d10bb55d65af",
"i686-pc-windows-msvc-0.12.11": "c5fb5da8a9578ccaf9dadd3622413c347661847ededb4a93d9d3dbf9304a9ea4",
"i686-unknown-linux-gnu-0.12.11": "ab2d67fa9d3cfbdfa616b6e91eda4ae0d159dca09b446226935458f9cd28bd3e",
"i686-unknown-linux-musl-0.12.11": "bc894f6f1c6aa2caef10caa3890948c2fec5159c678bae432c5aab88c2a71961",
"powerpc64le-unknown-linux-gnu-0.12.11": "7d7fccdd92328b3732bffc1ded64d430f8bd7a59dc575e4804256f907f10c957",
"riscv64gc-unknown-linux-gnu-0.12.11": "279a560bb492e92275ab96b1b601fc2a2feec84499d8b67160e07001496602b7",
"riscv64gc-unknown-linux-musl-0.12.11": "f24d2434251e9a9ea4b1dec014e28299a936fc387087ae953677c389b21f09f5",
"s390x-unknown-linux-gnu-0.12.11": "ac48ff502ee64983b904bcbe73559409f9a0ca950c788cd4ea77db510258f233",
"x86_64-apple-darwin-0.12.11": "96d773bf5fda4f9b08c4444847f9183d1c14bc8a28ff9c0490e261a8fc6e5309",
"x86_64-pc-windows-msvc-0.12.11": "e94225dea91e051472847bd6d146d7d66c4f54ffcd1f106678866a99580845f9",
"x86_64-unknown-linux-gnu-0.12.11": "4ae93e0f148a18434cc094072547cec88912fc4a72b984183c7d0d0e9586cb5e",
"x86_64-unknown-linux-musl-0.12.11": "3343303ad6b4f9537ae0abfb36f1926a90c0445ba8f23d0e0a840a66a124cffd",
"aarch64-apple-darwin-0.12.10": "51c6170e8e3a01cef9f33b94f582b7b81ac65046f55d40afb35f9cff5a68c179",
"aarch64-pc-windows-msvc-0.12.10": "ee985c51c0c9c1f82267a5d80f959b34a7ff888c109182bd3b2b35c4661bbcde",
"aarch64-unknown-linux-gnu-0.12.10": "9ff6b9d4665edcdd3a88dcc73cd1eb641754deb927f14e8c62ebfde6bf4f5f5e",
"aarch64-unknown-linux-musl-0.12.10": "3983cb642fae84eab33756109bb266f126eb61763d8d220dd662af589c5b3da5",
"arm-unknown-linux-musleabihf-0.12.10": "984d3539667b2d97d85aa07788f78f3aa87accc9b27c63913c3177d118f5df81",
"armv7-unknown-linux-gnueabihf-0.12.10": "682a52fea5deb07238420d7197e2d7cc10d558872f008a9b6799fb5326c8e420",
"armv7-unknown-linux-musleabihf-0.12.10": "4062b9eb018afdde9b3dfeceabe41aad4cc5ea7fe658b74fda0e8f36decef507",
"i686-pc-windows-msvc-0.12.10": "cbf375fe6bf8a4e9ffb2f09c1ff4f8ed29ba96594a604749f84fa4e08c9a4586",
"i686-unknown-linux-gnu-0.12.10": "d943d0c0af37ad884bef24972753f7c93e5765b458e6492a3eb0c2b855c83a58",
"i686-unknown-linux-musl-0.12.10": "9ab3d4ae061abcb8b000d7b472236f09998ddd466215753fc2eb4cdf372ba147",
"powerpc64le-unknown-linux-gnu-0.12.10": "2e6beb653888d2d2721b46d3d8aa328a2339a6cc20d4df98bbf206e728a92174",
"riscv64gc-unknown-linux-gnu-0.12.10": "38071e8f894acb0629a6f72017489e23642c1acee82953e3060635dd251cba8e",
"riscv64gc-unknown-linux-musl-0.12.10": "268ac2854b3c56370d68e94d819f5a3ee2dd7dfe81b17135d080a3648276d3b7",
"s390x-unknown-linux-gnu-0.12.10": "2192d8fb1d72860e8c0a85ccb074dcd4de0369c9fbd52a9041e16d5ba3f4467f",
"x86_64-apple-darwin-0.12.10": "5296d5aa2b9143360405eea866f8ef4d5dc8986b164eb0dc35e8f876a9304d30",
"x86_64-pc-windows-msvc-0.12.10": "f65744f94072152b1f86ba2aace4d01f1124d9a8ecb235805039e3718c36cac2",
"x86_64-unknown-linux-gnu-0.12.10": "173d95a0c32d18c896c46ba6fafbf3cf9c14ab74b033f81b76c883ef492a976b",
"x86_64-unknown-linux-musl-0.12.10": "848d0e261119e5b8f35db10164635e46a48bec29ceb1f8ec14a6fc76004973ee",
"aarch64-apple-darwin-0.12.9": "301f72afaf54060f92da7016cb0115bd077f43a9c8e39c1d8170a0bac80fd398",
"aarch64-pc-windows-msvc-0.12.9": "d3360363a3cb671f2c854f4ef48cf4a57fe8664f8ec6a248076d68b797a8acc0",
"aarch64-unknown-linux-gnu-0.12.9": "c36fe17937ff6bd16dc42fc13854b5465999fcab2efe0af559381e945e3c6001",
"aarch64-unknown-linux-musl-0.12.9": "7eb9bf48516448c9db6a9e436d8e747ac9c8a9cac74717160a29918249b080a6",
"arm-unknown-linux-musleabihf-0.12.9": "de6f5b904a6735bca2a6061bbc3a3a09718128b806e11981e37019e32292288b",
"armv7-unknown-linux-gnueabihf-0.12.9": "ac24ad959c4dee04c6cf42597a947828f661fda184db5fe82b3e72a07d391316",
"armv7-unknown-linux-musleabihf-0.12.9": "8c33bdfedafc27d73ca4850071383336671b9ce92a36cf53300fff799d8580b3",
"i686-pc-windows-msvc-0.12.9": "62396154da2dc04a9fffb027e75ae3d971ca3ac7d3f0ffa7dd2c27c94798ce3f",
"i686-unknown-linux-gnu-0.12.9": "c3669a2adfd83a9220b1da1ec8f2ef3624eca1ba1db3c45107b455694e9ef6dd",
"i686-unknown-linux-musl-0.12.9": "3c2a21d4dcb08cae133bb4ebd5cf40764bc5f076829fc2eab00df0a50d834eb9",
"powerpc64le-unknown-linux-gnu-0.12.9": "3da749e1a1d6e290811736aecdb13184e4732a07afe0e4162e9163f843f0315d",
"riscv64gc-unknown-linux-gnu-0.12.9": "7fd415b73bd19045e027d099209bb3fc4a59c36ee6d825caf40db2b8e2f3bd0d",
"riscv64gc-unknown-linux-musl-0.12.9": "3d6b761164444e1fe12be08f771583ed495354bcbd73631c65a62ae443d6a06a",
"s390x-unknown-linux-gnu-0.12.9": "d45e862e2001fa8a88e68cf8be91231a14143cdd1ac8351d8d8e4fdf44fbac1e",
"x86_64-apple-darwin-0.12.9": "e1ca175824f1056589ce9908f7631879ebc3c36535b5e63dc06510beb370b4c1",
"x86_64-pc-windows-msvc-0.12.9": "ddbfcee1ac615a0499f6aa97b5ec8ebdf3ee4a7714a48055ec2ba0030e3cf810",
"x86_64-unknown-linux-gnu-0.12.9": "ec7a99cd05e0cd7f80243f135ce1361c76835cb0ee60055d14d20eba8eba1460",
"x86_64-unknown-linux-musl-0.12.9": "aa4b1f8770910f7c7c543c7acc980e4270e52e70750c996acef813ea1c7c2912",
"aarch64-apple-darwin-0.12.8": "8ce083658dbff20143607ca7af8e0c1d64b6fd7bf03a5cdcb62bf3d47d991b5f",
"aarch64-pc-windows-msvc-0.12.8": "84b821c551802c200a32e25f9d1d960ef15e248f54f6a1bd9e1eb62934669da8",
"aarch64-unknown-linux-gnu-0.12.8": "ba8661f4fd207c8e94814191598e619b355ac10d5014e851e21eb800f9ef2b00",
"aarch64-unknown-linux-musl-0.12.8": "975917badc8370163989e5bbe5a7c69bf922d19f8e57cb2652531bbffc935f84",
"arm-unknown-linux-musleabihf-0.12.8": "0e0e733a33e229602c14a5c7af271917ef4b13b8bc50fd774d32bd4b18a09a3b",
"armv7-unknown-linux-gnueabihf-0.12.8": "bc80826f631f8836a974a88b8cf797935bc83f15552828ad5de0195f6246e333",
"armv7-unknown-linux-musleabihf-0.12.8": "794b2099dd9db9c359958fa8fcd0407bf3bc2682e020d40b8d20e046f3490a18",
"i686-pc-windows-msvc-0.12.8": "9b38cad9b06e0a910e606510cdb4ad2c4eb4f320c4f4c4ba90dd13ed1115c5b0",
"i686-unknown-linux-gnu-0.12.8": "739cfea6b2958da57106e6ff1b0f95ecb17522ce84fc8e07c8606b2f427a4e39",
"i686-unknown-linux-musl-0.12.8": "83d712e60c019b58015834804ffe4c9a4cdb7dc90c305be8c7e04bf14194158f",
"powerpc64le-unknown-linux-gnu-0.12.8": "5a39773f28a172d4ab62598306db2010c0e3bf3b278b2684afde86794af8ad71",
"riscv64gc-unknown-linux-gnu-0.12.8": "fd1905fbc62d5fff73994a48cf90149717541a6e30d097aef17626cbc5f8b734",
"riscv64gc-unknown-linux-musl-0.12.8": "1078863595c13c655f847111bd812468e7e6e0cb6b83c1cc6fd4bfc9337030cf",
"s390x-unknown-linux-gnu-0.12.8": "3a3b1fe41dea61afe6af2b8b59529ef2c4712d28dbb942a5e338fc9ff7578384",
"x86_64-apple-darwin-0.12.8": "bfcd4407de99e0a2c1904df0902fa1795653d4edd145358e6561527e746a4f16",
"x86_64-pc-windows-msvc-0.12.8": "e07acf3f8a29fe41f9e04b799c3325cb0e0893836bb222bf102829b45c679ad6",
"x86_64-unknown-linux-gnu-0.12.8": "2e2b37e9811e17675a9e70bed5e1a58fc8c0388be63d751d72cc735188c149ff",
"x86_64-unknown-linux-musl-0.12.8": "6ca4597639c97e921fb915e113061ce8e4a14ead9e42a1ead521dbb0a6763795",
"aarch64-apple-darwin-0.12.7": "127ebdda7ad953cdf198e964b570ea5771b85467ea93eb7cb6d6f8e6f55408f3",
"aarch64-pc-windows-msvc-0.12.7": "1611d0f4be72b0a354ad9a6ae954093dd4c91e93e36b8b490326a05a039ffe14",
"aarch64-unknown-linux-gnu-0.12.7": "66393193038dd7eb108abd7a218d9cec04ac70ab98242b0720fa94de19223b7c",
"aarch64-unknown-linux-musl-0.12.7": "6dcf60e3c085de88ace3671b949ca99f0652be561ff5627f0d21394140f041db",
"arm-unknown-linux-musleabihf-0.12.7": "7716bce33408494d7b46395504b9fc1ea3ea93b7d0e4b77ef15ca7d7e1ae245a",
"armv7-unknown-linux-gnueabihf-0.12.7": "e5b9a25ff397f593e9fff236c4d72ada28aff7da4540868dbca74f391a86d546",
"armv7-unknown-linux-musleabihf-0.12.7": "4b82298033bf6d20ee7c585a5da1448d681945f29b0dae5e73b72f83496f0e61",
"i686-pc-windows-msvc-0.12.7": "b4842ca13ae8ac33879341170eea32df1d9c41d0468a524e73375facddefb4b1",
"i686-unknown-linux-gnu-0.12.7": "edc692ff9b0dc2833b1490a420fac9bdc4c85257b383aff7467cb23a7c1ec16a",
"i686-unknown-linux-musl-0.12.7": "a1cccfea5d8063fd44ef0154691066f0c7607f04236a51360c113e29da3b3fca",
"powerpc64le-unknown-linux-gnu-0.12.7": "cf3d2cb9f156de68e827bed822ce85952c331d739abc0a214bc75f378ef81cb4",
"riscv64gc-unknown-linux-gnu-0.12.7": "0218ed3ecbd7c56e7811b46dce30319cf727f6fbf989080c5eeac1976216f22f",
"riscv64gc-unknown-linux-musl-0.12.7": "5b8d5113a5d0a975dec33f9569237181f06d0d4cffd110e7899321ffe64ca578",
"s390x-unknown-linux-gnu-0.12.7": "afebbf174931be732ed1e372dbdfecc6c053ab4148243196b449c9973adb79c5",
"x86_64-apple-darwin-0.12.7": "06b8ae1da8c2661c5434507a66f8c2b0b835933bf955b5958a9ac357a37d1959",
"x86_64-pc-windows-msvc-0.12.7": "bf1518af459a3915511a11fdc6e2f43ef9a2afa138b9d498eeb9642fe9d85218",
"x86_64-unknown-linux-gnu-0.12.7": "788f18abea7c5f55d6216e4f5613fd89d4d59b631efeec117b2b07fe72f1da21",
"x86_64-unknown-linux-musl-0.12.7": "3d64d44ed67da7908dc7f5c4d64ebb44bad326fa17f8a0a52fc9a7793017bbe1",
"aarch64-apple-darwin-0.12.6": "14b459d51ea2e71eeba28c45a268c922bdf8607fc6455e3f40b4e082895d160d",
"aarch64-pc-windows-msvc-0.12.6": "6dda514fbbe3152d980758e0f6347116060114d7d24932fc0ea5d8063f8b253a",
"aarch64-unknown-linux-gnu-0.12.6": "d58030acd26159499ac82f32da12d1b3c12a3a1bfc414232d9082070c03e128d",
"aarch64-unknown-linux-musl-0.12.6": "3719891de9ab41c878a84331e55826d2a46421976a346a65326513a6795b089a",
"arm-unknown-linux-musleabihf-0.12.6": "917aa56d9318f8ad9509d941625feb49d2a444363c82143b7f79ebef0df7cecc",
"armv7-unknown-linux-gnueabihf-0.12.6": "2bde552a6288852ce4858e740d9434b64cd9edbba1956f6170c43ad93867a5ac",
"armv7-unknown-linux-musleabihf-0.12.6": "ad000efcd6e82ee76f01c523e5fdf267638625307d8d211fd73d6acaee7968e6",
"i686-pc-windows-msvc-0.12.6": "ddec1f1ca7b96fbd3822b5dff3fbade7add64a03afc334e2fd31d4820911f447",
"i686-unknown-linux-gnu-0.12.6": "2c93b0ef748675555a2af0cbc45a51f7b2e7014f9a0e34ae28d092e0293990d8",
"i686-unknown-linux-musl-0.12.6": "3cdda2dd5ad434399cd4788ae70d8057a4549e91f725135c07d2a09a6c4f1c5a",
"powerpc64le-unknown-linux-gnu-0.12.6": "474660a7d36d10ae156e0acfe3d1fac6ce9a684f6d6d92287c370d9b7a2f4173",
"riscv64gc-unknown-linux-gnu-0.12.6": "978541918503866f21863353570c702d981596210bd3b05a816f037a97897f31",
"riscv64gc-unknown-linux-musl-0.12.6": "83357df6b043c3e1f0d8e91cd90ccbe835ecc2f8bf4d6be6cb220b20b8b67a32",
"s390x-unknown-linux-gnu-0.12.6": "05a05615e8227bf89902301ea29a7bf424d8caef8d9dca682c149ad34df2d31a",
"x86_64-apple-darwin-0.12.6": "2a26ea71bbeff1c7e12c2cc40245c96a041deff276bc921e7038e304d5d3e04c",
"x86_64-pc-windows-msvc-0.12.6": "df7cb9f243eae1621400d4fcf5b1b3d90f20e264ece91b64deb3b0078abca6ef",
"x86_64-unknown-linux-gnu-0.12.6": "8681d8921e7d520fb368991dcf5f9c1905b80f5bf2a265a0ed085c8d8e342477",
"x86_64-unknown-linux-musl-0.12.6": "14e4172aace66a475062cebec7ca04f497d5619e95325dfcc9e4447b9c516846",
"aarch64-apple-darwin-0.12.5": "5bb0e5fe008a773c3dbcb97ff79cd89e1241464fe9d2f986d52ad8f1b037bd62",
"aarch64-pc-windows-msvc-0.12.5": "724279317fee6e5fa8ad1908e4eba2bbe764ef1ece5b3f4597927b62b1fe562a",
"aarch64-unknown-linux-gnu-0.12.5": "9bf43b4d1a07665bf64d4c4e710930b382321a785e0eb10aac07f46471f86a31",
"aarch64-unknown-linux-musl-0.12.5": "8767a0e77f2cd45436401b1b42bf7e9ed5a4a91a74a5305d6fe93249d0f6dbc5",
"arm-unknown-linux-musleabihf-0.12.5": "970f86ddcd1373120c1e7ee246b533c2e75366294098e1406f07ecf3bb55d260",
"armv7-unknown-linux-gnueabihf-0.12.5": "63f86f3cd92de223c2680dee5149ed3f317ad7aeac774fd7e6fe1f86f53e85da",
"armv7-unknown-linux-musleabihf-0.12.5": "62f838f29cad6fda061b1566168555978c544a4107697cd1967398b7f8efea84",
"i686-pc-windows-msvc-0.12.5": "a5993a7c2e75b418e60d5ed733204222330085b14e85269545b084c273c1629b",
"i686-unknown-linux-gnu-0.12.5": "4875a06092c3b0aa8ece5265a42b053dfef649adba26434b5e40eeb58c2a2aa5",
"i686-unknown-linux-musl-0.12.5": "b920f32f0910be363f770485117e08494eec0b09abb4f3f9f1f9b9f53a29394c",
"powerpc64le-unknown-linux-gnu-0.12.5": "af3f868fc8af2c3a688b1a202cbed507ec5bb32522876141f1b7f4200ed0395f",
"riscv64gc-unknown-linux-gnu-0.12.5": "2a6fe4a685225082d82f8afba169d038d669f85bf6cff7f5f733079a7b7282d5",
"riscv64gc-unknown-linux-musl-0.12.5": "c7fc653d16f0214eaaf2b3af537ec917af4861e3d00c0f10e0784fe4cbc1dcd6",
"s390x-unknown-linux-gnu-0.12.5": "858d51fd178fe99c69923cef568fbac3f297f3767c0e0d985aa172bc1f3e2274",
"x86_64-apple-darwin-0.12.5": "b3b2137477cf96c9686ebfb71524614cec780c673fd73e59bce099aef02e70e8",
"x86_64-pc-windows-msvc-0.12.5": "4c4d49d8738847d9b71ba319e49a5688c93eac0fe6204b1df24e98528dddf39a",
"x86_64-unknown-linux-gnu-0.12.5": "68a509da24b06b4223a1c0175fb5eb5bc79342b76cbeff0cfe51ac3f5b17b6b2",
"x86_64-unknown-linux-musl-0.12.5": "a4742988791c9aeae68c78150d6cba762062ad2a47e53738c2779d2b596bfcdb",
"aarch64-apple-darwin-0.12.4": "99a913b606194867b43086404412c1afe079547fee72ecfb6af7e7b0dd54b0c6", "aarch64-apple-darwin-0.12.4": "99a913b606194867b43086404412c1afe079547fee72ecfb6af7e7b0dd54b0c6",
"aarch64-pc-windows-msvc-0.12.4": "3290abffee78c30e3113f5113e26684fd057287e89124a588dcdcdd6ceec0fea", "aarch64-pc-windows-msvc-0.12.4": "3290abffee78c30e3113f5113e26684fd057287e89124a588dcdcdd6ceec0fea",
"aarch64-unknown-linux-gnu-0.12.4": "49d881b3403187e1f1789720881e77e4251ad4259d86c4844862657d2a35d13f", "aarch64-unknown-linux-gnu-0.12.4": "49d881b3403187e1f1789720881e77e4251ad4259d86c4844862657d2a35d13f",
@@ -52328,6 +52598,9 @@ var KNOWN_CHECKSUMS = {
"x86_64-unknown-linux-musl-0.0.5": "705bbe04a93a9d4d9db5224c2f980a88bba272538a33a78ea2e966f46b4d5eb7" "x86_64-unknown-linux-musl-0.0.5": "705bbe04a93a9d4d9db5224c2f980a88bba272538a33a78ea2e966f46b4d5eb7"
}; };
// src/download/checksum/known-checksums.ts
var KNOWN_CHECKSUMS = known_checksums_default;
// src/download/checksum/known-version.ts // src/download/checksum/known-version.ts
var VERSION_IN_CHECKSUM_KEY_PATTERN = /-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/; var VERSION_IN_CHECKSUM_KEY_PATTERN = /-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/;
function getLatestKnownVersion() { function getLatestKnownVersion() {
@@ -52355,9 +52628,8 @@ async function updateChecksums(filePath, checksumEntries) {
} }
deduplicatedEntries.set(entry.key, entry.checksum); deduplicatedEntries.set(entry.key, entry.checksum);
} }
const body = [...deduplicatedEntries.entries()].map(([key, checksum]) => ` "${key}": const content = `${JSON.stringify(Object.fromEntries(deduplicatedEntries), null, 2)}
"${checksum}"`).join(",\n"); `;
const content = "// AUTOGENERATED_DO_NOT_EDIT\nexport const KNOWN_CHECKSUMS: { [key: string]: string } = {\n" + body + (body === "" ? "" : ",\n") + "};\n";
await import_node_fs.promises.writeFile(filePath, content); await import_node_fs.promises.writeFile(filePath, content);
} }
@@ -52370,23 +52642,12 @@ var VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/version
// src/utils/fetch.ts // src/utils/fetch.ts
var import_undici2 = __toESM(require_undici2(), 1); var import_undici2 = __toESM(require_undici2(), 1);
function getProxyAgent() {
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy;
if (httpProxy) {
return new import_undici2.ProxyAgent(httpProxy);
}
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
if (httpsProxy) {
return new import_undici2.ProxyAgent(httpsProxy);
}
return void 0;
}
var fetch = async (url, opts) => { var fetch = async (url, opts) => {
const timeoutSignal = AbortSignal.timeout(5e3); const timeoutSignal = AbortSignal.timeout(5e3);
const existingSignal = opts.signal; const existingSignal = opts.signal;
const mergedSignal = existingSignal ? AbortSignal.any([timeoutSignal, existingSignal]) : timeoutSignal; const mergedSignal = existingSignal ? AbortSignal.any([timeoutSignal, existingSignal]) : timeoutSignal;
return await (0, import_undici2.fetch)(url, { return await (0, import_undici2.fetch)(url, {
dispatcher: getProxyAgent(), dispatcher: new import_undici2.EnvHttpProxyAgent(),
...opts, ...opts,
signal: mergedSignal signal: mergedSignal
}); });

View File

@@ -6,7 +6,7 @@ This document covers advanced options for configuring which version of uv to ins
```yaml ```yaml
- name: Install the latest version of uv - name: Install the latest version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "latest" version: "latest"
``` ```
@@ -19,7 +19,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u
```yaml ```yaml
- name: Install the latest version of uv known to setup-uv - name: Install the latest version of uv known to setup-uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "latest-known" version: "latest-known"
``` ```
@@ -28,7 +28,7 @@ When `manifest-file` is set, `latest-known` still selects a version from setup-u
```yaml ```yaml
- name: Install a specific version of uv - name: Install a specific version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.4.4" version: "0.4.4"
``` ```
@@ -41,21 +41,21 @@ to install the latest version that satisfies the range.
```yaml ```yaml
- name: Install a semver range of uv - name: Install a semver range of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.0" version: ">=0.4.0"
``` ```
```yaml ```yaml
- name: Pinning a minor version of uv - name: Pinning a minor version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.4.x" version: "0.4.x"
``` ```
```yaml ```yaml
- name: Install a pep440-specifier-satisfying version of uv - name: Install a pep440-specifier-satisfying version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.25,<0.5" version: ">=0.4.25,<0.5"
``` ```
@@ -67,7 +67,7 @@ You can change this behavior using the `resolution-strategy` input:
```yaml ```yaml
- name: Install the lowest compatible version of uv - name: Install the lowest compatible version of uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: ">=0.4.0" version: ">=0.4.0"
resolution-strategy: "lowest" resolution-strategy: "lowest"
@@ -92,7 +92,7 @@ as `UV_PYTHON`. Only a single Python version is supported; multiple fallback ver
```yaml ```yaml
- name: Install uv based on the version defined in pyproject.toml - name: Install uv based on the version defined in pyproject.toml
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: "pyproject.toml" version-file: "pyproject.toml"
``` ```
@@ -103,7 +103,7 @@ silently picking up a newer uv until the lockfile is updated.
```yaml ```yaml
- name: Install uv based on the version locked in uv.lock - name: Install uv based on the version locked in uv.lock
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version-file: "uv.lock" version-file: "uv.lock"
``` ```

View File

@@ -23,7 +23,7 @@ The computed cache key is available as the `cache-key` output:
```yaml ```yaml
- name: Setup uv - name: Setup uv
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
- name: Print cache key - name: Print cache key
@@ -53,7 +53,7 @@ You can optionally define a custom cache key suffix.
```yaml ```yaml
- name: Enable caching and define a custom cache key suffix - name: Enable caching and define a custom cache key suffix
id: setup-uv id: setup-uv
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-suffix: "optional-suffix" cache-suffix: "optional-suffix"
@@ -92,7 +92,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define a cache dependency glob - name: Define a cache dependency glob
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "**/pyproject.toml" cache-dependency-glob: "**/pyproject.toml"
@@ -100,7 +100,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define a list of cache dependency globs - name: Define a list of cache dependency globs
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: | cache-dependency-glob: |
@@ -110,7 +110,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Define an absolute cache dependency glob - name: Define an absolute cache dependency glob
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "/tmp/my-folder/requirements*.txt" cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
@@ -118,7 +118,7 @@ changes. If you use relative paths, they are relative to the working directory.
```yaml ```yaml
- name: Never invalidate the cache - name: Never invalidate the cache
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-dependency-glob: "" cache-dependency-glob: ""
@@ -131,7 +131,7 @@ By default, the cache will be restored.
```yaml ```yaml
- name: Don't restore an existing cache - name: Don't restore an existing cache
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
restore-cache: false restore-cache: false
@@ -139,13 +139,15 @@ By default, the cache will be restored.
## Save cache ## Save cache
You can also disable saving the cache after the run with the `save-cache` input. You can control saving the cache after the run with the `save-cache` input.
This can be useful to save cache storage when you know you will not use the cache of the run again. This can be useful to save cache storage when you know you will not use the cache of the run again.
By default, the cache will be saved. By default, `save-cache: auto` saves the cache except for `merge_group` events, where caches created
for temporary merge queue refs are unlikely to be reused. Cache restoration remains enabled for
these events. Set `save-cache: true` to save the cache for all events.
```yaml ```yaml
- name: Don't save the cache after the run - name: Don't save the cache after the run
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
save-cache: false save-cache: false
@@ -171,7 +173,7 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\setup-uv-cache` on
```yaml ```yaml
- name: Define a custom uv cache path - name: Define a custom uv cache path
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
cache-local-path: "/path/to/cache" cache-local-path: "/path/to/cache"
``` ```
@@ -188,7 +190,7 @@ If you want to prune the cache before saving it, enable cache pruning with the `
```yaml ```yaml
- name: Prune the cache before saving it - name: Prune the cache before saving it
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
prune-cache: true prune-cache: true
@@ -207,7 +209,7 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`.
```yaml ```yaml
- name: Cache Python installs - name: Cache Python installs
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
cache-python: true cache-python: true
@@ -225,7 +227,7 @@ If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`.
```yaml ```yaml
- name: Ignore nothing to cache - name: Ignore nothing to cache
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
enable-cache: true enable-cache: true
ignore-nothing-to-cache: true ignore-nothing-to-cache: true

View File

@@ -4,13 +4,14 @@ This document covers advanced customization options including checksum validatio
## Validate checksum ## Validate checksum
You can specify a checksum to validate the downloaded executable. Checksums up to the default version Downloaded executables are automatically verified using checksums bundled with this action or,
are automatically verified by this action. The sha256 hashes can be found on the for newer, not yet bundled versions, the checksum from [`astral-sh/versions`](https://github.com/astral-sh/versions).
You can specify a checksum to override those values. The sha256 hashes can also be found on the
[releases page](https://github.com/astral-sh/uv/releases) of the uv repo. [releases page](https://github.com/astral-sh/uv/releases) of the uv repo.
```yaml ```yaml
- name: Install a specific version and validate the checksum - name: Install a specific version and validate the checksum
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
version: "0.3.1" version: "0.3.1"
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8" checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
@@ -39,7 +40,7 @@ The `archive_format` field is currently ignored.
```yaml ```yaml
- name: Use a custom manifest file - name: Use a custom manifest file
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
manifest-file: "https://example.com/my-custom-manifest.ndjson" manifest-file: "https://example.com/my-custom-manifest.ndjson"
``` ```
@@ -58,7 +59,7 @@ You can disable this by setting the `add-problem-matchers` input to `false`.
```yaml ```yaml
- name: Install the latest version of uv without problem matchers - name: Install the latest version of uv without problem matchers
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
add-problem-matchers: false add-problem-matchers: false
``` ```

View File

@@ -9,7 +9,7 @@ This allows directly using it in later steps:
```yaml ```yaml
- name: Install the latest version of uv and activate the environment - name: Install the latest version of uv and activate the environment
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
activate-environment: true activate-environment: true
- run: uv pip install pip - run: uv pip install pip
@@ -17,10 +17,22 @@ This allows directly using it in later steps:
By default, the venv is created at `.venv` inside the `working-directory`. By default, the venv is created at `.venv` inside the `working-directory`.
With `activate-environment: true`, the `python-runtime-id` output identifies the
venv's Python runtime as reported by uv. This is an opaque identifier that users of the action
can use as a cache key if necessary; users should not assume anything about
the stability or structure of the identifier itself.
For example, you can combine it with the platform and dependency information relevant to
your cache with `id: setup-uv` on the setup step:
```yaml
key: build-${{ runner.os }}-${{ runner.arch }}-${{ steps.setup-uv.outputs.python-runtime-id }}-${{ hashFiles('uv.lock') }}
```
You can customize the venv location with `venv-path`, for example to place it in the runner temp directory: You can customize the venv location with `venv-path`, for example to place it in the runner temp directory:
```yaml ```yaml
- uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
activate-environment: true activate-environment: true
venv-path: ${{ runner.temp }}/custom-venv venv-path: ${{ runner.temp }}/custom-venv
@@ -51,7 +63,7 @@ are not sufficient, you can provide a custom GitHub token with the necessary per
```yaml ```yaml
- name: Install the latest version of uv with a custom GitHub token - name: Install the latest version of uv with a custom GitHub token
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
``` ```
@@ -69,7 +81,7 @@ input:
```yaml ```yaml
- name: Install the latest version of uv with a custom tool dir - name: Install the latest version of uv with a custom tool dir
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
tool-dir: "/path/to/tool/dir" tool-dir: "/path/to/tool/dir"
``` ```
@@ -88,7 +100,7 @@ If you want to change this behaviour (especially on self-hosted runners) you can
```yaml ```yaml
- name: Install the latest version of uv with a custom tool bin dir - name: Install the latest version of uv with a custom tool bin dir
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
tool-bin-dir: "/path/to/tool-bin/dir" tool-bin-dir: "/path/to/tool-bin/dir"
``` ```
@@ -105,7 +117,7 @@ This action supports expanding the `~` character to the user's home directory fo
```yaml ```yaml
- name: Expand the tilde character - name: Expand the tilde character
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
cache-local-path: "~/path/to/cache" cache-local-path: "~/path/to/cache"
tool-dir: "~/path/to/tool/dir" tool-dir: "~/path/to/tool/dir"
@@ -122,7 +134,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
```yaml ```yaml
- name: Ignore empty workdir - name: Ignore empty workdir
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
ignore-empty-workdir: true ignore-empty-workdir: true
``` ```
@@ -146,7 +158,7 @@ This action sets several environment variables that influence uv's behavior and
```yaml ```yaml
- name: Example using environment variables - name: Example using environment variables
uses: astral-sh/setup-uv@ae62891fec2bb8e7d6c99fc78c9fec3a63790f8d # v10.0.0 uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
with: with:
python-version: "3.12" python-version: "3.12"
tool-dir: "/custom/tool/dir" tool-dir: "/custom/tool/dir"

643
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,16 @@
"type": "module", "type": "module",
"description": "Set up your GitHub Actions workflow with a specific version of uv", "description": "Set up your GitHub Actions workflow with a specific version of uv",
"main": "dist/setup/index.cjs", "main": "dist/setup/index.cjs",
"engines": {
"npm": ">=11.10.0"
},
"devEngines": {
"packageManager": {
"name": "npm",
"version": ">=11.10.0",
"onFail": "error"
}
},
"scripts": { "scripts": {
"build": "tsc --noEmit", "build": "tsc --noEmit",
"check": "biome check --write", "check": "biome check --write",
@@ -12,7 +22,7 @@
"test:unit": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js", "test:unit": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"test": "npm run build && npm run test:unit", "test": "npm run build && npm run test:unit",
"act": "act pull_request -W .github/workflows/test.yml --container-architecture linux/amd64 -s GITHUB_TOKEN=\"$(gh auth token)\"", "act": "act pull_request -W .github/workflows/test.yml --container-architecture linux/amd64 -s GITHUB_TOKEN=\"$(gh auth token)\"",
"update-known-checksums": "RUNNER_TEMP=known_versions node dist/update-known-checksums/index.cjs src/download/checksum/known-checksums.ts", "update-known-checksums": "RUNNER_TEMP=known_versions node dist/update-known-checksums/index.cjs src/download/checksum/known-checksums.json",
"all": "npm run build && npm run check && npm run package && npm run test:unit" "all": "npm run build && npm run check && npm run package && npm run test:unit"
}, },
"repository": { "repository": {
@@ -35,18 +45,18 @@
"@actions/io": "^3.0.2", "@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0", "@actions/tool-cache": "^4.0.0",
"@renovatebot/pep440": "^5.0.0", "@renovatebot/pep440": "^5.0.0",
"smol-toml": "^1.7.1", "smol-toml": "^1.8.0",
"undici": "^8.10.0" "undici": "^8.10.0"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.5.7", "@biomejs/biome": "^2.5.11",
"@types/js-yaml": "^4.0.9", "@types/js-yaml": "^4.0.9",
"@types/node": "^26.1.2", "@types/node": "^26.2.0",
"@types/semver": "^7.8.0", "@types/semver": "^7.8.0",
"@vercel/ncc": "^0.44.1", "@vercel/ncc": "^0.45.0",
"esbuild": "^0.28.1", "esbuild": "^0.28.2",
"jest": "^30.4.2", "jest": "^30.4.2",
"js-yaml": "^5.2.3", "js-yaml": "^5.3.0",
"ts-jest": "^29.4.11", "ts-jest": "^29.4.11",
"typescript": "^6.0.3" "typescript": "^6.0.3"
} }

View File

@@ -11,19 +11,30 @@ export async function validateChecksum(
arch: Architecture, arch: Architecture,
platform: Platform, platform: Platform,
version: string, version: string,
manifestChecksum?: string,
): Promise<void> { ): Promise<void> {
const key = `${arch}-${platform}-${version}`; const key = `${arch}-${platform}-${version}`;
const hasProvidedChecksum = checksum !== undefined && checksum !== ""; const hasProvidedChecksum = checksum !== undefined && checksum !== "";
const checksumToUse = hasProvidedChecksum ? checksum : KNOWN_CHECKSUMS[key]; const knownChecksum = KNOWN_CHECKSUMS[key];
const hasManifestChecksum =
manifestChecksum !== undefined && manifestChecksum !== "";
const checksumToUse = hasProvidedChecksum
? checksum
: (knownChecksum ?? (hasManifestChecksum ? manifestChecksum : undefined));
if (checksumToUse === undefined) { if (checksumToUse === undefined) {
if (manifestChecksum !== undefined) {
throw new Error(`No checksum found for ${key} in manifest.`);
}
core.debug(`No checksum found for ${key}.`); core.debug(`No checksum found for ${key}.`);
return; return;
} }
const checksumSource = hasProvidedChecksum const checksumSource = hasProvidedChecksum
? "provided checksum" ? "provided checksum"
: `KNOWN_CHECKSUMS entry for ${key}`; : knownChecksum !== undefined
? `KNOWN_CHECKSUMS entry for ${key}`
: "manifest checksum";
core.debug(`Validating checksum using ${checksumSource}.`); core.debug(`Validating checksum using ${checksumSource}.`);
const isValid = await validateFileCheckSum(downloadPath, checksumToUse); const isValid = await validateFileCheckSum(downloadPath, checksumToUse);

5416
src/download/checksum/known-checksums.json generated Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -19,16 +19,7 @@ export async function updateChecksums(
deduplicatedEntries.set(entry.key, entry.checksum); deduplicatedEntries.set(entry.key, entry.checksum);
} }
const body = [...deduplicatedEntries.entries()] const content = `${JSON.stringify(Object.fromEntries(deduplicatedEntries), null, 2)}\n`;
.map(([key, checksum]) => ` "${key}":\n "${checksum}"`)
.join(",\n");
const content =
"// AUTOGENERATED_DO_NOT_EDIT\n" +
"export const KNOWN_CHECKSUMS: { [key: string]: string } = {\n" +
body +
(body === "" ? "" : ",\n") +
"};\n";
await fs.writeFile(filePath, content); await fs.writeFile(filePath, content);
} }

View File

@@ -47,12 +47,14 @@ export async function downloadVersion(
); );
} }
// For the default astral-sh/versions source, checksum validation relies on // Custom manifests are explicitly selected by the user, so their checksum
// user input or the built-in KNOWN_CHECKSUMS table, not manifest sha256 values. // takes precedence over the built-in table. For the default manifest, pass
// its checksum as a fallback after user input and KNOWN_CHECKSUMS.
const resolvedChecksum = const resolvedChecksum =
manifestUrl === undefined manifestUrl === undefined
? checksum ? checksum
: resolveChecksum(checksum, artifact.checksum); : resolveChecksum(checksum, artifact.checksum);
const manifestChecksum = artifact.checksum;
const mirrorUrl = downloadFromAstralMirror const mirrorUrl = downloadFromAstralMirror
? rewriteToMirror(artifact.downloadUrl) ? rewriteToMirror(artifact.downloadUrl)
@@ -67,6 +69,7 @@ export async function downloadVersion(
arch, arch,
version, version,
resolvedChecksum, resolvedChecksum,
manifestChecksum,
githubTokenForUrl(downloadUrl, githubToken), githubTokenForUrl(downloadUrl, githubToken),
); );
} catch (err) { } catch (err) {
@@ -85,6 +88,7 @@ export async function downloadVersion(
arch, arch,
version, version,
resolvedChecksum, resolvedChecksum,
manifestChecksum,
githubTokenForUrl(artifact.downloadUrl, githubToken), githubTokenForUrl(artifact.downloadUrl, githubToken),
); );
} }
@@ -122,6 +126,7 @@ async function downloadArtifact(
arch: Architecture, arch: Architecture,
version: string, version: string,
checksum: string | undefined, checksum: string | undefined,
manifestChecksum: string | undefined,
githubToken: string | undefined, githubToken: string | undefined,
): Promise<{ version: string; cachedToolDir: string }> { ): Promise<{ version: string; cachedToolDir: string }> {
log.info(`Downloading uv from "${downloadUrl}" ...`); log.info(`Downloading uv from "${downloadUrl}" ...`);
@@ -130,7 +135,14 @@ async function downloadArtifact(
undefined, undefined,
githubToken, githubToken,
); );
await validateChecksum(checksum, downloadPath, arch, platform, version); await validateChecksum(
checksum,
downloadPath,
arch,
platform,
version,
manifestChecksum,
);
let uvDir: string; let uvDir: string;
if (platform === "pc-windows-msvc") { if (platform === "pc-windows-msvc") {

View File

@@ -16,6 +16,7 @@ import {
getPlatform, getPlatform,
type Platform, type Platform,
} from "./utils/platforms"; } from "./utils/platforms";
import { getPythonRuntimeId } from "./utils/python-runtime";
import { resolveUvVersion } from "./version/resolve"; import { resolveUvVersion } from "./version/resolve";
const sourceDir = __dirname; const sourceDir = __dirname;
@@ -101,6 +102,7 @@ async function run(): Promise<void> {
const detectedPythonVersion = await getPythonVersion(inputs); const detectedPythonVersion = await getPythonVersion(inputs);
core.setOutput("python-version", detectedPythonVersion); core.setOutput("python-version", detectedPythonVersion);
core.setOutput("python-runtime-id", await getPythonRuntimeId(inputs));
if (inputs.enableCache) { if (inputs.enableCache) {
await restoreCache(inputs, detectedPythonVersion); await restoreCache(inputs, detectedPythonVersion);

View File

@@ -1,18 +1,8 @@
import { ProxyAgent, type RequestInit, fetch as undiciFetch } from "undici"; import {
EnvHttpProxyAgent,
export function getProxyAgent() { type RequestInit,
const httpProxy = process.env.HTTP_PROXY || process.env.http_proxy; fetch as undiciFetch,
if (httpProxy) { } from "undici";
return new ProxyAgent(httpProxy);
}
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy;
if (httpsProxy) {
return new ProxyAgent(httpsProxy);
}
return undefined;
}
export const fetch = async (url: string, opts: RequestInit) => { export const fetch = async (url: string, opts: RequestInit) => {
// Merge timeout signal with any existing signal from opts // Merge timeout signal with any existing signal from opts
@@ -23,7 +13,7 @@ export const fetch = async (url: string, opts: RequestInit) => {
: timeoutSignal; : timeoutSignal;
return await undiciFetch(url, { return await undiciFetch(url, {
dispatcher: getProxyAgent(), dispatcher: new EnvHttpProxyAgent(),
...opts, ...opts,
signal: mergedSignal, signal: mergedSignal,
}); });

View File

@@ -60,7 +60,7 @@ export function loadInputs(): SetupInputs {
const checksum = core.getInput("checksum"); const checksum = core.getInput("checksum");
const enableCache = getEnableCache(); const enableCache = getEnableCache();
const restoreCache = core.getInput("restore-cache") === "true"; const restoreCache = core.getInput("restore-cache") === "true";
const saveCache = core.getInput("save-cache") === "true"; const saveCache = getSaveCache();
const cacheSuffix = core.getInput("cache-suffix") || ""; const cacheSuffix = core.getInput("cache-suffix") || "";
const cacheLocalPath = getCacheLocalPath( const cacheLocalPath = getCacheLocalPath(
workingDirectory, workingDirectory,
@@ -189,6 +189,18 @@ function getEnableCache(): boolean {
return enableCacheInput === "true"; return enableCacheInput === "true";
} }
function getSaveCache(): boolean {
const saveCacheInput = core.getInput("save-cache");
if (saveCacheInput === "auto") {
if (process.env.GITHUB_EVENT_NAME === "merge_group") {
log.info("Cache saving is disabled for the merge_group event");
return false;
}
return true;
}
return saveCacheInput === "true";
}
function getToolBinDir(workingDirectory: string): string | undefined { function getToolBinDir(workingDirectory: string): string | undefined {
const toolBinDirInput = core.getInput("tool-bin-dir"); const toolBinDirInput = core.getInput("tool-bin-dir");
if (toolBinDirInput !== "") { if (toolBinDirInput !== "") {

View File

@@ -0,0 +1,43 @@
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import type { SetupInputs } from "./inputs";
const execFileAsync = promisify(execFile);
export async function getPythonRuntimeId(inputs: SetupInputs): Promise<string> {
if (!inputs.activateEnvironment) {
return "";
}
try {
// The venv path restricts results to this invocation's runtime, even if
// earlier setup-uv calls installed other Python versions in the same job.
const { stdout } = await execFileAsync(
"uv",
[
"python",
"list",
inputs.venvPath,
"--only-installed",
"--output-format",
"json",
],
{ encoding: "utf8" },
);
const pythons = JSON.parse(stdout);
if (
!Array.isArray(pythons) ||
pythons.length !== 1 ||
typeof pythons[0]?.key !== "string" ||
pythons[0].key === ""
) {
throw new Error("Expected one installed Python with a runtime key");
}
return pythons[0].key;
} catch (error) {
throw new Error(
`Failed to identify the activated environment's Python runtime: ${error instanceof Error ? error.message : String(error)}`,
{ cause: error },
);
}
}

View File

@@ -5,6 +5,7 @@
"module": "esnext", "module": "esnext",
"moduleResolution": "bundler", "moduleResolution": "bundler",
"noImplicitAny": true, "noImplicitAny": true,
"resolveJsonModule": true,
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022"
}, },