mirror of
https://github.com/julia-actions/setup-julia.git
synced 2026-02-13 03:26:53 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e802804276 | ||
|
|
43c4e31075 | ||
|
|
2bfca2816f | ||
|
|
87fafcc1ec | ||
|
|
57ce80e73c | ||
|
|
ffea8bb089 | ||
|
|
3a89763b86 | ||
|
|
40f50bc31f | ||
|
|
8474f0e14d | ||
|
|
76f26cb710 | ||
|
|
40ab89a96a | ||
|
|
631e68d88a | ||
|
|
a07a9b4c49 |
1
.github/workflows/backup.yml
vendored
1
.github/workflows/backup.yml
vendored
@@ -9,6 +9,7 @@ on:
|
||||
jobs:
|
||||
backup:
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- name: Configure cache
|
||||
|
||||
9
.github/workflows/checkin.yml
vendored
9
.github/workflows/checkin.yml
vendored
@@ -1,14 +1,21 @@
|
||||
name: "PR Checks"
|
||||
on: [pull_request, push]
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
jobs:
|
||||
check_pr:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: "npm ci"
|
||||
run: npm ci
|
||||
run: npm ci --legacy-peer-deps
|
||||
|
||||
- name: "npm run build"
|
||||
run: npm run build
|
||||
|
||||
7
.github/workflows/codeql-analysis.yml
vendored
7
.github/workflows/codeql-analysis.yml
vendored
@@ -11,6 +11,12 @@
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, releases/* ]
|
||||
@@ -24,6 +30,7 @@ jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
||||
40
.github/workflows/example-builds-defaultarch.yml
vendored
Normal file
40
.github/workflows/example-builds-defaultarch.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: Example builds (default arch)
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['main', 'master', 'releases/*']
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
julia-version: ['1']
|
||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: |
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
npm run pack
|
||||
|
||||
- name: "Set up Julia"
|
||||
id: setup-julia
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.julia-version }}
|
||||
- run: julia --version
|
||||
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
|
||||
38
.github/workflows/example-builds-nightly-defaultarch.yml
vendored
Normal file
38
.github/workflows/example-builds-nightly-defaultarch.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Example builds (nightly, default arch)
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['main', 'master', 'releases/*']
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
julia-version: [nightly, 1.8-nightly]
|
||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: |
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
npm run pack
|
||||
|
||||
- name: "Set up Julia (${{ matrix.julia-version }})"
|
||||
uses: ./
|
||||
with:
|
||||
version: ${{ matrix.julia-version }}
|
||||
- run: julia --version
|
||||
- run: julia --compile=min -O0 -e 'import InteractiveUtils; InteractiveUtils.versioninfo()'
|
||||
13
.github/workflows/example-builds-nightly.yml
vendored
13
.github/workflows/example-builds-nightly.yml
vendored
@@ -1,5 +1,11 @@
|
||||
name: Example builds (nightly)
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['main', 'master', 'releases/*']
|
||||
@@ -10,6 +16,7 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -20,13 +27,13 @@ jobs:
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
julia-arch: x86
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: |
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
npm run pack
|
||||
|
||||
|
||||
13
.github/workflows/example-builds.yml
vendored
13
.github/workflows/example-builds.yml
vendored
@@ -1,5 +1,11 @@
|
||||
name: Example builds
|
||||
|
||||
concurrency:
|
||||
# Skip intermediate builds: all builds except for builds on the `master`, `main`, or `release-*` branches
|
||||
# Cancel intermediate builds: only pull request builds
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
|
||||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['main', 'master', 'releases/*']
|
||||
@@ -9,23 +15,24 @@ on:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 60
|
||||
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
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
julia-arch: x86
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
|
||||
- name: "Install dependencies"
|
||||
run: |
|
||||
npm install
|
||||
npm install --legacy-peer-deps
|
||||
npm run build
|
||||
npm run pack
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,3 @@
|
||||
node_modules/
|
||||
__tests__/runner/*
|
||||
dist/
|
||||
!dist/
|
||||
|
||||
10
README.md
10
README.md
@@ -44,7 +44,9 @@ This action sets up a Julia environment for use in actions by downloading a spec
|
||||
#
|
||||
# Supported values: x64 | x86 | aarch64 (untested)
|
||||
#
|
||||
# Default: x64
|
||||
# Note: you can use X64, X86, and ARM64 as synonyms for x64, x86, and aarch64, respectively.
|
||||
#
|
||||
# Defaults to the architecture of the runner executing the job.
|
||||
arch: ''
|
||||
|
||||
# Set the display setting for printing InteractiveUtils.versioninfo() after installing.
|
||||
@@ -127,7 +129,7 @@ jobs:
|
||||
matrix:
|
||||
julia-version: ['1.0', '1.2.0', '^1.3.0-rc1']
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
- name: "Set up Julia"
|
||||
@@ -153,7 +155,7 @@ jobs:
|
||||
exclude:
|
||||
- os: macOS-latest
|
||||
julia-arch: x86
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
- name: "Set up Julia"
|
||||
@@ -180,7 +182,7 @@ jobs:
|
||||
- os: windows-latest
|
||||
julia-version: ['1.0.4']
|
||||
julia-arch: x86
|
||||
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1.0.0
|
||||
- name: "Set up Julia"
|
||||
|
||||
@@ -6,9 +6,9 @@ inputs:
|
||||
description: 'The Julia version to download (if necessary) and use. Example: 1.0.4'
|
||||
default: '1'
|
||||
arch:
|
||||
description: 'Architecture of the Julia binaries. Defaults to x64.'
|
||||
description: 'Architecture of the Julia binaries. Defaults to the architecture of the runner executing the job.'
|
||||
required: false
|
||||
default: 'x64'
|
||||
default: '${{ runner.arch }}'
|
||||
show-versioninfo:
|
||||
description: 'Display InteractiveUtils.versioninfo() after installing'
|
||||
required: false
|
||||
|
||||
7554
dist/index.js
vendored
Normal file
7554
dist/index.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
dist/unzip
vendored
Normal file
BIN
dist/unzip
vendored
Normal file
Binary file not shown.
65
lib/installer.js
generated
65
lib/installer.js
generated
@@ -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`);
|
||||
}
|
||||
|
||||
13
lib/setup-julia.js
generated
13
lib/setup-julia.js
generated
@@ -21,6 +21,14 @@ const fs = __importStar(require("fs"));
|
||||
const https = __importStar(require("https"));
|
||||
const path = __importStar(require("path"));
|
||||
const installer = __importStar(require("./installer"));
|
||||
const archSynonyms = {
|
||||
'x86': 'x86',
|
||||
'X86': 'x86',
|
||||
'x64': 'x64',
|
||||
'X64': 'x64',
|
||||
'aarch64': 'aarch64',
|
||||
'ARM64': 'aarch64'
|
||||
};
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -41,7 +49,7 @@ function run() {
|
||||
}
|
||||
// Inputs
|
||||
const versionInput = core.getInput('version');
|
||||
const arch = core.getInput('arch');
|
||||
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.
|
||||
@@ -50,9 +58,10 @@ function run() {
|
||||
if (!versionInput) {
|
||||
throw new Error('Version input must not be null');
|
||||
}
|
||||
if (!arch) {
|
||||
if (!originalArchInput) {
|
||||
throw new Error(`Arch input must not be null`);
|
||||
}
|
||||
const arch = archSynonyms[originalArchInput];
|
||||
const versionInfo = yield installer.getJuliaVersionInfo();
|
||||
const availableReleases = yield installer.getJuliaVersions(versionInfo);
|
||||
const version = installer.getJuliaVersion(availableReleases, versionInput);
|
||||
|
||||
75
package-lock.json
generated
75
package-lock.json
generated
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "setup-julia",
|
||||
"version": "1.7.1",
|
||||
"version": "1.8.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-julia",
|
||||
"version": "1.6.1",
|
||||
"version": "1.8.3",
|
||||
"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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-julia",
|
||||
"version": "1.7.1",
|
||||
"version": "1.8.3",
|
||||
"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",
|
||||
|
||||
@@ -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`)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,15 @@ import * as path from 'path'
|
||||
|
||||
import * as installer from './installer'
|
||||
|
||||
const archSynonyms = {
|
||||
'x86': 'x86',
|
||||
'X86': 'x86',
|
||||
'x64': 'x64',
|
||||
'X64': 'x64',
|
||||
'aarch64': 'aarch64',
|
||||
'ARM64': 'aarch64'
|
||||
}
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
// Debugging info
|
||||
@@ -30,7 +39,7 @@ async function run() {
|
||||
|
||||
// Inputs
|
||||
const versionInput = core.getInput('version')
|
||||
const arch = core.getInput('arch')
|
||||
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 }}`.
|
||||
@@ -40,10 +49,12 @@ async function run() {
|
||||
if (!versionInput) {
|
||||
throw new Error('Version input must not be null')
|
||||
}
|
||||
if (!arch) {
|
||||
if (!originalArchInput) {
|
||||
throw new Error(`Arch input must not be null`)
|
||||
}
|
||||
|
||||
const arch = archSynonyms[originalArchInput]
|
||||
|
||||
const versionInfo = await installer.getJuliaVersionInfo()
|
||||
const availableReleases = await installer.getJuliaVersions(versionInfo)
|
||||
const version = installer.getJuliaVersion(availableReleases, versionInput)
|
||||
|
||||
Reference in New Issue
Block a user