Skip to content

Commit 6923cf2

Browse files
authored
Merge pull request #92 from fwal/extract
Use extractXar from tool-cache
2 parents f8ac9ad + 91abe1a commit 6923cf2

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@actions/core": "^1.2.4",
3535
"@actions/exec": "^1.0.4",
3636
"@actions/io": "^1.0.2",
37-
"@actions/tool-cache": "^1.5.5",
37+
"@actions/tool-cache": "^1.6.0",
3838
"getos": "^3.2.1",
3939
"semver": "^7.3.2"
4040
},

src/macos-install.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ async function download({ url }: Package) {
5454

5555
async function unpack({ name }: Package, packagePath: string, version: string) {
5656
core.debug("Extracting package");
57-
const unpackedPath = await extractXar(packagePath);
57+
const unpackedPath = await toolCache.extractXar(packagePath);
5858
const extractedPath = await toolCache.extractTar(
5959
path.join(unpackedPath, `${name}-package.pkg`, "Payload")
6060
);
@@ -67,16 +67,3 @@ async function unpack({ name }: Package, packagePath: string, version: string) {
6767
core.debug("Package cached");
6868
return cachedPath;
6969
}
70-
71-
//FIXME: Workaround until https://github.com/actions/toolkit/pull/207 is merged
72-
export async function extractXar(file: string): Promise<string> {
73-
const dest = path.join(
74-
process.env["RUNNER_TEMP"] || "",
75-
"setup-swift",
76-
"extract.tmp"
77-
);
78-
await io.mkdirP(dest);
79-
const xarPath: string = await io.which("xar", true);
80-
await exec(`"${xarPath}"`, ["-x", "-C", dest, "-f", file]);
81-
return dest;
82-
}

0 commit comments

Comments
 (0)