Fix build on windows

Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo
2023-01-11 11:21:55 +08:00
parent 08ef9f537a
commit 4a85108bfd
4 changed files with 8 additions and 6 deletions
+2
View File
@@ -10,6 +10,8 @@ runs:
using: "node16" using: "node16"
main: "dist/setup/index.js" main: "dist/setup/index.js"
post: "dist/show_stats/index.js" post: "dist/show_stats/index.js"
# windows can't run `--show-stats` while server is running.
post-if: runner.os != 'windows'
branding: branding:
icon: "star" icon: "star"
color: "orange" color: "orange"
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -24,13 +24,13 @@ async function setup() {
// TODO: we can support install latest version by default if version // TODO: we can support install latest version by default if version
// is not input. // is not input.
const version = core.getInput('version'); const version = core.getInput('version');
console.log('try to setup sccache version: ', version); core.debug(`try to setup sccache version: ${version}'`);
const filename = getFilename(version); const filename = getFilename(version);
const dirname = getDirname(version); const dirname = getDirname(version);
const downloadUrl = `https://github.com/mozilla/sccache/releases/download/${version}/${filename}`; const downloadUrl = `https://github.com/mozilla/sccache/releases/download/${version}/${filename}`;
console.log('sccache download from url: ', downloadUrl); core.debug(`sccache download from url: ${downloadUrl}`);
// Download and extract. // Download and extract.
const sccachePackage = await downloadTool(downloadUrl); const sccachePackage = await downloadTool(downloadUrl);
@@ -41,7 +41,7 @@ async function setup() {
} else { } else {
sccachePath = await extractTar(sccachePackage); sccachePath = await extractTar(sccachePackage);
} }
console.log('sccache extracted to: ', sccachePath); core.debug(`sccache extracted to: ${sccachePath}`);
// Cache sccache. // Cache sccache.
const sccacheHome = await cacheDir( const sccacheHome = await cacheDir(
@@ -49,7 +49,7 @@ async function setup() {
'sccache', 'sccache',
version version
); );
console.log('sccache cached to: ', sccacheHome); core.debug(`sccache cached to: ${sccacheHome}`);
// Add cached sccache into path. // Add cached sccache into path.
core.addPath(`${sccacheHome}`); core.addPath(`${sccacheHome}`);