Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to the Windows system tar, but add an escape hatch #250

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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. Example: 1.0.4'
default: '1'
Expand All @@ -17,6 +17,10 @@ inputs:
description: 'Display InteractiveUtils.versioninfo() after installing'
required: false
default: 'false'
tar:
description: '[private internal]. Custom tar command to use. This is not part of the public API of this action.'
required: false
default: ''
outputs:
julia-version:
description: 'The installed Julia version. May vary from the version input if a version range was given as input.'
Expand Down
17 changes: 16 additions & 1 deletion lib/installer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,21 @@ export async function installJulia(dest: string, versionInfo, version: string, a
}
} else {
// This is the more common path. Using .tar.gz is much faster
await exec.exec('powershell', ['-Command', `tar xf ${juliaDownloadPath} --strip-components=1 -C ${dest}`])
const tarInput = core.getInput('tar').trim()
if (tarInput) {
// If the user provides the `tar` input, use that.
const tar_command = `& "${tarInput}" xf ${juliaDownloadPath} --strip-components=1 -C ${dest}`
core.debug(`tar_command: ${tar_command}`)
await exec.exec('powershell', ['-Command', tar_command])
} else {
// Otherwise, on Windows, use the Windows system tar (not the Git Bash tar).
// https://github.com/julia-actions/setup-julia/issues/205
//
// // don't use the Git bash provided tar. Issue #205
const tar_command = `& "$env:WINDIR/System32/tar" xf ${juliaDownloadPath} --strip-components=1 -C ${dest}`
core.debug(`tar_command: ${tar_command}`)
await exec.exec('powershell', ['-Command', tar_command])
}
}
return dest
case 'darwin':
Expand Down
Loading