mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
bump
This commit is contained in:
parent
affb020ba4
commit
01433080c8
3 changed files with 17 additions and 9 deletions
20
lib/main.js
20
lib/main.js
|
|
@ -26,7 +26,7 @@ function run() {
|
|||
const file = core.getInput('file');
|
||||
const attributes = core.getInput('attributes');
|
||||
const name = core.getInput('name', { required: true });
|
||||
const signingKey = core.getInput('signingKey', { required: true });
|
||||
const signingKey = core.getInput('signingKey');
|
||||
const authToken = core.getInput('authToken');
|
||||
core.startGroup('Installing Cachix');
|
||||
// TODO: use cachix official installation link
|
||||
|
|
@ -39,7 +39,9 @@ function run() {
|
|||
core.startGroup(`Cachix: using ` + name);
|
||||
yield exec.exec('cachix', ['use', name]);
|
||||
core.endGroup();
|
||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||
if (signingKey !== "") {
|
||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||
}
|
||||
// TODO: cachix use --watch-store
|
||||
core.startGroup(`Invoking nix-build`);
|
||||
let paths = '';
|
||||
|
|
@ -50,12 +52,18 @@ function run() {
|
|||
},
|
||||
}
|
||||
};
|
||||
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s/)).concat([file || "default.nix"]);
|
||||
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
||||
yield exec.exec('nix-build', args, options);
|
||||
core.endGroup();
|
||||
core.startGroup(`Cachix: pushing to ` + name);
|
||||
yield exec.exec('cachix', ['push', name].concat(strings_1.nonEmptySplit(paths, /\s/).join(' ')));
|
||||
core.endGroup();
|
||||
// Needed for PRs
|
||||
if (signingKey !== "") {
|
||||
core.startGroup(`Cachix: pushing to ` + name);
|
||||
yield exec.exec('cachix', ['push', name].concat(strings_1.nonEmptySplit(paths, /\s+/)));
|
||||
core.endGroup();
|
||||
}
|
||||
else {
|
||||
console.log("No signing key. Assuming it's a pull request, nothing will be pushed.");
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(`Action failed with error: ${error}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue