Unmount dmg file on macOS after copying files

This commit is contained in:
Sascha Mann
2022-05-23 23:31:02 +02:00
parent 67db496725
commit 4b10f2b699
4 changed files with 8 additions and 2 deletions

2
lib/installer.js generated
View File

@@ -203,6 +203,8 @@ function installJulia(versionInfo, version, arch) {
case 'darwin': case 'darwin':
yield exec.exec('hdiutil', ['attach', juliaDownloadPath]); yield exec.exec('hdiutil', ['attach', juliaDownloadPath]);
yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`]); yield exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`]);
// Unmount dmg file again to avoid issues on self-hosted runners
yield exec.exec('hdiutil', ['unmount', juliaDownloadPath]);
return path.join(tempInstallDir, 'julia'); return path.join(tempInstallDir, 'julia');
default: default:
throw new Error(`Platform ${osPlat} is not supported`); throw new Error(`Platform ${osPlat} is not supported`);

2
package-lock.json generated
View File

@@ -6,7 +6,7 @@
"packages": { "packages": {
"": { "": {
"name": "setup-julia", "name": "setup-julia",
"version": "1.6.1", "version": "1.7.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.6",

View File

@@ -1,6 +1,6 @@
{ {
"name": "setup-julia", "name": "setup-julia",
"version": "1.7.1", "version": "1.7.2",
"private": true, "private": true,
"description": "setup Julia action", "description": "setup Julia action",
"main": "lib/setup-julia.js", "main": "lib/setup-julia.js",

View File

@@ -203,6 +203,10 @@ export async function installJulia(versionInfo, version: string, arch: string):
case 'darwin': case 'darwin':
await exec.exec('hdiutil', ['attach', juliaDownloadPath]) await exec.exec('hdiutil', ['attach', juliaDownloadPath])
await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`]) await exec.exec('/bin/bash', ['-c', `cp -a /Volumes/Julia-*/Julia-*.app/Contents/Resources/julia ${tempInstallDir}`])
// Unmount dmg file again to avoid issues on self-hosted runners
await exec.exec('hdiutil', ['unmount', juliaDownloadPath])
return path.join(tempInstallDir, 'julia') return path.join(tempInstallDir, 'julia')
default: default:
throw new Error(`Platform ${osPlat} is not supported`) throw new Error(`Platform ${osPlat} is not supported`)