mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
A tiny bit more consistent logging
This commit is contained in:
parent
a35cbf6bfb
commit
e1a832de5b
2 changed files with 16 additions and 13 deletions
13
lib/main.js
13
lib/main.js
|
|
@ -31,7 +31,7 @@ function run() {
|
||||||
const signingKey = core.getInput('signingKey');
|
const signingKey = core.getInput('signingKey');
|
||||||
const authToken = core.getInput('authToken');
|
const authToken = core.getInput('authToken');
|
||||||
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
|
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
|
||||||
core.startGroup('Installing Cachix');
|
core.startGroup('Cachix: installing');
|
||||||
yield exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
|
yield exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
// for private caches
|
// for private caches
|
||||||
|
|
@ -45,7 +45,10 @@ function run() {
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
}
|
}
|
||||||
if (skipNixBuild !== 'true') {
|
if (skipNixBuild !== 'true') {
|
||||||
core.startGroup(`Invoking nix-build`);
|
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
||||||
|
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
|
||||||
|
const allArgs = additionalArgs.concat(args);
|
||||||
|
core.startGroup(`nix-build {allArgs.join(' ')}`);
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
// Remember existing store paths
|
// Remember existing store paths
|
||||||
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > store-path-pre-build`]);
|
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > store-path-pre-build`]);
|
||||||
|
|
@ -58,12 +61,10 @@ function run() {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
yield exec.exec('nix-build', allArgs, options);
|
||||||
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
|
|
||||||
yield exec.exec('nix-build', additionalArgs.concat(args), options);
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
core.startGroup('Cachix: Pushing paths');
|
core.startGroup('Cachix: pushing paths');
|
||||||
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
yield exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
src/main.ts
16
src/main.ts
|
|
@ -16,7 +16,7 @@ async function run() {
|
||||||
const authToken = core.getInput('authToken')
|
const authToken = core.getInput('authToken')
|
||||||
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
|
const cachixExecutable = "/nix/var/nix/profiles/per-user/runner/profile/bin/cachix";
|
||||||
|
|
||||||
core.startGroup('Installing Cachix')
|
core.startGroup('Cachix: installing')
|
||||||
await exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
|
await exec.exec('nix-env', ['-iA', 'cachix', '-f', 'https://cachix.org/api/v1/install']);
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ async function run() {
|
||||||
await exec.exec(cachixExecutable, ['authtoken', authToken]);
|
await exec.exec(cachixExecutable, ['authtoken', authToken]);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.startGroup(`Cachix: using ` + name);
|
core.startGroup(`Cachix: using cache ` + name);
|
||||||
await exec.exec('cachix', ['use', name]);
|
await exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
|
|
||||||
|
|
@ -34,7 +34,11 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (skipNixBuild !== 'true') {
|
if (skipNixBuild !== 'true') {
|
||||||
core.startGroup(`Invoking nix-build`);
|
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
||||||
|
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
|
||||||
|
const allArgs = additionalArgs.concat(args);
|
||||||
|
|
||||||
|
core.startGroup(`nix-build ${allArgs.join(' ')}`);
|
||||||
|
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
// Remember existing store paths
|
// Remember existing store paths
|
||||||
|
|
@ -49,13 +53,11 @@ async function run() {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
await exec.exec('nix-build', allArgs, options);
|
||||||
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
|
|
||||||
await exec.exec('nix-build', additionalArgs.concat(args), options);
|
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
core.startGroup('Cachix: Pushing paths');
|
core.startGroup('Cachix: pushing paths');
|
||||||
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' | cat - store-path-pre-build | sort | uniq -u | ${cachixExecutable} push ${name}`]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue