Skip to content

Commit a974635

Browse files
authored
Sucessfully ended tests (#1)
1 parent eb1e132 commit a974635

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

dist/index.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,20 +1303,23 @@ async function run() {
13031303
// const awesomeCiName = actionsPath + "/awesome-ci"
13041304
// Download awesome-ci
13051305
const repo = "fullstack-devops/awesome-ci";
1306-
const downloadUrl = `https://github.com/${repo}/releases/download/${wantedVersion}/awesome-ci_${wantedVersion}_${wantedArch}`;
1307-
// const file = fs.createWriteStream(awesomeCiName);
1308-
// core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
1309-
const downloadPath = await tc.downloadTool(downloadUrl, undefined);
1310-
core.info(`downloaded awesome-ci to ${downloadPath}`);
1311-
fs.rename(downloadPath + "/awesome-ci*", "awesome-ci", (err) => {
1306+
const aciName = `awesome-ci_${wantedVersion}_${wantedArch}`;
1307+
const newAciLoc = `${process.env.HOME}/bin`;
1308+
const newAciLocFile = path.join(newAciLoc, 'awesome-ci');
1309+
console.log(newAciLoc);
1310+
const downloadUrl = `https://github.com/${repo}/releases/download/${wantedVersion}/${aciName}`;
1311+
const downloadPath = await tc.downloadTool(downloadUrl, newAciLocFile);
1312+
core.info(`downloaded awesome-ci to ${newAciLocFile}`);
1313+
core.info('Adding to the cache ...');
1314+
const cachedDir = await tc.cacheDir(newAciLoc, 'awesome-ci', wantedVersion);
1315+
core.info(`Successfully cached awesome-ci to ${cachedDir}`);
1316+
fs.chmod(`${cachedDir}/awesome-ci`, 0o777, (err) => {
13121317
if (err)
13131318
throw core.error(err);
1314-
core.info('successfully renamed awesome-ci!');
1319+
core.info('successfully add access rights to awesome-ci!');
13151320
});
1316-
const extPath = path.join(downloadPath, 'awesome-ci');
1317-
core.info('Adding to the cache ...');
1318-
const cachedDir = await tc.cacheDir(extPath, 'awesome-ci', wantedVersion);
1319-
core.info(`Successfully cached awesome-ci to ${cachedDir}`);
1321+
core.addPath(cachedDir);
1322+
core.info('Added awesome-ci to the path');
13201323
}
13211324
run();
13221325

src/main.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,30 @@ async function run() {
1010

1111
// Download awesome-ci
1212
const repo = "fullstack-devops/awesome-ci"
13-
const downloadUrl = `https://github.com/${repo}/releases/download/${wantedVersion}/awesome-ci_${wantedVersion}_${wantedArch}`
14-
// const file = fs.createWriteStream(awesomeCiName);
13+
const aciName = `awesome-ci_${wantedVersion}_${wantedArch}`
14+
const newAciLoc = `${process.env.HOME}/bin`
15+
const newAciLocFile = path.join(newAciLoc, 'awesome-ci');
16+
console.log(newAciLoc)
1517

16-
// core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
17-
const downloadPath = await tc.downloadTool(downloadUrl, undefined);
18-
core.info(`downloaded awesome-ci to ${downloadPath}`)
19-
fs.rename(downloadPath+"/awesome-ci*", "awesome-ci", (err) => {
20-
if (err) throw core.error(err);
21-
core.info('successfully renamed awesome-ci!');
22-
})
23-
24-
const extPath = path.join(downloadPath, 'awesome-ci');
18+
const downloadUrl = `https://github.com/${repo}/releases/download/${wantedVersion}/${aciName}`
19+
const downloadPath = await tc.downloadTool(downloadUrl, newAciLocFile);
20+
core.info(`downloaded awesome-ci to ${newAciLocFile}`)
2521

2622
core.info('Adding to the cache ...');
2723
const cachedDir = await tc.cacheDir(
28-
extPath,
24+
newAciLoc,
2925
'awesome-ci',
3026
wantedVersion
3127
);
3228
core.info(`Successfully cached awesome-ci to ${cachedDir}`);
29+
30+
fs.chmod(`${cachedDir}/awesome-ci`, 0o777, (err) => {
31+
if (err) throw core.error(err);
32+
core.info('successfully add access rights to awesome-ci!');
33+
})
34+
35+
core.addPath(cachedDir);
36+
core.info('Added awesome-ci to the path');
3337
}
3438

3539

0 commit comments

Comments
 (0)