call nix-build even if signing key is not set

This commit is contained in:
Domen Kožar 2020-02-29 18:27:13 +01:00
commit a3cf8f1b39
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
2 changed files with 37 additions and 29 deletions

View file

@ -43,10 +43,13 @@ 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') { if (skipNixBuild !== 'true') {
core.startGroup(`Invoking nix-build`); 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 = ''; let paths = '';
const options = { const options = {
listeners: { listeners: {
@ -59,6 +62,7 @@ function run() {
const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/); const additionalArgs = strings_1.nonEmptySplit(nixBuildArgs, /\s+/);
yield exec.exec('nix-build', additionalArgs.concat(args), options); yield exec.exec('nix-build', additionalArgs.concat(args), options);
core.endGroup(); 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();

View file

@ -31,12 +31,15 @@ async function run() {
if (signingKey !== "") { if (signingKey !== "") {
core.exportVariable('CACHIX_SIGNING_KEY', signingKey); core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
}
if (skipNixBuild !== 'true') { if (skipNixBuild !== 'true') {
core.startGroup(`Invoking nix-build`); 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 = {
@ -51,6 +54,7 @@ async function run() {
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();