mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 02:56:54 +08:00
Allow lts for the LTS, and allow pre for the latest pre-release (#234)
* update tests to latest `versions.json` * allow specifying the version as `lts` to install the latest LTS version for now, this just hardcodes the LTS version in the source (similar to how juliaup does it) since the latest LTS is not available in `versions.json`. Since the LTS is updated so rarely this might be ok for now. * add a 'pre' version * Run `npm ci` followed by `npm run build` * Add a CI job to test `pre` --------- Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com> Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
This commit is contained in:
committed by
GitHub
parent
42e03d3446
commit
389de5c0df
@@ -10,6 +10,9 @@ import retry = require('async-retry')
|
||||
|
||||
import * as semver from 'semver'
|
||||
|
||||
const LTS_VERSION = '1.6'
|
||||
const MAJOR_VERSION = '1' // Could be deduced from versions.json
|
||||
|
||||
// Translations between actions input and Julia arch names
|
||||
const osMap = {
|
||||
'win32': 'winnt',
|
||||
@@ -82,6 +85,14 @@ export function getJuliaVersion(availableReleases: string[], versionInput: strin
|
||||
return versionInput
|
||||
}
|
||||
|
||||
if (versionInput == 'lts') {
|
||||
return getJuliaVersion(availableReleases, LTS_VERSION, false)
|
||||
}
|
||||
|
||||
if (versionInput == 'pre') {
|
||||
return getJuliaVersion(availableReleases, MAJOR_VERSION, true)
|
||||
}
|
||||
|
||||
// Use the highest available version that matches versionInput
|
||||
let version = semver.maxSatisfying(availableReleases, versionInput, {includePrerelease})
|
||||
if (version == null) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as exec from '@actions/exec'
|
||||
import * as tc from '@actions/tool-cache'
|
||||
|
||||
import * as fs from 'fs'
|
||||
|
||||
Reference in New Issue
Block a user