Skip to content

Delete downloaded archive after extracting it during install #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97011,6 +97011,7 @@ const httpm = __importStar(__nccwpck_require__(4844));
const exec = __importStar(__nccwpck_require__(5236));
const fs_1 = __importDefault(__nccwpck_require__(9896));
const utils_1 = __nccwpck_require__(1798);
const io_util_1 = __nccwpck_require__(5207);
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
function installGraalPy(graalpyVersion, architecture, allowPreReleases, releases) {
Expand Down Expand Up @@ -97039,6 +97040,8 @@ function installGraalPy(graalpyVersion, architecture, allowPreReleases, releases
const graalpyPath = yield tc.downloadTool(downloadUrl, undefined, AUTH);
core.info('Extracting downloaded archive...');
downloadDir = yield tc.extractTar(graalpyPath);
core.info('Deleting downloaded archive...');
yield (0, io_util_1.rm)(graalpyPath);
// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs_1.default.readdirSync(downloadDir)[0];
Expand Down Expand Up @@ -97231,6 +97234,7 @@ const httpm = __importStar(__nccwpck_require__(4844));
const exec = __importStar(__nccwpck_require__(5236));
const fs_1 = __importDefault(__nccwpck_require__(9896));
const utils_1 = __nccwpck_require__(1798);
const io_util_1 = __nccwpck_require__(5207);
function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases, releases) {
return __awaiter(this, void 0, void 0, function* () {
let downloadDir;
Expand Down Expand Up @@ -97263,6 +97267,8 @@ function installPyPy(pypyVersion, pythonVersion, architecture, allowPreReleases,
else {
downloadDir = yield tc.extractTar(pypyPath, undefined, 'x');
}
core.info('Deleting downloaded archive...');
yield (0, io_util_1.rm)(pypyPath);
// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs_1.default.readdirSync(downloadDir)[0];
Expand Down Expand Up @@ -97444,6 +97450,7 @@ const core = __importStar(__nccwpck_require__(7484));
const tc = __importStar(__nccwpck_require__(3472));
const exec = __importStar(__nccwpck_require__(5236));
const httpm = __importStar(__nccwpck_require__(4844));
const io_util_1 = __nccwpck_require__(5207);
const utils_1 = __nccwpck_require__(1798);
const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
Expand Down Expand Up @@ -97555,6 +97562,8 @@ function installCpythonFromRelease(release) {
else {
pythonExtractedFolder = yield tc.extractTar(pythonPath);
}
core.info('Delete downloaded archive');
yield (0, io_util_1.rm)(pythonPath);
core.info('Execute installation script');
yield installPython(pythonExtractedFolder);
}
Expand Down
4 changes: 4 additions & 0 deletions src/install-graalpy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getBinaryDirectory,
getNextPageUrl
} from './utils';
import {rm} from '@actions/io/lib/io-util';

const TOKEN = core.getInput('token');
const AUTH = !TOKEN ? undefined : `token ${TOKEN}`;
Expand Down Expand Up @@ -66,6 +67,9 @@ export async function installGraalPy(
core.info('Extracting downloaded archive...');
downloadDir = await tc.extractTar(graalpyPath);

core.info('Deleting downloaded archive...');
await rm(graalpyPath);

// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs.readdirSync(downloadDir)[0];
Expand Down
4 changes: 4 additions & 0 deletions src/install-pypy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
getBinaryDirectory,
getDownloadFileName
} from './utils';
import {rm} from '@actions/io/lib/io-util';

export async function installPyPy(
pypyVersion: string,
Expand Down Expand Up @@ -81,6 +82,9 @@ export async function installPyPy(
downloadDir = await tc.extractTar(pypyPath, undefined, 'x');
}

core.info('Deleting downloaded archive...');
await rm(pypyPath);

// root folder in archive can have unpredictable name so just take the first folder
// downloadDir is unique folder under TEMP and can't contain any other folders
const archiveName = fs.readdirSync(downloadDir)[0];
Expand Down
4 changes: 4 additions & 0 deletions src/install-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec';
import * as httpm from '@actions/http-client';
import {rm} from '@actions/io/lib/io-util';
import {ExecOptions} from '@actions/exec/lib/interfaces';
import {IS_WINDOWS, IS_LINUX, getDownloadFileName} from './utils';
import {IToolRelease} from '@actions/tool-cache';
Expand Down Expand Up @@ -139,6 +140,9 @@ export async function installCpythonFromRelease(release: tc.IToolRelease) {
pythonExtractedFolder = await tc.extractTar(pythonPath);
}

core.info('Delete downloaded archive');
await rm(pythonPath);

core.info('Execute installation script');
await installPython(pythonExtractedFolder);
} catch (err) {
Expand Down