Compare commits

...

4 Commits

Author SHA1 Message Date
Dilum Aluthge
3241879f97 Fix 2026-03-05 15:01:52 -05:00
Dilum Aluthge
2c2e035e86 Update README.md 2026-03-04 22:14:00 -05:00
Dilum Aluthge
210e196714 Update installer.ts 2026-03-04 22:11:51 -05:00
Dilum Aluthge
c8ff8a1937 Breaking: Change min to return the latest patch
The major/minor will be the minimum, but the patch will be the latest. E.g. `julia = "1.10"` would lead to e.g. 1.10.10 (not 1.10.0).
2026-03-04 22:06:45 -05:00
2 changed files with 10 additions and 2 deletions

View File

@@ -139,7 +139,7 @@ You can either specify specific Julia versions or version ranges. If you specify
- `'pre'` will install the latest prerelease build (RCs, betas, and alphas).
- `'nightly'` will install the latest nightly build.
- `'1.7-nightly'` will install the latest nightly build for the upcoming 1.7 release. This version will only be available during certain phases of the Julia release cycle.
- `'min'` will install the earliest supported version of Julia compatible with the project. Especially useful in monorepos.
- `'min'` will install the earliest supported major/minor version of Julia compatible with the project. Especially useful in monorepos. Note: `min` chooses the lowest major/minor, but gives the latest patch. For example, for a Julia `[compat]` entry of `julia = "1.10"`, `min` would resolve to e.g. `1.10.10` (NOT `1.10.0`). If you specifically require e.g. 1.10.0, please specify that manually (instead of using `min`).
Internally the action uses node's semver package to resolve version ranges. Its [documentation](https://github.com/npm/node-semver#advanced-range-syntax) contains more details on the version range syntax. You can test what version will be selected for a given input in this JavaScript [REPL](https://repl.it/@SaschaMann/setup-julia-version-logic).

View File

@@ -179,7 +179,15 @@ export function getJuliaVersion(availableReleases: string[], versionInput: strin
if (!juliaCompatRange) {
throw new Error('Unable to use version "min" when the Julia project file does not specify a compat for Julia')
}
version = semver.minSatisfying(availableReleases, juliaCompatRange, {includePrerelease})
// true_min_version is the actual minimum
// E.g. if the Julia [compat] entry is "1.10", then true_min_version is v"1.10.0"
let true_min_version = semver.minSatisfying(availableReleases, juliaCompatRange, {includePrerelease})
let my_tilde_range = `~${true_min_version}`
// min_with_latest_patch is the minimum major/minor, but latest patch
// E.g. if the Julia [compat] entry is "1.10", then true__version is v"1.10.10" (or whatever the latest 1.10.x patch is)
// https://github.com/julia-actions/setup-julia/issues/372
let min_with_latest_patch = semver.maxSatisfying(availableReleases, my_tilde_range, {includePrerelease})
version = min_with_latest_patch
} else if (versionInput == "lts") {
version = semver.maxSatisfying(availableReleases, LTS_VERSION, { includePrerelease: false });
} else if (versionInput == "pre") {