aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Odersky <jakob@odersky.com>2019-11-13 18:51:15 -0500
committerJakob Odersky <jakob@odersky.com>2019-11-13 18:51:15 -0500
commita27a6efd49eb79af9f9cee9f1a68f3f27de13f5b (patch)
tree7139c8b30706c249e695203fc2c9b79a9b547f97
parent2f862d2567414881a7befdf745331bb9457e9603 (diff)
downloadsetup-mill-a27a6efd49eb79af9f9cee9f1a68f3f27de13f5b.tar.gz
setup-mill-a27a6efd49eb79af9f9cee9f1a68f3f27de13f5b.tar.bz2
setup-mill-a27a6efd49eb79af9f9cee9f1a68f3f27de13f5b.zip
Save mill in folder outside of workdirv0.2.0
-rw-r--r--setup.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/setup.js b/setup.js
index 2e83f83..4702a5d 100644
--- a/setup.js
+++ b/setup.js
@@ -7,22 +7,25 @@ const os = require('os');
const path = require('path');
async function run() {
+
+ const millPath = `${process.env["HOME"]}/mill`;
+
try {
const millVersion = core.getInput('mill-version');
- var millPath = tc.find('mill', millVersion);
- if (!millPath) {
+ var cachedMillPath = tc.find('mill', millVersion);
+ if (!cachedMillPath) {
core.info('no cached version found');
core.info('downloading mill');
const downloadPath = await tc.downloadTool(`https://github.com/lihaoyi/mill/releases/download/${millVersion}/${millVersion}-assembly`);
- await io.mkdirP('mill');
- await io.cp(downloadPath, 'mill/mill', { force: true });
- fs.chmodSync('mill/mill', '0755')
- millPath = await tc.cacheDir('mill', 'mill', millVersion);
+ await io.mkdirP(millPath);
+ await io.cp(downloadPath, `${millPath}/mill`, { force: true });
+ fs.chmodSync(`${millPath}/mill`, '0755')
+ cachedMillPath = await tc.cacheDir(millPath, 'mill', millVersion);
} else {
- core.info(`using cached version of mill: ${millPath}`);
+ core.info(`using cached version of mill: ${cachedMillPath}`);
}
- core.addPath(millPath);
+ core.addPath(cachedMillPath);
// warm up mill, this populates ~/.mill
// TODO: once caching across workflow invocations is available, this dorectory should be cached too