Skip to content

Commit

Permalink
add a 'pre' version
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed Apr 15, 2024
1 parent 9389e98 commit 5ff92a2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ You can either specify specific Julia versions or version ranges. If you specify
- `'^1.3.0-0'` is a **caret** version range that includes _all_ pre-releases of `1.3.0`. It matches all versions `≥ 1.3.0-` and `< 2.0.0`.
- `'~1.3.0-0'` is a **tilde** version range that includes _all_ pre-releases of `1.3.0`. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
- `'lts'` will install the latest LTS build.
- `'pre'` will install the latest prerelease build.
- `'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.

Expand Down
4 changes: 4 additions & 0 deletions __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ describe('version matching tests', () => {
expect(installer.getJuliaVersion(testVersions, 'lts')).toEqual(installer.getJuliaVersion(testVersions, '1.6'))
expect(installer.getJuliaVersion(testVersions, 'lts')).toEqual('1.6.7')
})

it('pre', () => {
expect(installer.getJuliaVersion(testVersions, 'pre')).toEqual('1.11.0-beta1')
})
})

describe('version ranges', () => {
Expand Down
4 changes: 4 additions & 0 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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 = {
Expand Down Expand Up @@ -87,6 +88,9 @@ export function getJuliaVersion(availableReleases: string[], versionInput: strin
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
Expand Down

0 comments on commit 5ff92a2

Please sign in to comment.