mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-12 19:16:54 +08:00
Compare commits
2 Commits
v2.3.0
...
releases/v
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3645a07f58 | ||
|
|
d56bd397bb |
2
.github/workflows/checkin.yml
vendored
2
.github/workflows/checkin.yml
vendored
@@ -31,6 +31,6 @@ jobs:
|
||||
# Ensure no changes, but ignore node_modules dir since dev/fresh ci deps installed.
|
||||
run: |
|
||||
git diff --exit-code --stat -- . ':!node_modules' \
|
||||
|| (echo "##[error] found changed files after build. please 'npm ci && npm run build'" \
|
||||
|| (echo "##[error] found changed files after build. please 'npm run build && npm run format'" \
|
||||
"and check in all changes" \
|
||||
&& exit 1)
|
||||
|
||||
3
.github/workflows/example-builds.yml
vendored
3
.github/workflows/example-builds.yml
vendored
@@ -19,8 +19,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# include '1.6' here to test info message about lts tag existing
|
||||
julia-version: ['1.0.5', '1.2', '^1.5.0-beta1', '1', '1.6', 'lts', 'pre']
|
||||
julia-version: ['1.0.5', '1.2', '^1.5.0-beta1', '1', 'lts', 'pre']
|
||||
julia-arch: [x64, x86]
|
||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||
# 32-bit Julia binaries are not available on macOS
|
||||
|
||||
34
README.md
34
README.md
@@ -5,25 +5,17 @@
|
||||
This action sets up a Julia environment for use in actions by downloading a specified version of Julia and adding it to PATH.
|
||||
|
||||
## Table of Contents
|
||||
- [setup-julia Action](#setup-julia-action)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Usage](#usage)
|
||||
- [Inputs](#inputs)
|
||||
- [Outputs](#outputs)
|
||||
- [Basic](#basic)
|
||||
- [Julia Versions](#julia-versions)
|
||||
- [Examples](#examples)
|
||||
- [Prereleases](#prereleases)
|
||||
- [Recently released versions](#recently-released-versions)
|
||||
- [Matrix Testing](#matrix-testing)
|
||||
- [64-bit Julia only](#64-bit-julia-only)
|
||||
- [32-bit Julia](#32-bit-julia)
|
||||
- [versioninfo](#versioninfo)
|
||||
- [Versioning](#versioning)
|
||||
- [Using Dependabot version updates to keep your GitHub Actions up to date](#using-dependabot-version-updates-to-keep-your-github-actions-up-to-date)
|
||||
- [Debug logs](#debug-logs)
|
||||
- [Third party information](#third-party-information)
|
||||
- [Contributing to this repo](#contributing-to-this-repo)
|
||||
- [Table of Contents](#table-of-contents)
|
||||
- [Usage](#usage)
|
||||
- [Inputs](#inputs)
|
||||
- [Outputs](#outputs)
|
||||
- [Basic](#basic)
|
||||
- [Julia Versions](#julia-versions)
|
||||
- [Matrix Testing](#matrix-testing)
|
||||
- [versioninfo](#versioninfo)
|
||||
- [Versioning](#versioning)
|
||||
- [Debug logs](#debug-logs)
|
||||
- [Third party information](#third-party-information)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -38,7 +30,7 @@ This action sets up a Julia environment for use in actions by downloading a spec
|
||||
# Warning: It is strongly recommended to wrap this value in quotes.
|
||||
# Otherwise, the YAML parser used by GitHub Actions parses certain
|
||||
# versions as numbers which causes the wrong version to be selected.
|
||||
# For example, `1.10` may be parsed as `1.1`.
|
||||
# For example, `1.0` may be parsed as `1`.
|
||||
#
|
||||
# Default: '1'
|
||||
version: ''
|
||||
@@ -118,7 +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 (RCs, betas, and alphas).
|
||||
- `'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.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
name: 'Setup Julia environment'
|
||||
description: 'Setup a Julia environment and add it to the PATH'
|
||||
author: 'Sascha Mann'
|
||||
inputs:
|
||||
inputs:
|
||||
version:
|
||||
description: 'The Julia version to download (if necessary) and use. Use a string input to avoid unwanted decimal conversion e.g. 1.10 without quotes will be interpreted as 1.1. Examples: "1", "1.10", "lts", "pre"'
|
||||
description: 'The Julia version to download (if necessary) and use. Example: 1.0.4'
|
||||
default: '1'
|
||||
include-all-prereleases:
|
||||
description: 'Include prereleases when matching the Julia version to available versions.'
|
||||
@@ -12,7 +12,7 @@ inputs:
|
||||
arch:
|
||||
description: 'Architecture of the Julia binaries. Defaults to the architecture of the runner executing the job.'
|
||||
required: false
|
||||
default: 'default'
|
||||
default: '${{ runner.arch }}'
|
||||
show-versioninfo:
|
||||
description: 'Display InteractiveUtils.versioninfo() after installing'
|
||||
required: false
|
||||
|
||||
2
bin
2
bin
Submodule bin updated: 874bfe398c...31b4b500a3
115
dist/index.js
vendored
115
dist/index.js
vendored
@@ -39,13 +39,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getJuliaVersionInfo = getJuliaVersionInfo;
|
||||
exports.getJuliaVersions = getJuliaVersions;
|
||||
exports.getJuliaVersion = getJuliaVersion;
|
||||
exports.getFileInfo = getFileInfo;
|
||||
exports.getDownloadURL = getDownloadURL;
|
||||
exports.installJulia = installJulia;
|
||||
exports.showVersionInfo = showVersionInfo;
|
||||
exports.showVersionInfo = exports.installJulia = exports.getDownloadURL = exports.getFileInfo = exports.getJuliaVersion = exports.getJuliaVersions = exports.getJuliaVersionInfo = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const exec = __importStar(__nccwpck_require__(1514));
|
||||
const tc = __importStar(__nccwpck_require__(7784));
|
||||
@@ -107,6 +101,7 @@ function getJuliaVersionInfo() {
|
||||
return JSON.parse(fs.readFileSync(versionsFile).toString());
|
||||
});
|
||||
}
|
||||
exports.getJuliaVersionInfo = getJuliaVersionInfo;
|
||||
/**
|
||||
* @returns An array of all Julia versions available for download
|
||||
*/
|
||||
@@ -119,6 +114,7 @@ function getJuliaVersions(versionInfo) {
|
||||
return versions;
|
||||
});
|
||||
}
|
||||
exports.getJuliaVersions = getJuliaVersions;
|
||||
function getJuliaVersion(availableReleases, versionInput, includePrerelease = false) {
|
||||
if (semver.valid(versionInput) == versionInput || versionInput.endsWith('nightly')) {
|
||||
// versionInput is a valid version or a nightly version, use it directly
|
||||
@@ -139,6 +135,7 @@ function getJuliaVersion(availableReleases, versionInput, includePrerelease = fa
|
||||
version = version.replace(/^v/, '');
|
||||
return version;
|
||||
}
|
||||
exports.getJuliaVersion = getJuliaVersion;
|
||||
function getDesiredFileExts() {
|
||||
let fileExt1;
|
||||
let hasFileExt2;
|
||||
@@ -224,7 +221,6 @@ function getFileInfo(versionInfo, version, arch) {
|
||||
return null;
|
||||
}
|
||||
if (!versionInfo[version]) {
|
||||
core.error(`Encountered error: ${err}`);
|
||||
throw err;
|
||||
}
|
||||
for (let file of versionInfo[version].files) {
|
||||
@@ -243,35 +239,10 @@ function getFileInfo(versionInfo, version, arch) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// The following block is just to provide improved log messages in the CI logs.
|
||||
// We specifically want to improve the case where someone is trying to install
|
||||
// Julia 1.6 or 1.7 on Apple Silicon (aarch64) macOS.
|
||||
{
|
||||
const one_fileext_is_targz = (fileExt1 == "tar.gz") || (fileExt2 == "tar.gz");
|
||||
const one_fileext_is_dmg = (fileExt1 == "dmg") || (fileExt2 == "dmg");
|
||||
const one_fileext_is_targz_and_other_is_dmg = one_fileext_is_targz && one_fileext_is_dmg;
|
||||
// We say that "this Julia version does NOT have native binaries for Apple Silicon"
|
||||
// if and only if "this Julia version is < 1.8.0"
|
||||
const this_julia_version_does_NOT_have_native_binaries_for_apple_silicon = semver.lt(version, '1.8.0');
|
||||
const this_is_macos = osPlat == 'darwin';
|
||||
if (this_is_macos && one_fileext_is_targz_and_other_is_dmg && this_julia_version_does_NOT_have_native_binaries_for_apple_silicon) {
|
||||
const msg = `It looks like you are trying to install Julia 1.6 or 1.7 on ` +
|
||||
`the "macos-latest" runners.\n` +
|
||||
`"macos-latest" now resolves to "macos-14", which run on Apple ` +
|
||||
`Silicon (aarch64) macOS machines.\n` +
|
||||
`Unfortunately, Julia 1.6 and 1.7 do not have native binaries ` +
|
||||
`available for Apple Silicon macOS.\n` +
|
||||
`Therefore, it is not possible to install Julia with the current ` +
|
||||
`constraints.\n` +
|
||||
`For instructions on how to fix this error, please see the following Discourse post: ` +
|
||||
`https://discourse.julialang.org/t/how-to-fix-github-actions-ci-failures-with-julia-1-6-or-1-7-on-macos-latest-and-macos-14/117019`;
|
||||
core.error(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
core.error(`Encountered error: ${err}`);
|
||||
throw err;
|
||||
}
|
||||
exports.getFileInfo = getFileInfo;
|
||||
function getDownloadURL(fileInfo, version, arch) {
|
||||
const baseURL = `https://julialangnightlies-s3.julialang.org/bin/${osMap[osPlat]}/${arch}`;
|
||||
// release branch nightlies, e.g. 1.6-nightlies should return .../bin/linux/x64/1.6/julia-latest-linux64.tar.gz
|
||||
@@ -289,6 +260,7 @@ function getDownloadURL(fileInfo, version, arch) {
|
||||
}
|
||||
return fileInfo.url;
|
||||
}
|
||||
exports.getDownloadURL = getDownloadURL;
|
||||
function installJulia(dest, versionInfo, version, arch) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Download Julia
|
||||
@@ -356,6 +328,7 @@ function installJulia(dest, versionInfo, version, arch) {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.installJulia = installJulia;
|
||||
/**
|
||||
* Test if Julia has been installed and print the version.
|
||||
*
|
||||
@@ -392,6 +365,7 @@ function showVersionInfo(showVersionInfoInput, version) {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.showVersionInfo = showVersionInfo;
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -438,17 +412,15 @@ const core = __importStar(__nccwpck_require__(2186));
|
||||
const tc = __importStar(__nccwpck_require__(7784));
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const https = __importStar(__nccwpck_require__(5687));
|
||||
const os = __importStar(__nccwpck_require__(2037));
|
||||
const path = __importStar(__nccwpck_require__(1017));
|
||||
const installer = __importStar(__nccwpck_require__(1480));
|
||||
// Note: before we index into this dict, we always first do `.toLowerCase()` on
|
||||
// the key.
|
||||
//
|
||||
// Therefore, this dict does not need to account for differences in case.
|
||||
const archSynonyms = {
|
||||
'x86': 'x86',
|
||||
'X86': 'x86',
|
||||
'x64': 'x64',
|
||||
'X64': 'x64',
|
||||
'aarch64': 'aarch64',
|
||||
'ARM64': 'aarch64',
|
||||
'arm64': 'aarch64'
|
||||
};
|
||||
function run() {
|
||||
@@ -469,39 +441,22 @@ function run() {
|
||||
core.debug(`ERROR: Could not retrieve runner IP: ${err}`);
|
||||
});
|
||||
}
|
||||
// Inputs.
|
||||
// Note that we intentionally strip leading and lagging whitespace by using `.trim()`
|
||||
const versionInput = core.getInput('version').trim();
|
||||
const includePrereleases = core.getInput('include-all-prereleases').trim() == 'true';
|
||||
const originalArchInput = core.getInput('arch').trim();
|
||||
// Inputs
|
||||
const versionInput = core.getInput('version');
|
||||
const includePrereleases = core.getInput('include-all-prereleases') == 'true';
|
||||
const originalArchInput = core.getInput('arch');
|
||||
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
|
||||
// while the strategy matrix only contains a key `${{ matrix.version }}`.
|
||||
// In that case, we want the action to fail, rather than trying to download julia from an URL that's missing parts and 404ing.
|
||||
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
|
||||
// is worse than failing the build.
|
||||
if (!versionInput) { // if `versionInput` is an empty string
|
||||
if (!versionInput) {
|
||||
throw new Error('Version input must not be null');
|
||||
}
|
||||
if (versionInput == '1.6') {
|
||||
core.notice('[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.');
|
||||
}
|
||||
if (!originalArchInput) { // if `originalArchInput` is an empty string
|
||||
if (!originalArchInput) {
|
||||
throw new Error(`Arch input must not be null`);
|
||||
}
|
||||
let processedArchInput;
|
||||
if (originalArchInput == "default") {
|
||||
// If the user sets the `arch` input to `default`, then we use the
|
||||
// architecture of the machine that we are running on.
|
||||
processedArchInput = os.arch();
|
||||
core.debug(`The "arch" input is "default", so we will use the machine arch: ${processedArchInput}`);
|
||||
}
|
||||
else {
|
||||
processedArchInput = originalArchInput;
|
||||
}
|
||||
// Note: we convert the key `processedArchInput` to lower case
|
||||
// before we index into the `archSynonyms` dict.
|
||||
const arch = archSynonyms[processedArchInput.toLowerCase()];
|
||||
core.debug(`Mapped the "arch" from ${processedArchInput} to ${arch}`);
|
||||
const arch = archSynonyms[originalArchInput];
|
||||
const versionInfo = yield installer.getJuliaVersionInfo();
|
||||
const availableReleases = yield installer.getJuliaVersions(versionInfo);
|
||||
const version = installer.getJuliaVersion(availableReleases, versionInput, includePrereleases);
|
||||
@@ -7233,8 +7188,6 @@ const Range = __nccwpck_require__(9828)
|
||||
/***/ 9828:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const SPACE_CHARACTERS = /\s+/g
|
||||
|
||||
// hoisted class for cyclic dependency
|
||||
class Range {
|
||||
constructor (range, options) {
|
||||
@@ -7255,7 +7208,7 @@ class Range {
|
||||
// just put it in the set and return
|
||||
this.raw = range.value
|
||||
this.set = [[range]]
|
||||
this.formatted = undefined
|
||||
this.format()
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -7266,7 +7219,10 @@ class Range {
|
||||
// First reduce all whitespace as much as possible so we do not have to rely
|
||||
// on potentially slow regexes like \s*. This is then stored and used for
|
||||
// future error messages as well.
|
||||
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
|
||||
this.raw = range
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.join(' ')
|
||||
|
||||
// First, split on ||
|
||||
this.set = this.raw
|
||||
@@ -7300,29 +7256,14 @@ class Range {
|
||||
}
|
||||
}
|
||||
|
||||
this.formatted = undefined
|
||||
}
|
||||
|
||||
get range () {
|
||||
if (this.formatted === undefined) {
|
||||
this.formatted = ''
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (i > 0) {
|
||||
this.formatted += '||'
|
||||
}
|
||||
const comps = this.set[i]
|
||||
for (let k = 0; k < comps.length; k++) {
|
||||
if (k > 0) {
|
||||
this.formatted += ' '
|
||||
}
|
||||
this.formatted += comps[k].toString().trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.formatted
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.range = this.set
|
||||
.map((comps) => comps.join(' ').trim())
|
||||
.join('||')
|
||||
.trim()
|
||||
return this.range
|
||||
}
|
||||
|
||||
|
||||
42
lib/installer.js
generated
42
lib/installer.js
generated
@@ -32,13 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getJuliaVersionInfo = getJuliaVersionInfo;
|
||||
exports.getJuliaVersions = getJuliaVersions;
|
||||
exports.getJuliaVersion = getJuliaVersion;
|
||||
exports.getFileInfo = getFileInfo;
|
||||
exports.getDownloadURL = getDownloadURL;
|
||||
exports.installJulia = installJulia;
|
||||
exports.showVersionInfo = showVersionInfo;
|
||||
exports.showVersionInfo = exports.installJulia = exports.getDownloadURL = exports.getFileInfo = exports.getJuliaVersion = exports.getJuliaVersions = exports.getJuliaVersionInfo = void 0;
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const exec = __importStar(require("@actions/exec"));
|
||||
const tc = __importStar(require("@actions/tool-cache"));
|
||||
@@ -100,6 +94,7 @@ function getJuliaVersionInfo() {
|
||||
return JSON.parse(fs.readFileSync(versionsFile).toString());
|
||||
});
|
||||
}
|
||||
exports.getJuliaVersionInfo = getJuliaVersionInfo;
|
||||
/**
|
||||
* @returns An array of all Julia versions available for download
|
||||
*/
|
||||
@@ -112,6 +107,7 @@ function getJuliaVersions(versionInfo) {
|
||||
return versions;
|
||||
});
|
||||
}
|
||||
exports.getJuliaVersions = getJuliaVersions;
|
||||
function getJuliaVersion(availableReleases, versionInput, includePrerelease = false) {
|
||||
if (semver.valid(versionInput) == versionInput || versionInput.endsWith('nightly')) {
|
||||
// versionInput is a valid version or a nightly version, use it directly
|
||||
@@ -132,6 +128,7 @@ function getJuliaVersion(availableReleases, versionInput, includePrerelease = fa
|
||||
version = version.replace(/^v/, '');
|
||||
return version;
|
||||
}
|
||||
exports.getJuliaVersion = getJuliaVersion;
|
||||
function getDesiredFileExts() {
|
||||
let fileExt1;
|
||||
let hasFileExt2;
|
||||
@@ -217,7 +214,6 @@ function getFileInfo(versionInfo, version, arch) {
|
||||
return null;
|
||||
}
|
||||
if (!versionInfo[version]) {
|
||||
core.error(`Encountered error: ${err}`);
|
||||
throw err;
|
||||
}
|
||||
for (let file of versionInfo[version].files) {
|
||||
@@ -236,35 +232,10 @@ function getFileInfo(versionInfo, version, arch) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// The following block is just to provide improved log messages in the CI logs.
|
||||
// We specifically want to improve the case where someone is trying to install
|
||||
// Julia 1.6 or 1.7 on Apple Silicon (aarch64) macOS.
|
||||
{
|
||||
const one_fileext_is_targz = (fileExt1 == "tar.gz") || (fileExt2 == "tar.gz");
|
||||
const one_fileext_is_dmg = (fileExt1 == "dmg") || (fileExt2 == "dmg");
|
||||
const one_fileext_is_targz_and_other_is_dmg = one_fileext_is_targz && one_fileext_is_dmg;
|
||||
// We say that "this Julia version does NOT have native binaries for Apple Silicon"
|
||||
// if and only if "this Julia version is < 1.8.0"
|
||||
const this_julia_version_does_NOT_have_native_binaries_for_apple_silicon = semver.lt(version, '1.8.0');
|
||||
const this_is_macos = osPlat == 'darwin';
|
||||
if (this_is_macos && one_fileext_is_targz_and_other_is_dmg && this_julia_version_does_NOT_have_native_binaries_for_apple_silicon) {
|
||||
const msg = `It looks like you are trying to install Julia 1.6 or 1.7 on ` +
|
||||
`the "macos-latest" runners.\n` +
|
||||
`"macos-latest" now resolves to "macos-14", which run on Apple ` +
|
||||
`Silicon (aarch64) macOS machines.\n` +
|
||||
`Unfortunately, Julia 1.6 and 1.7 do not have native binaries ` +
|
||||
`available for Apple Silicon macOS.\n` +
|
||||
`Therefore, it is not possible to install Julia with the current ` +
|
||||
`constraints.\n` +
|
||||
`For instructions on how to fix this error, please see the following Discourse post: ` +
|
||||
`https://discourse.julialang.org/t/how-to-fix-github-actions-ci-failures-with-julia-1-6-or-1-7-on-macos-latest-and-macos-14/117019`;
|
||||
core.error(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
core.error(`Encountered error: ${err}`);
|
||||
throw err;
|
||||
}
|
||||
exports.getFileInfo = getFileInfo;
|
||||
function getDownloadURL(fileInfo, version, arch) {
|
||||
const baseURL = `https://julialangnightlies-s3.julialang.org/bin/${osMap[osPlat]}/${arch}`;
|
||||
// release branch nightlies, e.g. 1.6-nightlies should return .../bin/linux/x64/1.6/julia-latest-linux64.tar.gz
|
||||
@@ -282,6 +253,7 @@ function getDownloadURL(fileInfo, version, arch) {
|
||||
}
|
||||
return fileInfo.url;
|
||||
}
|
||||
exports.getDownloadURL = getDownloadURL;
|
||||
function installJulia(dest, versionInfo, version, arch) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// Download Julia
|
||||
@@ -349,6 +321,7 @@ function installJulia(dest, versionInfo, version, arch) {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.installJulia = installJulia;
|
||||
/**
|
||||
* Test if Julia has been installed and print the version.
|
||||
*
|
||||
@@ -385,3 +358,4 @@ function showVersionInfo(showVersionInfoInput, version) {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.showVersionInfo = showVersionInfo;
|
||||
|
||||
39
lib/setup-julia.js
generated
39
lib/setup-julia.js
generated
@@ -36,17 +36,15 @@ const core = __importStar(require("@actions/core"));
|
||||
const tc = __importStar(require("@actions/tool-cache"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const https = __importStar(require("https"));
|
||||
const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
const installer = __importStar(require("./installer"));
|
||||
// Note: before we index into this dict, we always first do `.toLowerCase()` on
|
||||
// the key.
|
||||
//
|
||||
// Therefore, this dict does not need to account for differences in case.
|
||||
const archSynonyms = {
|
||||
'x86': 'x86',
|
||||
'X86': 'x86',
|
||||
'x64': 'x64',
|
||||
'X64': 'x64',
|
||||
'aarch64': 'aarch64',
|
||||
'ARM64': 'aarch64',
|
||||
'arm64': 'aarch64'
|
||||
};
|
||||
function run() {
|
||||
@@ -67,39 +65,22 @@ function run() {
|
||||
core.debug(`ERROR: Could not retrieve runner IP: ${err}`);
|
||||
});
|
||||
}
|
||||
// Inputs.
|
||||
// Note that we intentionally strip leading and lagging whitespace by using `.trim()`
|
||||
const versionInput = core.getInput('version').trim();
|
||||
const includePrereleases = core.getInput('include-all-prereleases').trim() == 'true';
|
||||
const originalArchInput = core.getInput('arch').trim();
|
||||
// Inputs
|
||||
const versionInput = core.getInput('version');
|
||||
const includePrereleases = core.getInput('include-all-prereleases') == 'true';
|
||||
const originalArchInput = core.getInput('arch');
|
||||
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
|
||||
// while the strategy matrix only contains a key `${{ matrix.version }}`.
|
||||
// In that case, we want the action to fail, rather than trying to download julia from an URL that's missing parts and 404ing.
|
||||
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
|
||||
// is worse than failing the build.
|
||||
if (!versionInput) { // if `versionInput` is an empty string
|
||||
if (!versionInput) {
|
||||
throw new Error('Version input must not be null');
|
||||
}
|
||||
if (versionInput == '1.6') {
|
||||
core.notice('[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.');
|
||||
}
|
||||
if (!originalArchInput) { // if `originalArchInput` is an empty string
|
||||
if (!originalArchInput) {
|
||||
throw new Error(`Arch input must not be null`);
|
||||
}
|
||||
let processedArchInput;
|
||||
if (originalArchInput == "default") {
|
||||
// If the user sets the `arch` input to `default`, then we use the
|
||||
// architecture of the machine that we are running on.
|
||||
processedArchInput = os.arch();
|
||||
core.debug(`The "arch" input is "default", so we will use the machine arch: ${processedArchInput}`);
|
||||
}
|
||||
else {
|
||||
processedArchInput = originalArchInput;
|
||||
}
|
||||
// Note: we convert the key `processedArchInput` to lower case
|
||||
// before we index into the `archSynonyms` dict.
|
||||
const arch = archSynonyms[processedArchInput.toLowerCase()];
|
||||
core.debug(`Mapped the "arch" from ${processedArchInput} to ${arch}`);
|
||||
const arch = archSynonyms[originalArchInput];
|
||||
const versionInfo = yield installer.getJuliaVersionInfo();
|
||||
const availableReleases = yield installer.getJuliaVersions(versionInfo);
|
||||
const version = installer.getJuliaVersion(availableReleases, versionInput, includePrereleases);
|
||||
|
||||
322
package-lock.json
generated
322
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "setup-julia",
|
||||
"version": "2.3.0",
|
||||
"version": "2.2.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-julia",
|
||||
"version": "2.3.0",
|
||||
"version": "2.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
@@ -14,21 +14,21 @@
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"async-retry": "^1.3.3",
|
||||
"semver": "^7.6.3"
|
||||
"semver": "^7.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async-retry": "^1.4.8",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.14.11",
|
||||
"@types/node": "^20.14.6",
|
||||
"@types/retry": "^0.12.5",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"nock": "^13.5.4",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.2.3",
|
||||
"typescript": "^5.5.3"
|
||||
"prettier": "^3.3.2",
|
||||
"ts-jest": "^29.1.5",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
@@ -1467,9 +1467,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.14.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz",
|
||||
"integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==",
|
||||
"version": "20.14.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz",
|
||||
"integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
@@ -1575,12 +1575,6 @@
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/async": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
||||
"integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/async-retry": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz",
|
||||
@@ -2137,21 +2131,6 @@
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ejs": {
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"jake": "^10.8.5"
|
||||
},
|
||||
"bin": {
|
||||
"ejs": "bin/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.292",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.292.tgz",
|
||||
@@ -2279,36 +2258,6 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/filelist": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",
|
||||
"integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimatch": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/filelist/node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/filelist/node_modules/minimatch": {
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
@@ -2673,94 +2622,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jake": {
|
||||
"version": "10.9.2",
|
||||
"resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz",
|
||||
"integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"async": "^3.2.3",
|
||||
"chalk": "^4.0.2",
|
||||
"filelist": "^1.0.4",
|
||||
"minimatch": "^3.1.2"
|
||||
},
|
||||
"bin": {
|
||||
"jake": "bin/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jake/node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jake/node_modules/supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||
@@ -4724,9 +4585,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"prettier": "bin/prettier.cjs"
|
||||
@@ -4879,9 +4740,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
|
||||
"version": "7.6.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
|
||||
"integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
@@ -5112,13 +4973,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ts-jest": {
|
||||
"version": "29.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.3.tgz",
|
||||
"integrity": "sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==",
|
||||
"version": "29.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.5.tgz",
|
||||
"integrity": "sha512-UuClSYxM7byvvYfyWdFI+/2UxMmwNyJb0NPkZPQE2hew3RurV7l7zURgOHAd/1I1ZdPpe3GUsXNXAcN8TFKSIg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"bs-logger": "0.x",
|
||||
"ejs": "^3.1.10",
|
||||
"fast-json-stable-stringify": "2.x",
|
||||
"jest-util": "^29.0.0",
|
||||
"json5": "^2.2.3",
|
||||
@@ -5189,9 +5049,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
|
||||
"integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
@@ -6540,9 +6400,9 @@
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "20.14.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz",
|
||||
"integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==",
|
||||
"version": "20.14.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.6.tgz",
|
||||
"integrity": "sha512-JbA0XIJPL1IiNnU7PFxDXyfAwcwVVrOoqyzzyQTyMeVhBzkJVMSkC1LlVsRQ2lpqiY4n6Bb9oCS6lzDKVQxbZw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"undici-types": "~5.26.4"
|
||||
@@ -6630,12 +6490,6 @@
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"async": {
|
||||
"version": "3.2.5",
|
||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
||||
"integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==",
|
||||
"dev": true
|
||||
},
|
||||
"async-retry": {
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz",
|
||||
@@ -7037,15 +6891,6 @@
|
||||
"integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==",
|
||||
"dev": true
|
||||
},
|
||||
"ejs": {
|
||||
"version": "3.1.10",
|
||||
"resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz",
|
||||
"integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"jake": "^10.8.5"
|
||||
}
|
||||
},
|
||||
"electron-to-chromium": {
|
||||
"version": "1.4.292",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.292.tgz",
|
||||
@@ -7142,35 +6987,6 @@
|
||||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"filelist": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz",
|
||||
"integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimatch": "^5.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "5.1.6",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz",
|
||||
"integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
@@ -7439,69 +7255,6 @@
|
||||
"istanbul-lib-report": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"jake": {
|
||||
"version": "10.9.2",
|
||||
"resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz",
|
||||
"integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async": "^3.2.3",
|
||||
"chalk": "^4.0.2",
|
||||
"filelist": "^1.0.4",
|
||||
"minimatch": "^3.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "~1.1.4"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^4.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"jest": {
|
||||
"version": "29.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||
@@ -8962,9 +8715,9 @@
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
|
||||
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz",
|
||||
"integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==",
|
||||
"dev": true
|
||||
},
|
||||
"pretty-format": {
|
||||
@@ -9064,9 +8817,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.6.3",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
|
||||
"integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A=="
|
||||
"version": "7.6.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz",
|
||||
"integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w=="
|
||||
},
|
||||
"shebang-command": {
|
||||
"version": "2.0.0",
|
||||
@@ -9236,13 +8989,12 @@
|
||||
}
|
||||
},
|
||||
"ts-jest": {
|
||||
"version": "29.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.3.tgz",
|
||||
"integrity": "sha512-yCcfVdiBFngVz9/keHin9EnsrQtQtEu3nRykNy9RVp+FiPFFbPJ3Sg6Qg4+TkmH0vMP5qsTKgXSsk80HRwvdgQ==",
|
||||
"version": "29.1.5",
|
||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.5.tgz",
|
||||
"integrity": "sha512-UuClSYxM7byvvYfyWdFI+/2UxMmwNyJb0NPkZPQE2hew3RurV7l7zURgOHAd/1I1ZdPpe3GUsXNXAcN8TFKSIg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"bs-logger": "0.x",
|
||||
"ejs": "^3.1.10",
|
||||
"fast-json-stable-stringify": "2.x",
|
||||
"jest-util": "^29.0.0",
|
||||
"json5": "^2.2.3",
|
||||
@@ -9270,9 +9022,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "5.5.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.3.tgz",
|
||||
"integrity": "sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true
|
||||
},
|
||||
"undici-types": {
|
||||
|
||||
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-julia",
|
||||
"version": "2.3.0",
|
||||
"version": "2.2.0",
|
||||
"private": true,
|
||||
"description": "setup Julia action",
|
||||
"main": "lib/setup-julia.js",
|
||||
@@ -26,20 +26,20 @@
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"async-retry": "^1.3.3",
|
||||
"semver": "^7.6.3"
|
||||
"semver": "^7.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/async-retry": "^1.4.8",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^20.14.11",
|
||||
"@types/node": "^20.14.6",
|
||||
"@types/retry": "^0.12.5",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"jest": "^29.7.0",
|
||||
"jest-circus": "^29.7.0",
|
||||
"nock": "^13.5.4",
|
||||
"prettier": "^3.3.3",
|
||||
"ts-jest": "^29.2.3",
|
||||
"typescript": "^5.5.3"
|
||||
"prettier": "^3.3.2",
|
||||
"ts-jest": "^29.1.5",
|
||||
"typescript": "^5.4.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,7 +184,6 @@ export function getFileInfo(versionInfo, version: string, arch: string) {
|
||||
}
|
||||
|
||||
if (!versionInfo[version]) {
|
||||
core.error(`Encountered error: ${err}`)
|
||||
throw err
|
||||
}
|
||||
|
||||
@@ -205,39 +204,8 @@ export function getFileInfo(versionInfo, version: string, arch: string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The following block is just to provide improved log messages in the CI logs.
|
||||
// We specifically want to improve the case where someone is trying to install
|
||||
// Julia 1.6 or 1.7 on Apple Silicon (aarch64) macOS.
|
||||
{
|
||||
const one_fileext_is_targz = (fileExt1 == "tar.gz") || (fileExt2 == "tar.gz");
|
||||
const one_fileext_is_dmg = (fileExt1 == "dmg") || (fileExt2 == "dmg");
|
||||
const one_fileext_is_targz_and_other_is_dmg = one_fileext_is_targz && one_fileext_is_dmg;
|
||||
|
||||
// We say that "this Julia version does NOT have native binaries for Apple Silicon"
|
||||
// if and only if "this Julia version is < 1.8.0"
|
||||
const this_julia_version_does_NOT_have_native_binaries_for_apple_silicon = semver.lt(
|
||||
version,
|
||||
'1.8.0',
|
||||
);
|
||||
const this_is_macos = osPlat == 'darwin';
|
||||
if (this_is_macos && one_fileext_is_targz_and_other_is_dmg && this_julia_version_does_NOT_have_native_binaries_for_apple_silicon) {
|
||||
const msg = `It looks like you are trying to install Julia 1.6 or 1.7 on ` +
|
||||
`the "macos-latest" runners.\n` +
|
||||
`"macos-latest" now resolves to "macos-14", which run on Apple ` +
|
||||
`Silicon (aarch64) macOS machines.\n` +
|
||||
`Unfortunately, Julia 1.6 and 1.7 do not have native binaries ` +
|
||||
`available for Apple Silicon macOS.\n` +
|
||||
`Therefore, it is not possible to install Julia with the current ` +
|
||||
`constraints.\n` +
|
||||
`For instructions on how to fix this error, please see the following Discourse post: ` +
|
||||
`https://discourse.julialang.org/t/how-to-fix-github-actions-ci-failures-with-julia-1-6-or-1-7-on-macos-latest-and-macos-14/117019`
|
||||
core.error(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
core.error(`Encountered error: ${err}`)
|
||||
throw err
|
||||
}
|
||||
|
||||
|
||||
@@ -3,19 +3,17 @@ import * as tc from '@actions/tool-cache'
|
||||
|
||||
import * as fs from 'fs'
|
||||
import * as https from 'https'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
|
||||
import * as installer from './installer'
|
||||
|
||||
// Note: before we index into this dict, we always first do `.toLowerCase()` on
|
||||
// the key.
|
||||
//
|
||||
// Therefore, this dict does not need to account for differences in case.
|
||||
const archSynonyms = {
|
||||
'x86': 'x86',
|
||||
'X86': 'x86',
|
||||
'x64': 'x64',
|
||||
'X64': 'x64',
|
||||
'aarch64': 'aarch64',
|
||||
'ARM64': 'aarch64',
|
||||
'arm64': 'aarch64'
|
||||
}
|
||||
|
||||
@@ -39,40 +37,24 @@ async function run() {
|
||||
})
|
||||
}
|
||||
|
||||
// Inputs.
|
||||
// Note that we intentionally strip leading and lagging whitespace by using `.trim()`
|
||||
const versionInput = core.getInput('version').trim()
|
||||
const includePrereleases = core.getInput('include-all-prereleases').trim() == 'true'
|
||||
const originalArchInput = core.getInput('arch').trim()
|
||||
// Inputs
|
||||
const versionInput = core.getInput('version')
|
||||
const includePrereleases = core.getInput('include-all-prereleases') == 'true'
|
||||
const originalArchInput = core.getInput('arch')
|
||||
|
||||
// It can easily happen that, for example, a workflow file contains an input `version: ${{ matrix.julia-version }}`
|
||||
// while the strategy matrix only contains a key `${{ matrix.version }}`.
|
||||
// In that case, we want the action to fail, rather than trying to download julia from an URL that's missing parts and 404ing.
|
||||
// We _could_ fall back to the default but that means that builds silently do things differently than they're meant to, which
|
||||
// is worse than failing the build.
|
||||
if (!versionInput) { // if `versionInput` is an empty string
|
||||
if (!versionInput) {
|
||||
throw new Error('Version input must not be null')
|
||||
}
|
||||
if (versionInput == '1.6') {
|
||||
core.notice('[setup-julia] If you are testing 1.6 as a Long Term Support (lts) version, consider using the new "lts" version specifier instead of "1.6" explicitly, which will automatically resolve the current lts.')
|
||||
}
|
||||
if (!originalArchInput) { // if `originalArchInput` is an empty string
|
||||
if (!originalArchInput) {
|
||||
throw new Error(`Arch input must not be null`)
|
||||
}
|
||||
|
||||
let processedArchInput: string;
|
||||
if (originalArchInput == "default") {
|
||||
// If the user sets the `arch` input to `default`, then we use the
|
||||
// architecture of the machine that we are running on.
|
||||
processedArchInput = os.arch();
|
||||
core.debug(`The "arch" input is "default", so we will use the machine arch: ${processedArchInput}`)
|
||||
} else {
|
||||
processedArchInput = originalArchInput;
|
||||
}
|
||||
// Note: we convert the key `processedArchInput` to lower case
|
||||
// before we index into the `archSynonyms` dict.
|
||||
const arch = archSynonyms[processedArchInput.toLowerCase()]
|
||||
core.debug(`Mapped the "arch" from ${processedArchInput} to ${arch}`)
|
||||
const arch = archSynonyms[originalArchInput]
|
||||
|
||||
const versionInfo = await installer.getJuliaVersionInfo()
|
||||
const availableReleases = await installer.getJuliaVersions(versionInfo)
|
||||
|
||||
Reference in New Issue
Block a user