mirror of https://github.com/actions/toolkit
Added unzip for darwin (#49)
* added unzip for darwin * add mac builds * added zip for darwinpull/55/head
parent
eae6c87114
commit
35cd59e8d5
|
@ -30,6 +30,29 @@ jobs:
|
|||
|
||||
- name: Format
|
||||
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:
|
||||
name: Run Windows
|
||||
runs-on: windows-latest
|
||||
|
|
Binary file not shown.
|
@ -231,7 +231,9 @@ describe('@actions/tool-cache', function() {
|
|||
]
|
||||
await exec.exec(`"${powershellPath}"`, args)
|
||||
} 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})
|
||||
}
|
||||
|
||||
|
@ -282,7 +284,9 @@ describe('@actions/tool-cache', function() {
|
|||
]
|
||||
await exec.exec(`"${powershellPath}"`, args)
|
||||
} 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})
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
|
@ -218,7 +218,11 @@ export async function extractZip(file: string, dest?: string): Promise<string> {
|
|||
if (IS_WINDOWS) {
|
||||
await extractZipWin(file, dest)
|
||||
} else {
|
||||
await extractZipNix(file, dest)
|
||||
if (process.platform === 'darwin') {
|
||||
await extractZipDarwin(file, dest)
|
||||
} else {
|
||||
await extractZipNix(file, dest)
|
||||
}
|
||||
}
|
||||
|
||||
return dest
|
||||
|
@ -250,6 +254,17 @@ async function extractZipNix(file: string, dest: string): Promise<void> {
|
|||
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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue