mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
Merge pull request #31 from cachix/fix-pr-build
call nix-build even if signing key is not set
This commit is contained in:
commit
9cc8b08cb0
2 changed files with 37 additions and 29 deletions
32
lib/main.js
32
lib/main.js
|
|
@ -43,22 +43,26 @@ function run() {
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
if (skipNixBuild !== 'true') {
|
}
|
||||||
core.startGroup(`Invoking nix-build`);
|
if (skipNixBuild !== 'true') {
|
||||||
|
core.startGroup(`Invoking nix-build`);
|
||||||
|
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`]);
|
||||||
let paths = '';
|
}
|
||||||
const options = {
|
let paths = '';
|
||||||
listeners: {
|
const options = {
|
||||||
stdout: (data) => {
|
listeners: {
|
||||||
paths += data.toString();
|
stdout: (data) => {
|
||||||
},
|
paths += data.toString();
|
||||||
}
|
},
|
||||||
};
|
}
|
||||||
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
};
|
||||||
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
|
const args = strings_1.prependEach('-A', strings_1.nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
||||||
yield exec.exec('nix-build', additionalArgs.concat(args), options);
|
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
|
||||||
core.endGroup();
|
yield exec.exec('nix-build', additionalArgs.concat(args), options);
|
||||||
|
core.endGroup();
|
||||||
|
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();
|
||||||
|
|
|
||||||
34
src/main.ts
34
src/main.ts
|
|
@ -31,26 +31,30 @@ async function run() {
|
||||||
|
|
||||||
if (signingKey !== "") {
|
if (signingKey !== "") {
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
|
}
|
||||||
if (skipNixBuild !== 'true') {
|
|
||||||
core.startGroup(`Invoking nix-build`);
|
|
||||||
|
|
||||||
|
if (skipNixBuild !== 'true') {
|
||||||
|
core.startGroup(`Invoking nix-build`);
|
||||||
|
|
||||||
|
if (signingKey !== "") {
|
||||||
// Remember existing store paths
|
// Remember existing store paths
|
||||||
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > store-path-pre-build`]);
|
await exec.exec("sh", ["-c", `nix path-info --all | grep -v '\.drv$' > store-path-pre-build`]);
|
||||||
|
}
|
||||||
|
|
||||||
let paths = '';
|
let paths = '';
|
||||||
const options = {
|
const options = {
|
||||||
listeners: {
|
listeners: {
|
||||||
stdout: (data: Buffer) => {
|
stdout: (data: Buffer) => {
|
||||||
paths += data.toString();
|
paths += data.toString();
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
const args = prependEach('-A', nonEmptySplit(attributes, /\s+/)).concat([file || "default.nix"]);
|
||||||
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
|
const additionalArgs = nonEmptySplit(nixBuildArgs, /\s+/);
|
||||||
await exec.exec('nix-build', additionalArgs.concat(args), options);
|
await exec.exec('nix-build', additionalArgs.concat(args), options);
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
|
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