Skip to content

Commit 61713b8

Browse files
committed
chore: change compression method to zstd
1 parent aa603de commit 61713b8

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

index.js

+7-11
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ const build = core.getInput("build").toUpperCase() === "TRUE";
1010
const buildDir = path.join("/opt/", target, variant);
1111

1212
const tags = {
13-
"richfelker/musl-cross-make": "heracles",
14-
"userdocs/qbt-musl-cross-make": "heracles",
13+
"richfelker/musl-cross-make": "perseus",
14+
"userdocs/qbt-musl-cross-make": "perseus",
1515
};
1616

1717
(async () => {
1818
try {
1919
const url = `https://github.com/nginxui/musl-cross-compilers/releases/download/${tags[variant]}/output-${target}-${variant.replace(
2020
"/",
2121
"_"
22-
)}.tar.xz`;
22+
)}.tar.zst`;
2323

2424
let cachedPath;
2525
if (build) {
@@ -70,14 +70,14 @@ const tags = {
7070
}
7171
cachedPath = destDir;
7272
} else {
73-
cachedPath = tc.find("mcm", `${target}-${variant}.tar.xz`);
73+
cachedPath = tc.find("mcm", `${target}-${variant}.tar.zst`);
7474
}
7575
if (cachedPath) {
7676
console.log(`Found installation at ${cachedPath}`);
7777
} else {
7878
const toolchainPath = await tc.downloadTool(url);
7979
const toolchainExtractedFolder = await tc.extractTar(toolchainPath);
80-
cachedPath = await tc.cacheDir(toolchainExtractedFolder, "mcm", `${target}-${variant}.tar.xz`);
80+
cachedPath = await tc.cacheDir(toolchainExtractedFolder, "mcm", `${target}-${variant}.tar.zst`);
8181
console.log(`Installed at ${cachedPath}`);
8282
}
8383
cachedPath = path.join(cachedPath, "output", "bin");
@@ -87,15 +87,11 @@ const tags = {
8787
} catch (e) {
8888
if (build) {
8989
console.log("Build error occurred and uploading build directory as artifacts");
90-
await exec.exec("tar", ["-cJf", "/opt/mcm.tar.xz", buildDir], {
91-
env: {
92-
XZ_OPT: "-9T0"
93-
}
94-
});
90+
await exec.exec("tar", ["-I", "zstdmt", "-cf", "/opt/mcm.tar.zst", buildDir]);
9591
const artifact = require("@actions/artifact");
9692
const artifactClient = artifact.create();
9793
const artifactName = `musl-cross-compiler-error-${target}-${variant.replace("/", "_")}`;
98-
const files = ["/opt/mcm.tar.xz"];
94+
const files = ["/opt/mcm.tar.zst"];
9995
const rootDirectory = "/opt/";
10096
const options = {};
10197
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);

0 commit comments

Comments
 (0)