mirror of
https://github.com/actions/toolkit.git
synced 2025-06-09 09:35:06 +09:00
Added unzip for darwin (#49)
* added unzip for darwin * add mac builds * added zip for darwin
This commit is contained in:
parent
eae6c87114
commit
35cd59e8d5
5 changed files with 45 additions and 3 deletions
23
.github/workflows/workflow.yml
vendored
23
.github/workflows/workflow.yml
vendored
|
@ -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
|
||||||
|
|
BIN
packages/tool-cache/__tests__/externals/zip-darwin
vendored
Executable file
BIN
packages/tool-cache/__tests__/externals/zip-darwin
vendored
Executable file
Binary file not shown.
|
@ -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})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
packages/tool-cache/scripts/externals/unzip-darwin
vendored
Executable file
BIN
packages/tool-cache/scripts/externals/unzip-darwin
vendored
Executable file
Binary file not shown.
|
@ -218,7 +218,11 @@ 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 {
|
} else {
|
||||||
await extractZipNix(file, dest)
|
if (process.platform === 'darwin') {
|
||||||
|
await extractZipDarwin(file, dest)
|
||||||
|
} else {
|
||||||
|
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
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue