Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Maybe now (#3)
Browse files Browse the repository at this point in the history
* ..

* fix from

* fix from
  • Loading branch information
aviramha authored Dec 7, 2022
1 parent 223d202 commit 91e5897
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to the project will be here.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [1.0.2] - 2022-12-07

### Fixed

- It should work now by using binaries from a fork.

## [1.0.1] - 2022-12-07

### Fixed

- maybe work?

## [1.0.0] - 2022-12-07

### Added
Expand Down
16 changes: 10 additions & 6 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6578,20 +6578,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186));
const exec_1 = __nccwpck_require__(1514);
const tool_cache_1 = __nccwpck_require__(7784);
const fs_1 = __nccwpck_require__(7147);
const path = __importStar(__nccwpck_require__(1017));
// WE're using a patched version provided on my repo because
// the original repo didn't release binaries yet with GHA support.
// Todo: make this input
const VERSION = "0.3.1";
const VERSION = "0.3.1-gha";
const TOOL_NAME = "sccache";
function getDownloadPath() {
switch (process.platform) {
case "darwin":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-apple-darwin.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-apple-darwin.tar.gz`;
case "linux":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-unknown-linux-musl.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-unknown-linux-musl.tar.gz`;
case "win32":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-pc-windows-msvc.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-pc-windows-msvc.tar.gz`;
default:
throw new Error(`Unsupported platform: ${process.platform}`);
}
Expand All @@ -6614,9 +6617,10 @@ function setCache(sccacheDirectory) {
core.exportVariable("ACTIONS_CACHE_URL", process.env.ACTIONS_CACHE_URL);
core.exportVariable("ACTIONS_RUNTIME_TOKEN", process.env.ACTIONS_RUNTIME_TOKEN);
//todo: make this input
core.exportVariable("SCCACHE_GHA_CACHE_TO", "sccache");
core.exportVariable("SCCACHE_GHA_CACHE_FROM", "sccache");
core.exportVariable("SCCACHE_GHA_CACHE_TO", "sccache-latest");
core.exportVariable("SCCACHE_GHA_CACHE_FROM", "sccache-");
core.addPath(sccacheDirectory);
(0, exec_1.exec)("sccache", ["--start-server"]);
core.debug("Configured sccache!");
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sccache-rust-action",
"version": "0.1.0",
"version": "1.0.2",
"private": true,
"description": "sccache Rust Action",
"main": "lib/main.js",
Expand Down
16 changes: 10 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import * as core from "@actions/core";
import { exec } from "@actions/exec";
import { cacheDir, downloadTool, extractTar, find } from "@actions/tool-cache";
import { promises as fs } from "fs";
import * as path from "path";

// WE're using a patched version provided on my repo because
// the original repo didn't release binaries yet with GHA support.
// Todo: make this input
const VERSION = "0.3.1";
const VERSION = "0.3.1-gha";
const TOOL_NAME = "sccache";

function getDownloadPath(): string {
switch (process.platform) {
case "darwin":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-apple-darwin.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-apple-darwin.tar.gz`;
case "linux":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-unknown-linux-musl.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-unknown-linux-musl.tar.gz`;
case "win32":
return `https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-pc-windows-msvc.tar.gz`;
return `https://github.com/aviramha/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-x86_64-pc-windows-msvc.tar.gz`;
default:
throw new Error(`Unsupported platform: ${process.platform}`);
}
Expand All @@ -39,9 +42,10 @@ async function setCache(sccacheDirectory: string): Promise<void> {
process.env.ACTIONS_RUNTIME_TOKEN
);
//todo: make this input
core.exportVariable("SCCACHE_GHA_CACHE_TO", "sccache");
core.exportVariable("SCCACHE_GHA_CACHE_FROM", "sccache");
core.exportVariable("SCCACHE_GHA_CACHE_TO", "sccache-latest");
core.exportVariable("SCCACHE_GHA_CACHE_FROM", "sccache-");
core.addPath(sccacheDirectory);
exec("sccache", ["--start-server"]);
core.debug("Configured sccache!");
}

Expand Down

0 comments on commit 91e5897

Please sign in to comment.