@@ -394,13 +394,30 @@ const os = __importStar(__nccwpck_require__(2037));
394394const fs = __importStar(__nccwpck_require__(6078));
395395const utils = __importStar(__nccwpck_require__(918));
396396exports.identifier = 'ClojureToolsDeps';
397- function setup(version, githubToken) {
397+ const client = new http.HttpClient('actions/setup-clojure', undefined, {
398+ allowRetries: true,
399+ maxRetries: 3
400+ });
401+ function toolVersion(version) {
402+ return __awaiter(this, void 0, void 0, function* () {
403+ if (version === 'latest') {
404+ const res = yield client.get('https://download.clojure.org/install/stable.properties');
405+ const versionString = yield res.readBody();
406+ return versionString.split(' ')[0];
407+ }
408+ else {
409+ return version;
410+ }
411+ });
412+ }
413+ function setup(requestedVersion, githubToken) {
398414 return __awaiter(this, void 0, void 0, function* () {
415+ const version = yield toolVersion(requestedVersion);
399416 const installDir = utils.isWindows()
400417 ? 'C:\\Program Files\\WindowsPowerShell\\Modules'
401418 : '/tmp/usr/local/opt';
402419 const toolPath = tc.find(exports.identifier, utils.getCacheVersionString(version), os.arch());
403- if (toolPath && version !== 'latest' ) {
420+ if (toolPath) {
404421 core.info(`Clojure CLI found in cache ${toolPath}`);
405422 yield fs.mkdir(installDir, { recursive: true });
406423 yield fs.cp(toolPath, path.join(installDir, 'ClojureTools'), {
@@ -409,7 +426,7 @@ function setup(version, githubToken) {
409426 }
410427 else {
411428 if (utils.isWindows()) {
412- const url = `download.clojure.org/install/win-install${version === 'latest' ? '' : ` -${version}` }.ps1`;
429+ const url = `download.clojure.org/install/win-install-${version}.ps1`;
413430 yield exec.exec(`powershell -c "iwr -useb ${url} | iex"`, [], {
414431 // Install to a modules location common to powershell/pwsh
415432 env: { PSModulePath: installDir },
@@ -419,7 +436,7 @@ function setup(version, githubToken) {
419436 yield tc.cacheDir(path.join(installDir, 'ClojureTools'), exports.identifier, utils.getCacheVersionString(version));
420437 }
421438 else {
422- const clojureInstallScript = yield tc.downloadTool(`https://download.clojure.org/install/linux-install${version === 'latest' ? '' : ` -${version}` }.sh`);
439+ const clojureInstallScript = yield tc.downloadTool(`https://download.clojure.org/install/linux-install-${version}.sh`);
423440 if (utils.isMacOS()) {
424441 yield MacOSDeps(clojureInstallScript, githubToken);
425442 }
@@ -457,10 +474,6 @@ function MacOSDeps(file, githubToken) {
457474function getLatestDepsClj(githubAuth) {
458475 var _a, _b;
459476 return __awaiter(this, void 0, void 0, function* () {
460- const client = new http.HttpClient('actions/setup-clojure', undefined, {
461- allowRetries: true,
462- maxRetries: 3
463- });
464477 const res = yield client.getJson(`https://api.github.com/repos/borkdude/deps.clj/releases/latest`, githubAuth ? { Authorization: githubAuth } : undefined);
465478 const result = (_b = (_a = res.result) === null || _a === void 0 ? void 0 : _a.tag_name) === null || _b === void 0 ? void 0 : _b.replace(/^v/, '');
466479 if (result) {
0 commit comments