Skip to content

Commit

Permalink
Add support for semver version ranges (#82)
Browse files Browse the repository at this point in the history
Closes: #38
  • Loading branch information
eifinger authored Sep 18, 2024
1 parent 8e09161 commit ce0062a
Show file tree
Hide file tree
Showing 5 changed files with 4,484 additions and 257 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-14, oracle-aarch64]
uv-version: ["latest", "0.3.0", "0.3.2"]
uv-version: ["latest", "0.3.0", "0.3.2", "0.3", "0.3.x", ">=0.3.0"]
steps:
- uses: actions/checkout@v4
- name: Install version ${{ matrix.uv-version }}
Expand All @@ -49,6 +49,25 @@ jobs:
version: ${{ matrix.uv-version }}
- run: uv sync
working-directory: __tests__/fixtures/uv-project
test-semver-range:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, oracle-aarch64]
steps:
- uses: actions/checkout@v4
- name: Install version 0.3
id: setup-uv
uses: ./
with:
version: "0.3"
- name: Correct version gets installed
run: |
if [ "$UV_VERSION" != "0.3.5" ]; then
exit 1
fi
env:
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
test-checksum:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ For an example workflow, see
version: "0.4.4"
```

### Install a version by supplying a semver range

You can also specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
to install the latest version that satisfies the range.

```yaml
- name: Install a semver range of uv
uses: astral-sh/setup-uv@v2
with:
version: ">=0.3.0"
```

```yaml
- name: Pinning a minor version of uv
uses: astral-sh/setup-uv@v2
with:
version: "0.3.x"
```

### Validate checksum

You can also specify a checksum to validate the downloaded file. Checksums up to the default version
Expand Down
Loading

0 comments on commit ce0062a

Please sign in to comment.