mirror of
https://github.com/mozilla-actions/sccache-action
synced 2026-09-14 20:13:56 +00:00
feat: Add native gha cache support
Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Vendored
+5
-1
@@ -66,7 +66,7 @@ function setup() {
|
|||||||
console.log('sccache download from url: ', downloadUrl);
|
console.log('sccache download from url: ', downloadUrl);
|
||||||
// Download and extract.
|
// Download and extract.
|
||||||
const sccachePackage = yield (0, tool_cache_1.downloadTool)(downloadUrl);
|
const sccachePackage = yield (0, tool_cache_1.downloadTool)(downloadUrl);
|
||||||
var sccachePath;
|
let sccachePath;
|
||||||
if (getExtension() == 'zip') {
|
if (getExtension() == 'zip') {
|
||||||
sccachePath = yield (0, tool_cache_1.extractZip)(sccachePackage);
|
sccachePath = yield (0, tool_cache_1.extractZip)(sccachePackage);
|
||||||
}
|
}
|
||||||
@@ -81,6 +81,10 @@ function setup() {
|
|||||||
core.addPath(`${sccacheHome}`);
|
core.addPath(`${sccacheHome}`);
|
||||||
// Expose the sccache path as env.
|
// Expose the sccache path as env.
|
||||||
core.exportVariable('SCCACHE_PATH', `${sccacheHome}/sccache`);
|
core.exportVariable('SCCACHE_PATH', `${sccacheHome}/sccache`);
|
||||||
|
// Expose the gha cache related variable to make users eaiser to
|
||||||
|
// integrate with gha support.
|
||||||
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function getFilename(version) {
|
function getFilename(version) {
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ async function setup() {
|
|||||||
core.addPath(`${sccacheHome}`);
|
core.addPath(`${sccacheHome}`);
|
||||||
// Expose the sccache path as env.
|
// Expose the sccache path as env.
|
||||||
core.exportVariable('SCCACHE_PATH', `${sccacheHome}/sccache`);
|
core.exportVariable('SCCACHE_PATH', `${sccacheHome}/sccache`);
|
||||||
|
|
||||||
|
// Expose the gha cache related variable to make users eaiser to
|
||||||
|
// integrate with gha support.
|
||||||
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
|
core.exportVariable(
|
||||||
|
'ACTIONS_RUNTIME_TOKEN',
|
||||||
|
process.env.ACTIONS_RUNTIME_TOKEN || ''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFilename(version: string): Error | string {
|
function getFilename(version: string): Error | string {
|
||||||
|
|||||||
Reference in New Issue
Block a user