diff options
author | Jakob Odersky <jakob@odersky.com> | 2019-11-13 18:51:15 -0500 |
---|---|---|
committer | Jakob Odersky <jakob@odersky.com> | 2019-11-13 18:51:15 -0500 |
commit | a27a6efd49eb79af9f9cee9f1a68f3f27de13f5b (patch) | |
tree | 7139c8b30706c249e695203fc2c9b79a9b547f97 | |
parent | 2f862d2567414881a7befdf745331bb9457e9603 (diff) | |
download | setup-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.js | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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 |