Skip to content

Commit 9a9208e

Browse files
committed
Build dist directory.
1 parent 2663c65 commit 9a9208e

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

dist/index.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,38 @@ function run() {
5050
return;
5151
}
5252
try {
53-
let dfxVersion = core.getInput('dfx-version');
53+
const dfxVersion = core.getInput('dfx-version');
5454
core.info(`Setup dfx version ${dfxVersion}`);
5555
// Opt-out of having data collected about dfx usage.
5656
core.exportVariable('DFX_TELEMETRY_DISABLED', 1);
5757
// Install dfx.
5858
child_process_1.default.execSync(`echo y | DFX_VERSION=${dfxVersion} sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"`);
5959
core.addPath('/home/runner/bin');
60-
let dfxPath = yield io.which('dfx');
60+
const dfxPath = yield io.which('dfx');
6161
core.debug(dfxPath);
6262
infoExec(`${dfxPath} --version`);
63+
// Setup identity.
64+
const id = process.env[`DFX_IDENTITY_PEM`] || '';
65+
if (id) {
66+
child_process_1.default.execSync(`${dfxPath} identity new action`);
67+
child_process_1.default.execSync(`chmod +w /home/runner/.config/dfx/identity/action/identity.pem`);
68+
child_process_1.default.execSync(`echo "${id}" > /home/runner/.config/dfx/identity/action/identity.pem`);
69+
infoExec(`${dfxPath} identity list`);
70+
}
6371
// Install dfx cache to get moc.
6472
if (core.getBooleanInput('install-moc')) {
6573
child_process_1.default.execSync(`${dfxPath} cache install`);
66-
let cachePath = infoExec(`${dfxPath} cache show`).trim();
74+
const cachePath = infoExec(`${dfxPath} cache show`).trim();
6775
core.addPath(cachePath);
68-
let mocPath = yield io.which('moc');
76+
const mocPath = yield io.which('moc');
6977
infoExec(`${mocPath} --version`);
7078
}
7179
// Install vessel.
72-
let vesselVersion = core.getInput('vessel-version');
80+
const vesselVersion = core.getInput('vessel-version');
7381
if (vesselVersion) {
7482
child_process_1.default.execSync(`curl -L https://github.com/dfinity/vessel/releases/download/v${vesselVersion}/vessel-linux64 > /home/runner/bin/vessel`);
7583
child_process_1.default.execSync(`chmod +x /home/runner/bin/vessel`);
76-
let vesselPath = yield io.which('vessel');
84+
const vesselPath = yield io.which('vessel');
7785
infoExec(`${vesselPath} --version`);
7886
}
7987
}
@@ -84,7 +92,7 @@ function run() {
8492
}
8593
exports.run = run;
8694
function infoExec(command) {
87-
let cmdStr = (child_process_1.default.execSync(command) || '').toString();
95+
const cmdStr = (child_process_1.default.execSync(command) || '').toString();
8896
core.info(cmdStr);
8997
return cmdStr;
9098
}

0 commit comments

Comments
 (0)