mirror of
https://github.com/DeLaGuardo/setup-clojure.git
synced 2024-12-27 00:16:21 +08:00
parent
a7463fd4d6
commit
a434c7d415
@ -44,6 +44,9 @@ jobs:
|
||||
cli: 1.10.1.693 # Clojure CLI based on tools.deps
|
||||
lein: 2.9.1 # or use 'latest' to always provision latest version of leiningen
|
||||
boot: 2.8.3 # or use 'latest' to always provision latest version of boot
|
||||
|
||||
# (optional) To avoid rate limit errors please provide github token
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Execute clojure code on Linux and MacOS
|
||||
if: ${{ matrix.os != 'windows-latest' }}
|
||||
|
25
dist/index.js
vendored
25
dist/index.js
vendored
@ -1621,14 +1621,14 @@ if (!tempDirectory) {
|
||||
}
|
||||
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
||||
}
|
||||
function setup(version) {
|
||||
function setup(version, githubAuth) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let toolPath = tc.find('Boot', utils.getCacheVersionString(version), os.arch());
|
||||
if (toolPath && version !== 'latest') {
|
||||
core.info(`Boot found in cache ${toolPath}`);
|
||||
}
|
||||
else {
|
||||
const bootBootstrapFile = yield tc.downloadTool(`https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh`);
|
||||
const bootBootstrapFile = yield tc.downloadTool(`https://github.com/boot-clj/boot-bin/releases/download/latest/boot.sh`, undefined, githubAuth);
|
||||
const tempDir = path.join(tempDirectory, `temp_${Math.floor(Math.random() * 2000000000)}`);
|
||||
const bootDir = yield installBoot(bootBootstrapFile, tempDir, version);
|
||||
core.debug(`Boot installed to ${bootDir}`);
|
||||
@ -3541,14 +3541,14 @@ const os = __importStar(__webpack_require__(87));
|
||||
const utils = __importStar(__webpack_require__(611));
|
||||
const tempDirectory = utils.getTempDir();
|
||||
const IS_WINDOWS = utils.isWindows();
|
||||
function setup(version) {
|
||||
function setup(version, githubAuth) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let toolPath = tc.find('Leiningen', utils.getCacheVersionString(version), os.arch());
|
||||
if (toolPath && version !== 'latest') {
|
||||
core.info(`Leiningen found in cache ${toolPath}`);
|
||||
}
|
||||
else {
|
||||
const leiningenFile = yield tc.downloadTool(`https://raw.githubusercontent.com/technomancy/leiningen/${version === 'latest' ? 'stable' : version}/bin/lein${IS_WINDOWS ? '.ps1' : ''}`);
|
||||
const leiningenFile = yield tc.downloadTool(`https://raw.githubusercontent.com/technomancy/leiningen/${version === 'latest' ? 'stable' : version}/bin/lein${IS_WINDOWS ? '.ps1' : ''}`, undefined, githubAuth);
|
||||
const tempDir = path.join(tempDirectory, `temp_${Math.floor(Math.random() * 2000000000)}`);
|
||||
const leiningenDir = yield installLeiningen(leiningenFile, tempDir);
|
||||
core.debug(`Leiningen installed to ${leiningenDir}`);
|
||||
@ -3645,14 +3645,16 @@ function run() {
|
||||
const BOOT_VERSION = core.getInput('boot');
|
||||
const TDEPS_VERSION = core.getInput('tools-deps');
|
||||
const CLI_VERSION = core.getInput('cli');
|
||||
const githubToken = core.getInput('github-token');
|
||||
const githubAuth = githubToken ? `token ${githubToken}` : undefined;
|
||||
if (LEIN_VERSION) {
|
||||
lein.setup(LEIN_VERSION);
|
||||
lein.setup(LEIN_VERSION, githubAuth);
|
||||
}
|
||||
if (BOOT_VERSION) {
|
||||
if (IS_WINDOWS) {
|
||||
throw new Error('Boot on windows is not supported yet.');
|
||||
}
|
||||
boot.setup(BOOT_VERSION);
|
||||
boot.setup(BOOT_VERSION, githubAuth);
|
||||
}
|
||||
if (CLI_VERSION) {
|
||||
if (IS_WINDOWS) {
|
||||
@ -4045,7 +4047,7 @@ const path = __importStar(__webpack_require__(622));
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const utils = __importStar(__webpack_require__(611));
|
||||
const tempDirectory = utils.getTempDir();
|
||||
function setup(version) {
|
||||
function setup(version, githubToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let toolPath = tc.find('ClojureToolsDeps', utils.getCacheVersionString(version), os.arch());
|
||||
if (toolPath && version !== 'latest') {
|
||||
@ -4055,7 +4057,7 @@ function setup(version) {
|
||||
const tempDir = path.join(tempDirectory, `temp_${Math.floor(Math.random() * 2000000000)}`);
|
||||
const clojureInstallScript = yield tc.downloadTool(`https://download.clojure.org/install/linux-install${version === 'latest' ? '' : `-${version}`}.sh`);
|
||||
if (utils.isMacOS()) {
|
||||
yield MacOSDeps(clojureInstallScript);
|
||||
yield MacOSDeps(clojureInstallScript, githubToken);
|
||||
}
|
||||
const clojureToolsDir = yield runLinuxInstall(clojureInstallScript, tempDir);
|
||||
core.debug(`clojure tools deps installed to ${clojureToolsDir}`);
|
||||
@ -4075,7 +4077,7 @@ function runLinuxInstall(installScript, destinationFolder) {
|
||||
return destinationFolder;
|
||||
});
|
||||
}
|
||||
function MacOSDeps(file) {
|
||||
function MacOSDeps(file, githubToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
fs.readFile(file, 'utf-8', function (err, data) {
|
||||
if (err)
|
||||
@ -4086,7 +4088,10 @@ function MacOSDeps(file) {
|
||||
throw e;
|
||||
});
|
||||
});
|
||||
yield exec.exec(`brew install coreutils`);
|
||||
const env = githubToken
|
||||
? { env: { HOMEBREW_GITHUB_API_TOKEN: githubToken } }
|
||||
: undefined;
|
||||
yield exec.exec('brew', ['install', 'coreutils'], env);
|
||||
});
|
||||
}
|
||||
function setupWindows(version) {
|
||||
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
8428
package-lock.json
generated
8428
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@ -31,19 +31,19 @@
|
||||
"@actions/tool-cache": "^1.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.3",
|
||||
"@types/node": "^16.11.11",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^17.0.19",
|
||||
"@types/semver": "^7.3.9",
|
||||
"@typescript-eslint/parser": "^5.5.0",
|
||||
"@typescript-eslint/parser": "^5.12.0",
|
||||
"@zeit/ncc": "^0.22.3",
|
||||
"eslint": "^8.3.0",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-plugin-github": "^4.3.5",
|
||||
"eslint-plugin-jest": "^25.3.0",
|
||||
"jest": "^27.4.3",
|
||||
"jest-circus": "^27.4.2",
|
||||
"eslint-plugin-jest": "^26.1.1",
|
||||
"jest": "^27.5.1",
|
||||
"jest-circus": "^27.5.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "2.5.0",
|
||||
"ts-jest": "^27.0.7",
|
||||
"typescript": "^4.5.2"
|
||||
"prettier": "2.5.1",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.5.5"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user