mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-03-06 13:43:19 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3241879f97 | ||
|
|
2c2e035e86 | ||
|
|
210e196714 | ||
|
|
c8ff8a1937 |
@@ -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).
|
||||
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user