Compare commits

...

10 Commits

Author SHA1 Message Date
Sascha Mann
51f35e7679 Add production dependencies & build 2023-02-09 12:51:42 +01:00
Sascha Mann
029296930b Bump version 2023-02-09 12:50:22 +01:00
Sergio Sánchez Ramírez
294135b6de Include arm64 alias for aarch64 (#134)
This should fix arch lookup in Apple M-series.
2023-02-09 11:49:10 +00:00
Sascha Mann
2f270f0b37 Remove mention of auto-updating versions file (#132)
The workflow to build it is triggered manually as part of the release process now, so this should no longer be an issue and hasn't been one for quite a while.
2023-01-19 11:24:05 -05:00
Sascha Mann
13d92cb7a9 Bump version 2022-12-12 11:46:15 +01:00
Sascha Mann
a7ad2168c4 Add include-all-prereleases input (#127)
fixes #126
2022-12-11 22:03:47 -05:00
Sascha Mann
43c4e31075 Update @actions/core (#125)
* Update @actions/core

* Run npm i
2022-10-13 15:45:44 +02:00
dependabot[bot]
2bfca2816f Bump @actions/core from 1.2.6 to 1.9.1 (#118)
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.6 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-12 16:38:20 -04:00
Sascha Mann
87fafcc1ec Bump version 2022-08-10 14:57:53 +02:00
Dilum Aluthge
57ce80e73c macOS: Default to tarball (.tar.gz) if available (#117)
* On macOS, first try to find a tarball (`.tar.gz`) file, but fall back to `.dmg` if we can't find a tarball

* Add an "Example builds" job for Julia 1.2
2022-08-10 14:54:47 +02:00
13 changed files with 7793 additions and 47 deletions

View File

@@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.0.5', '1', '^1.5.0-beta1']
julia-version: ['1.0.5', '1.2', '^1.5.0-beta1', '1']
julia-arch: [x64, x86]
os: [ubuntu-latest, macOS-latest, windows-latest]
# 32-bit Julia binaries are not available on macOS

2
.gitignore vendored
View File

@@ -1,3 +1,3 @@
node_modules/
__tests__/runner/*
dist/
!dist/

View File

@@ -104,16 +104,43 @@ You can either specify specific Julia versions or version ranges. If you specify
- `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.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 **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-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`.
- `^1.3.0-rc1` is a **caret** version range that includes pre-releases of `1.3.0` starting at `rc1`. It matches all versions `≥ 1.3.0-rc1` and `< 2.0.0`.
- `~1.3.0-rc1` is a **tilde** version range that includes pre-releases of `1.3.0` starting at `rc1`. It matches all versions `≥ 1.3.0-rc1` and `< 1.4.0`.
- `^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`.
- `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.
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).
The available Julia versions are pulled from [`versions.json`](https://julialang-s3.julialang.org/bin/versions.json). This file is automatically updated once a day. Therefore it may take up to 24 hours until a newly released Julia version is available in the action.
#### Prereleases
There are two methods of including pre-releases in version matching:
1. Including the pre-release tag in the version itself, e.g. `^1.3.0-rc1`.
2. Setting the input `include-all-prereleases` to `true`.
These behave slightly differently.
1. If the version `a.b.c` contains pre-release tag, all pre-releases of version `a.b.c` will be included in the version matching.
For example, `^1.3.0-rc1` would match `1.3.0-rc2` but would **not** match `1.4.0-rc1` once released.
2. If `include-preleases` is set to true, **all** pre-releases of all versions will be included in the version matching. In this case, `^1.3.0-rc1` would match `1.4.0-rc1` once released.
**Example:** Without `include-all-prereleases: true`, the version `^1.3.0-rc1` would match `1.3.0-rc1`, `1.3.0-rc2`, `1.3.0`, `1.4.0` once they are released.
With `include-all-prereleases: true`, it would match `1.3.0-rc1`, `1.3.0-rc2`, `1.3.0`, `1.4.0-rc1`, `1.4.0`.
If you want to run tests against the latest tagged version, no matter what version that is, you can use
```yaml
- uses: julia-actions/setup-julia@v1
with:
version: '1'
include-all-prereleases: true
```
#### Recently released versions
The available Julia versions are pulled from [`versions.json`](https://julialang-s3.julialang.org/bin/versions.json).
### Matrix Testing

View File

@@ -66,6 +66,14 @@ describe('version matching tests', () => {
})
})
describe('include-prereleases', () => {
it('Chooses the highest available version that matches the input including prereleases', () => {
expect(installer.getJuliaVersion(testVersions, '^1.2.0-0', true)).toEqual('1.3.0-rc4')
expect(installer.getJuliaVersion(testVersions, '1', true)).toEqual('1.3.0-rc4')
expect(installer.getJuliaVersion(testVersions, '^1.2.0-0', false)).toEqual('1.2.0')
})
})
describe('node-semver behaviour', () => {
describe('Windows installer change', () => {
it('Correctly understands >1.4.0', () => {

View File

@@ -5,6 +5,10 @@ inputs:
version:
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.'
required: false
default: 'false'
arch:
description: 'Architecture of the Julia binaries. Defaults to the architecture of the runner executing the job.'
required: false

7556
dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
dist/unzip vendored Normal file

Binary file not shown.

69
lib/installer.js generated
View File

@@ -87,13 +87,13 @@ function getJuliaVersions(versionInfo) {
});
}
exports.getJuliaVersions = getJuliaVersions;
function getJuliaVersion(availableReleases, versionInput) {
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
return versionInput;
}
// Use the highest available version that matches versionInput
let version = semver.maxSatisfying(availableReleases, versionInput);
let version = semver.maxSatisfying(availableReleases, versionInput, { includePrerelease });
if (version == null) {
throw new Error(`Could not find a Julia version that matches ${versionInput}`);
}
@@ -102,30 +102,57 @@ function getJuliaVersion(availableReleases, versionInput) {
return version;
}
exports.getJuliaVersion = getJuliaVersion;
function getDesiredFileExts() {
let fileExt1;
let hasFileExt2;
let fileExt2;
if (osPlat == 'win32') {
fileExt1 = 'exe';
hasFileExt2 = false;
fileExt2 = '';
}
else if (osPlat == 'darwin') {
fileExt1 = 'tar.gz';
hasFileExt2 = true;
fileExt2 = 'dmg';
}
else if (osPlat === 'linux') {
fileExt1 = 'tar.gz';
hasFileExt2 = false;
fileExt2 = '';
}
else {
throw new Error(`Platform ${osPlat} is not supported`);
}
return [fileExt1, hasFileExt2, fileExt2];
}
function getNightlyFileName(arch) {
let versionExt, ext;
let versionExt;
let fileExt1;
[fileExt1, ,] = getDesiredFileExts();
if (osPlat == 'win32') {
versionExt = arch == 'x64' ? '-win64' : '-win32';
ext = 'exe';
}
else if (osPlat == 'darwin') {
if (arch == 'x86') {
throw new Error('32-bit Julia is not available on macOS');
}
versionExt = '-mac64';
ext = 'dmg';
}
else if (osPlat === 'linux') {
versionExt = arch == 'x64' ? '-linux64' : '-linux32';
ext = 'tar.gz';
}
else {
throw new Error(`Platform ${osPlat} is not supported`);
}
return `julia-latest${versionExt}.${ext}`;
return `julia-latest${versionExt}.${fileExt1}`;
}
function getFileInfo(versionInfo, version, arch) {
const err = `Could not find ${archMap[arch]}/${version} binaries`;
let fileExt1;
let hasFileExt2;
let fileExt2;
[fileExt1, hasFileExt2, fileExt2] = getDesiredFileExts();
if (version.endsWith('nightly')) {
return null;
}
@@ -134,7 +161,19 @@ function getFileInfo(versionInfo, version, arch) {
}
for (let file of versionInfo[version].files) {
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
return file;
if (file.extension == fileExt1) {
return file;
}
}
}
if (hasFileExt2) {
core.debug(`Could not find ${fileExt1}; trying to find ${fileExt2} instead`);
for (let file of versionInfo[version].files) {
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
if (file.extension == fileExt2) {
return file;
}
}
}
}
throw err;
@@ -201,9 +240,17 @@ function installJulia(versionInfo, version, arch) {
}
return tempInstallDir;
case 'darwin':
yield exec.exec('hdiutil', ['attach', juliaDownloadPath]);
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`]);
return path.join(tempInstallDir, 'julia');
if (fileInfo !== null && fileInfo.extension == 'dmg') {
core.debug(`Support for .dmg files is deprecated and may be removed in a future release`);
yield exec.exec('hdiutil', ['attach', juliaDownloadPath]);
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`]);
return path.join(tempInstallDir, 'julia');
}
else {
// tc.extractTar doesn't support stripping components, so we have to call tar manually
yield exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir]);
return tempInstallDir;
}
default:
throw new Error(`Platform ${osPlat} is not supported`);
}

6
lib/setup-julia.js generated
View File

@@ -27,7 +27,8 @@ const archSynonyms = {
'x64': 'x64',
'X64': 'x64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
'ARM64': 'aarch64',
'arm64': 'aarch64'
};
function run() {
return __awaiter(this, void 0, void 0, function* () {
@@ -49,6 +50,7 @@ function run() {
}
// 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 }}`.
@@ -64,7 +66,7 @@ function run() {
const arch = archSynonyms[originalArchInput];
const versionInfo = yield installer.getJuliaVersionInfo();
const availableReleases = yield installer.getJuliaVersions(versionInfo);
const version = installer.getJuliaVersion(availableReleases, versionInput);
const version = installer.getJuliaVersion(availableReleases, versionInput, includePrereleases);
core.debug(`selected Julia version: ${arch}/${version}`);
core.setOutput('julia-version', version);
// Search in cache

75
package-lock.json generated
View File

@@ -1,15 +1,15 @@
{
"name": "setup-julia",
"version": "1.8.1",
"version": "1.9.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "setup-julia",
"version": "1.6.1",
"version": "1.9.1",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.0",
"@actions/io": "^1.0.0",
"@actions/tool-cache": "^1.0.0",
@@ -31,15 +31,43 @@
}
},
"node_modules/@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"dependencies": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/core/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@actions/exec": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz",
"integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw=="
},
"node_modules/@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "^0.0.6"
}
},
"node_modules/@actions/http-client/node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"node_modules/@actions/io": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.0.tgz",
@@ -8494,15 +8522,41 @@
},
"dependencies": {
"@actions/core": {
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
},
"dependencies": {
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"@actions/exec": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz",
"integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw=="
},
"@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "^0.0.6"
},
"dependencies": {
"tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
}
}
},
"@actions/io": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.0.tgz",
@@ -12927,8 +12981,7 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz",
"integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==",
"dev": true,
"requires": {}
"dev": true
},
"jest-regex-util": {
"version": "24.3.0",

View File

@@ -1,6 +1,6 @@
{
"name": "setup-julia",
"version": "1.8.1",
"version": "1.9.1",
"private": true,
"description": "setup Julia action",
"main": "lib/setup-julia.js",
@@ -21,7 +21,7 @@
"author": "Sascha Mann <git@mail.saschamann.eu>",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.0",
"@actions/io": "^1.0.0",
"@actions/tool-cache": "^1.0.0",

View File

@@ -75,14 +75,14 @@ export async function getJuliaVersions(versionInfo): Promise<string[]> {
return versions
}
export function getJuliaVersion(availableReleases: string[], versionInput: string): string {
export function getJuliaVersion(availableReleases: string[], versionInput: string, includePrerelease: boolean = false): string {
if (semver.valid(versionInput) == versionInput || versionInput.endsWith('nightly')) {
// versionInput is a valid version or a nightly version, use it directly
return versionInput
}
// Use the highest available version that matches versionInput
let version = semver.maxSatisfying(availableReleases, versionInput)
let version = semver.maxSatisfying(availableReleases, versionInput, {includePrerelease})
if (version == null) {
throw new Error(`Could not find a Julia version that matches ${versionInput}`)
}
@@ -93,31 +93,59 @@ export function getJuliaVersion(availableReleases: string[], versionInput: strin
return version
}
function getDesiredFileExts(): [string, boolean, string] {
let fileExt1: string
let hasFileExt2: boolean
let fileExt2: string
if (osPlat == 'win32') {
fileExt1 = 'exe'
hasFileExt2 = false
fileExt2 = ''
} else if (osPlat == 'darwin') {
fileExt1 = 'tar.gz'
hasFileExt2 = true
fileExt2 = 'dmg'
} else if (osPlat === 'linux') {
fileExt1 = 'tar.gz'
hasFileExt2 = false
fileExt2 = ''
} else {
throw new Error(`Platform ${osPlat} is not supported`)
}
return [fileExt1, hasFileExt2, fileExt2]
}
function getNightlyFileName(arch: string): string {
let versionExt: string, ext: string
let versionExt: string
let fileExt1: string
[fileExt1, , ] = getDesiredFileExts()
if (osPlat == 'win32') {
versionExt = arch == 'x64' ? '-win64' : '-win32'
ext = 'exe'
} else if (osPlat == 'darwin') {
if (arch == 'x86') {
throw new Error('32-bit Julia is not available on macOS')
}
versionExt = '-mac64'
ext = 'dmg'
} else if (osPlat === 'linux') {
versionExt = arch == 'x64' ? '-linux64' : '-linux32'
ext = 'tar.gz'
} else {
throw new Error(`Platform ${osPlat} is not supported`)
}
return `julia-latest${versionExt}.${ext}`
return `julia-latest${versionExt}.${fileExt1}`
}
export function getFileInfo(versionInfo, version: string, arch: string) {
const err = `Could not find ${archMap[arch]}/${version} binaries`
let fileExt1: string
let hasFileExt2: boolean
let fileExt2: string
[fileExt1, hasFileExt2, fileExt2] = getDesiredFileExts()
if (version.endsWith('nightly')) {
return null
}
@@ -128,7 +156,20 @@ export function getFileInfo(versionInfo, version: string, arch: string) {
for (let file of versionInfo[version].files) {
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
return file
if (file.extension == fileExt1) {
return file
}
}
}
if (hasFileExt2) {
core.debug(`Could not find ${fileExt1}; trying to find ${fileExt2} instead`)
for (let file of versionInfo[version].files) {
if (file.os == osMap[osPlat] && file.arch == archMap[arch]) {
if (file.extension == fileExt2) {
return file
}
}
}
}
@@ -172,7 +213,6 @@ export async function installJulia(versionInfo, version: string, arch: string):
}
})
// Verify checksum
if (!version.endsWith('nightly')) {
const checkSum = await calculateChecksum(juliaDownloadPath)
@@ -201,9 +241,16 @@ export async function installJulia(versionInfo, version: string, arch: string):
}
return tempInstallDir
case 'darwin':
await exec.exec('hdiutil', ['attach', juliaDownloadPath])
await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`])
return path.join(tempInstallDir, 'julia')
if (fileInfo !== null && fileInfo.extension == 'dmg') {
core.debug(`Support for .dmg files is deprecated and may be removed in a future release`)
await exec.exec('hdiutil', ['attach', juliaDownloadPath])
await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`])
return path.join(tempInstallDir, 'julia')
} else {
// tc.extractTar doesn't support stripping components, so we have to call tar manually
await exec.exec('tar', ['xf', juliaDownloadPath, '--strip-components=1', '-C', tempInstallDir])
return tempInstallDir
}
default:
throw new Error(`Platform ${osPlat} is not supported`)
}

View File

@@ -14,7 +14,8 @@ const archSynonyms = {
'x64': 'x64',
'X64': 'x64',
'aarch64': 'aarch64',
'ARM64': 'aarch64'
'ARM64': 'aarch64',
'arm64': 'aarch64'
}
async function run() {
@@ -39,6 +40,7 @@ async function run() {
// 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 }}`
@@ -57,7 +59,7 @@ async function run() {
const versionInfo = await installer.getJuliaVersionInfo()
const availableReleases = await installer.getJuliaVersions(versionInfo)
const version = installer.getJuliaVersion(availableReleases, versionInput)
const version = installer.getJuliaVersion(availableReleases, versionInput, includePrereleases)
core.debug(`selected Julia version: ${arch}/${version}`)
core.setOutput('julia-version', version)