mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-16 13:06:55 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8954cf4cb4 |
@@ -40,11 +40,9 @@ You can either specify specific Julia versions or version ranges. If you specify
|
|||||||
#### Examples
|
#### Examples
|
||||||
|
|
||||||
- `1.2.0` is a valid semver version. The action will try to download exactly this version. If it's not available, the build step will fail.
|
- `1.2.0` is a valid semver version. The action will try to download exactly this version. If it's not available, the build step will fail.
|
||||||
- `1.0` is a version range that will match the highest available Julia version that starts with `1.0`, e.g. `1.0.5`, excluding pre-releases.
|
- `1.0` is a version range that will match the highest available Julia version that starts with `1.0`, e.g. `1.0.5`.
|
||||||
- `^1.3.0-rc1` is a **caret** version range that includes pre-releases starting at `rc1`. It matches all versions `≥ 1.3.0-rc1` and `< 2.0.0`.
|
- `^1.3.0-rc1` is a caret version range that includes pre-releases starting at `rc1`. It matches all versions `≥ 1.3.0-rc1` and `< 1.4.0`.
|
||||||
- `~1.3.0-rc1` is a **tilde** version range that includes pre-releases starting at `rc1`. It matches all versions `≥ 1.3.0-rc1` and `< 1.4.0`.
|
- `^1.3-0` is a caret version range that includes _all_ pre-releases. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
|
||||||
- `^1.3.0-0` is a **caret** version range that includes _all_ pre-releases. 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. It matches all versions `≥ 1.3.0-` and `< 1.4.0`.
|
|
||||||
- `nightly` will install the latest nightly build.
|
- `nightly` will install the latest nightly build.
|
||||||
|
|
||||||
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).
|
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).
|
||||||
|
|||||||
@@ -29,13 +29,6 @@ describe('installer tests', () => {
|
|||||||
expect(await installer.getJuliaVersion(testVersions, '^1.2.0-rc1')).toEqual('1.2.0')
|
expect(await installer.getJuliaVersion(testVersions, '^1.2.0-rc1')).toEqual('1.2.0')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
describe('invalid version range (#38)', () => {
|
|
||||||
it('Throws an error if a version range does not match any available version', () => {
|
|
||||||
expect(() => {
|
|
||||||
installer.getJuliaVersion(['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1'], '1.6')
|
|
||||||
}).toThrowError()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
describe('node-semver behaviour', () => {
|
describe('node-semver behaviour', () => {
|
||||||
describe('Windows installer change', () => {
|
describe('Windows installer change', () => {
|
||||||
|
|||||||
44
dist/index.js
vendored
44
dist/index.js
vendored
@@ -3854,22 +3854,24 @@ core.debug(`platform: ${osPlat}`);
|
|||||||
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
||||||
exports.juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2'];
|
exports.juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2'];
|
||||||
function getJuliaVersion(availableReleases, versionInput) {
|
function getJuliaVersion(availableReleases, versionInput) {
|
||||||
if (semver.valid(versionInput) == versionInput) {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// versionInput is a valid version, use it directly
|
if (semver.valid(versionInput) == versionInput) {
|
||||||
return versionInput;
|
// versionInput is a valid version, use it directly
|
||||||
}
|
return versionInput;
|
||||||
// nightlies
|
}
|
||||||
if (versionInput == 'nightly') {
|
// nightlies
|
||||||
return 'nightly';
|
if (versionInput == 'nightly') {
|
||||||
}
|
return 'nightly';
|
||||||
// Use the highest available version that matches versionInput
|
}
|
||||||
let version = semver.maxSatisfying(availableReleases, versionInput);
|
// Use the highest available version that matches versionInput
|
||||||
if (version == null) {
|
let version = semver.maxSatisfying(availableReleases, versionInput);
|
||||||
throw new Error(`Could not find a Julia version that matches ${versionInput}`);
|
if (version == null) {
|
||||||
}
|
throw `Could not find a Julia version that matches ${versionInput}`;
|
||||||
// GitHub tags start with v, remove it
|
}
|
||||||
version = version.replace(/^v/, '');
|
// GitHub tags start with v, remove it
|
||||||
return version;
|
version = version.replace(/^v/, '');
|
||||||
|
return version;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.getJuliaVersion = getJuliaVersion;
|
exports.getJuliaVersion = getJuliaVersion;
|
||||||
function getMajorMinorVersion(version) {
|
function getMajorMinorVersion(version) {
|
||||||
@@ -3882,7 +3884,7 @@ function getDownloadURL(version, arch) {
|
|||||||
}
|
}
|
||||||
else if (osPlat === 'darwin') { // macOS
|
else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS');
|
throw '32-bit Julia is not available on macOS';
|
||||||
}
|
}
|
||||||
platform = 'mac';
|
platform = 'mac';
|
||||||
}
|
}
|
||||||
@@ -3890,7 +3892,7 @@ function getDownloadURL(version, arch) {
|
|||||||
platform = 'linux';
|
platform = 'linux';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
// nightlies
|
// nightlies
|
||||||
if (version == 'nightly') {
|
if (version == 'nightly') {
|
||||||
@@ -3910,7 +3912,7 @@ function getFileName(version, arch) {
|
|||||||
}
|
}
|
||||||
else if (osPlat === 'darwin') { // macOS
|
else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS');
|
throw '32-bit Julia is not available on macOS';
|
||||||
}
|
}
|
||||||
versionExt = '-mac64';
|
versionExt = '-mac64';
|
||||||
ext = 'dmg';
|
ext = 'dmg';
|
||||||
@@ -3925,7 +3927,7 @@ function getFileName(version, arch) {
|
|||||||
ext = 'tar.gz';
|
ext = 'tar.gz';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
return `julia-${version}${versionExt}.${ext}`;
|
return `julia-${version}${versionExt}.${ext}`;
|
||||||
}
|
}
|
||||||
@@ -3958,7 +3960,7 @@ function installJulia(version, arch) {
|
|||||||
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`]);
|
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`]);
|
||||||
return `${process.env.HOME}/julia`;
|
return `${process.env.HOME}/julia`;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
44
lib/installer.js
generated
44
lib/installer.js
generated
@@ -27,22 +27,24 @@ core.debug(`platform: ${osPlat}`);
|
|||||||
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
||||||
exports.juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2'];
|
exports.juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2'];
|
||||||
function getJuliaVersion(availableReleases, versionInput) {
|
function getJuliaVersion(availableReleases, versionInput) {
|
||||||
if (semver.valid(versionInput) == versionInput) {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// versionInput is a valid version, use it directly
|
if (semver.valid(versionInput) == versionInput) {
|
||||||
return versionInput;
|
// versionInput is a valid version, use it directly
|
||||||
}
|
return versionInput;
|
||||||
// nightlies
|
}
|
||||||
if (versionInput == 'nightly') {
|
// nightlies
|
||||||
return 'nightly';
|
if (versionInput == 'nightly') {
|
||||||
}
|
return 'nightly';
|
||||||
// Use the highest available version that matches versionInput
|
}
|
||||||
let version = semver.maxSatisfying(availableReleases, versionInput);
|
// Use the highest available version that matches versionInput
|
||||||
if (version == null) {
|
let version = semver.maxSatisfying(availableReleases, versionInput);
|
||||||
throw new Error(`Could not find a Julia version that matches ${versionInput}`);
|
if (version == null) {
|
||||||
}
|
throw `Could not find a Julia version that matches ${versionInput}`;
|
||||||
// GitHub tags start with v, remove it
|
}
|
||||||
version = version.replace(/^v/, '');
|
// GitHub tags start with v, remove it
|
||||||
return version;
|
version = version.replace(/^v/, '');
|
||||||
|
return version;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
exports.getJuliaVersion = getJuliaVersion;
|
exports.getJuliaVersion = getJuliaVersion;
|
||||||
function getMajorMinorVersion(version) {
|
function getMajorMinorVersion(version) {
|
||||||
@@ -55,7 +57,7 @@ function getDownloadURL(version, arch) {
|
|||||||
}
|
}
|
||||||
else if (osPlat === 'darwin') { // macOS
|
else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS');
|
throw '32-bit Julia is not available on macOS';
|
||||||
}
|
}
|
||||||
platform = 'mac';
|
platform = 'mac';
|
||||||
}
|
}
|
||||||
@@ -63,7 +65,7 @@ function getDownloadURL(version, arch) {
|
|||||||
platform = 'linux';
|
platform = 'linux';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
// nightlies
|
// nightlies
|
||||||
if (version == 'nightly') {
|
if (version == 'nightly') {
|
||||||
@@ -83,7 +85,7 @@ function getFileName(version, arch) {
|
|||||||
}
|
}
|
||||||
else if (osPlat === 'darwin') { // macOS
|
else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS');
|
throw '32-bit Julia is not available on macOS';
|
||||||
}
|
}
|
||||||
versionExt = '-mac64';
|
versionExt = '-mac64';
|
||||||
ext = 'dmg';
|
ext = 'dmg';
|
||||||
@@ -98,7 +100,7 @@ function getFileName(version, arch) {
|
|||||||
ext = 'tar.gz';
|
ext = 'tar.gz';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
return `julia-${version}${versionExt}.${ext}`;
|
return `julia-${version}${versionExt}.${ext}`;
|
||||||
}
|
}
|
||||||
@@ -131,7 +133,7 @@ function installJulia(version, arch) {
|
|||||||
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`]);
|
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`]);
|
||||||
return `${process.env.HOME}/julia`;
|
return `${process.env.HOME}/julia`;
|
||||||
default:
|
default:
|
||||||
throw new Error(`Platform ${osPlat} is not supported`);
|
throw `Platform ${osPlat} is not supported`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-julia",
|
"name": "setup-julia",
|
||||||
"version": "1.1.9",
|
"version": "1.1.8",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-julia",
|
"name": "setup-julia",
|
||||||
"version": "1.1.9",
|
"version": "1.1.8",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup Julia action",
|
"description": "setup Julia action",
|
||||||
"main": "lib/setup-julia.js",
|
"main": "lib/setup-julia.js",
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ core.debug(`platform: ${osPlat}`)
|
|||||||
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
// This is temporary until we have a better way of fetching releases (see #1, #4 for details)
|
||||||
export const juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2']
|
export const juliaVersions = ['v1.5.0-rc1', 'v1.5.0-beta1', 'v1.4.2', 'v1.4.1', 'v1.4.0', 'v1.4.0-rc2', 'v1.4.0-rc1', 'v1.3.1', 'v1.3.0', 'v1.3.0-rc5', 'v1.3.0-rc4', 'v1.3.0-rc3', 'v1.3.0-rc2', 'v1.0.5', 'v1.2.0', 'v1.3.0-rc1', 'v1.2.0-rc3', 'v1.3.0-alpha', 'v1.2.0-rc2', 'v1.2.0-rc1', 'v1.1.1', 'v1.0.4', 'v1.1.0', 'v1.1.0-rc2', 'v1.1.0-rc1', 'v1.0.3', 'v1.0.2', 'v1.0.1', 'v1.0.0', 'v0.7.0', 'v1.0.0-rc1', 'v0.7.0-rc3', 'v0.7.0-rc2', 'v0.7.0-rc1', 'v0.7.0-beta2', 'v0.6.4', 'v0.7.0-beta', 'v0.7.0-alpha', 'v0.6.3', 'v0.6.2', 'v0.6.1', 'v0.6.0', 'v0.6.0-rc3', 'v0.6.0-rc2', 'v0.5.2', 'v0.6.0-rc1', 'v0.6.0-pre.beta', 'v0.5.1', 'v0.6.0-pre.alpha', 'v0.5.0', 'v0.4.7', 'v0.5.0-rc4', 'v0.5.0-rc3', 'v0.5.0-rc2', 'v0.5.0-rc1', 'v0.5.0-rc0', 'v0.4.6', 'v0.4.5', 'v0.4.4', 'v0.4.3', 'v0.4.2', 'v0.4.1', 'v0.3.12', 'v0.4.0', 'v0.4.0-rc4', 'v0.4.0-rc3', 'v0.4.0-rc2', 'v0.4.0-rc1', 'v0.3.11', 'v0.3.10', 'v0.3.9', 'v0.3.8', 'v0.3.7', 'v0.3.6', 'v0.3.5', 'v0.3.4', 'v0.3.3', 'v0.3.2', 'v0.3.1', 'v0.3.0', 'v0.3.0-rc4', 'v0.3.0-rc3', 'v0.3.0-rc2', 'v0.3.0-rc1', 'v0.2.0-rc1', 'v0.2.0-rc3', 'v0.2.0-rc4', 'v0.2.0', 'v0.2.0-rc2']
|
||||||
|
|
||||||
export function getJuliaVersion(availableReleases: string[], versionInput: string): string {
|
export async function getJuliaVersion(availableReleases: string[], versionInput: string): Promise<string> {
|
||||||
if (semver.valid(versionInput) == versionInput) {
|
if (semver.valid(versionInput) == versionInput) {
|
||||||
// versionInput is a valid version, use it directly
|
// versionInput is a valid version, use it directly
|
||||||
return versionInput
|
return versionInput
|
||||||
@@ -28,7 +28,7 @@ export function getJuliaVersion(availableReleases: string[], versionInput: strin
|
|||||||
// Use the highest available version that matches versionInput
|
// Use the highest available version that matches versionInput
|
||||||
let version = semver.maxSatisfying(availableReleases, versionInput)
|
let version = semver.maxSatisfying(availableReleases, versionInput)
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
throw new Error(`Could not find a Julia version that matches ${versionInput}`)
|
throw `Could not find a Julia version that matches ${versionInput}`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GitHub tags start with v, remove it
|
// GitHub tags start with v, remove it
|
||||||
@@ -48,13 +48,13 @@ function getDownloadURL(version: string, arch: string): string {
|
|||||||
platform = 'winnt'
|
platform = 'winnt'
|
||||||
} else if (osPlat === 'darwin') { // macOS
|
} else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS')
|
throw '32-bit Julia is not available on macOS'
|
||||||
}
|
}
|
||||||
platform = 'mac'
|
platform = 'mac'
|
||||||
} else if (osPlat === 'linux') { // Linux
|
} else if (osPlat === 'linux') { // Linux
|
||||||
platform = 'linux'
|
platform = 'linux'
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`)
|
throw `Platform ${osPlat} is not supported`
|
||||||
}
|
}
|
||||||
|
|
||||||
// nightlies
|
// nightlies
|
||||||
@@ -78,7 +78,7 @@ function getFileName(version: string, arch: string): string {
|
|||||||
ext = 'exe'
|
ext = 'exe'
|
||||||
} else if (osPlat === 'darwin') { // macOS
|
} else if (osPlat === 'darwin') { // macOS
|
||||||
if (arch == 'x86') {
|
if (arch == 'x86') {
|
||||||
throw new Error('32-bit Julia is not available on macOS')
|
throw '32-bit Julia is not available on macOS'
|
||||||
}
|
}
|
||||||
versionExt = '-mac64'
|
versionExt = '-mac64'
|
||||||
ext = 'dmg'
|
ext = 'dmg'
|
||||||
@@ -90,7 +90,7 @@ function getFileName(version: string, arch: string): string {
|
|||||||
}
|
}
|
||||||
ext = 'tar.gz'
|
ext = 'tar.gz'
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Platform ${osPlat} is not supported`)
|
throw `Platform ${osPlat} is not supported`
|
||||||
}
|
}
|
||||||
|
|
||||||
return `julia-${version}${versionExt}.${ext}`
|
return `julia-${version}${versionExt}.${ext}`
|
||||||
@@ -124,6 +124,6 @@ export async function installJulia(version: string, arch: string): Promise<strin
|
|||||||
await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`])
|
await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${process.env.HOME}`])
|
||||||
return `${process.env.HOME}/julia`
|
return `${process.env.HOME}/julia`
|
||||||
default:
|
default:
|
||||||
throw new Error(`Platform ${osPlat} is not supported`)
|
throw `Platform ${osPlat} is not supported`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user