1
0
Fork 0

Added unzip for darwin (#49)

* added unzip for darwin

* add mac builds

* added zip for darwin
pull/55/head
Alif Rachmawadi 2019-08-13 23:39:01 +07:00 committed by Danny McCormick
parent eae6c87114
commit 35cd59e8d5
5 changed files with 45 additions and 3 deletions

View File

@ -30,6 +30,29 @@ jobs:
- name: Format - name: Format
run: npm run format-check run: npm run format-check
macOS:
name: Run macOS
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set Node.js 10.x
uses: actions/setup-node@master
with:
version: 10.x
- name: npm install
run: npm install
- name: Bootstrap
run: npm run bootstrap
- name: Compile
run: npm run build
- name: npm test
run: npm test
Windows: Windows:
name: Run Windows name: Run Windows
runs-on: windows-latest runs-on: windows-latest

Binary file not shown.

View File

@ -231,7 +231,9 @@ describe('@actions/tool-cache', function() {
] ]
await exec.exec(`"${powershellPath}"`, args) await exec.exec(`"${powershellPath}"`, args)
} else { } else {
const zipPath: string = path.join(__dirname, 'externals', 'zip') const zipBin: string =
process.platform === 'darwin' ? 'zip-darwin' : 'zip'
const zipPath: string = path.join(__dirname, 'externals', zipBin)
await exec.exec(`"${zipPath}`, [zipFile, '-r', '.'], {cwd: stagingDir}) await exec.exec(`"${zipPath}`, [zipFile, '-r', '.'], {cwd: stagingDir})
} }
@ -282,7 +284,9 @@ describe('@actions/tool-cache', function() {
] ]
await exec.exec(`"${powershellPath}"`, args) await exec.exec(`"${powershellPath}"`, args)
} else { } else {
const zipPath = path.join(__dirname, 'externals', 'zip') const zipBin: string =
process.platform === 'darwin' ? 'zip-darwin' : 'zip'
const zipPath = path.join(__dirname, 'externals', zipBin)
await exec.exec(zipPath, [zipFile, '-r', '.'], {cwd: stagingDir}) await exec.exec(zipPath, [zipFile, '-r', '.'], {cwd: stagingDir})
} }

Binary file not shown.

View File

@ -217,9 +217,13 @@ export async function extractZip(file: string, dest?: string): Promise<string> {
if (IS_WINDOWS) { if (IS_WINDOWS) {
await extractZipWin(file, dest) await extractZipWin(file, dest)
} else {
if (process.platform === 'darwin') {
await extractZipDarwin(file, dest)
} else { } else {
await extractZipNix(file, dest) await extractZipNix(file, dest)
} }
}
return dest return dest
} }
@ -250,6 +254,17 @@ async function extractZipNix(file: string, dest: string): Promise<void> {
await exec(`"${unzipPath}"`, [file], {cwd: dest}) await exec(`"${unzipPath}"`, [file], {cwd: dest})
} }
async function extractZipDarwin(file: string, dest: string): Promise<void> {
const unzipPath = path.join(
__dirname,
'..',
'scripts',
'externals',
'unzip-darwin'
)
await exec(`"${unzipPath}"`, [file], {cwd: dest})
}
/** /**
* Caches a directory and installs it into the tool cacheDir * Caches a directory and installs it into the tool cacheDir
* *