@@ -19,7 +19,7 @@ const tags = {
1919 const url = `https://github.com/nginxui/musl-cross-compilers/releases/download/${ tags [ variant ] } /output-${ target } -${ variant . replace (
2020 "/" ,
2121 "_"
22- ) } .tar.gz `;
22+ ) } .tar.xz `;
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.gz ` ) ;
73+ cachedPath = tc . find ( "mcm" , `${ target } -${ variant } .tar.xz ` ) ;
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.gz ` ) ;
80+ cachedPath = await tc . cacheDir ( toolchainExtractedFolder , "mcm" , `${ target } -${ variant } .tar.xz ` ) ;
8181 console . log ( `Installed at ${ cachedPath } ` ) ;
8282 }
8383 cachedPath = path . join ( cachedPath , "output" , "bin" ) ;
@@ -87,11 +87,15 @@ 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" , [ "-czf" , "/opt/mcm.tar.gz" , buildDir ] ) ;
90+ await exec . exec ( "tar" , [ "-cJf" , "/opt/mcm.tar.xz" , buildDir ] , {
91+ env : {
92+ XZ_OPT : "-9T0"
93+ }
94+ } ) ;
9195 const artifact = require ( "@actions/artifact" ) ;
9296 const artifactClient = artifact . create ( ) ;
9397 const artifactName = `musl-cross-compiler-error-${ target } -${ variant . replace ( "/" , "_" ) } ` ;
94- const files = [ "/opt/mcm.tar.gz " ] ;
98+ const files = [ "/opt/mcm.tar.xz " ] ;
9599 const rootDirectory = "/opt/" ;
96100 const options = { } ;
97101 await artifactClient . uploadArtifact ( artifactName , files , rootDirectory , options ) ;
0 commit comments