5
0
mirror of https://github.com/astral-sh/setup-uv.git synced 2025-12-23 11:01:03 +00:00

Add resolution-strategy input to support oldest compatible version selection (#631)

Adds a new `resolution-strategy` input that allows users to choose
between installing the highest (default) or lowest compatible version
when resolving version ranges.
This commit is contained in:
Copilot
2025-10-11 21:02:04 +02:00
committed by GitHub
parent a5129e99f4
commit 9c6b5e9fb5
8 changed files with 136 additions and 11 deletions

View File

@@ -111,15 +111,25 @@ jobs:
expected-version: "0.3.5"
- version-input: ">=0.4.25,<0.5"
expected-version: "0.4.30"
- version-input: ">=0.4.25,<0.5"
expected-version: "0.4.25"
resolution-strategy: "lowest"
- version-input: ">=0.1,<0.2"
expected-version: "0.1.45"
resolution-strategy: "highest"
- version-input: ">=0.1.0,<0.2"
expected-version: "0.1.0"
resolution-strategy: "lowest"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install version ${{ matrix.input.version-input }}
- name: Install version ${{ matrix.input.version-input }} with strategy ${{ matrix.input.resolution-strategy || 'highest' }}
id: setup-uv
uses: ./
with:
version: ${{ matrix.input.version-input }}
resolution-strategy: ${{ matrix.input.resolution-strategy || 'highest' }}
- name: Correct version gets installed
run: |
if [ "$(uv --version)" != "uv ${{ matrix.input.expected-version }}" ]; then