Skip to content

Commit

Permalink
v2
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Oct 3, 2019
1 parent 9e7ef4f commit ae6c2ec
Show file tree
Hide file tree
Showing 174 changed files with 13,199 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
__tests__/runner/*

# comment out in distribution branches
node_modules/

# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
Expand Down
20 changes: 14 additions & 6 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = '';
Expand All @@ -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}`);
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/semver

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/uuid

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 97 additions & 0 deletions node_modules/@actions/core/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions node_modules/@actions/core/lib/command.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 66 additions & 0 deletions node_modules/@actions/core/lib/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/@actions/core/lib/command.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

99 changes: 99 additions & 0 deletions node_modules/@actions/core/lib/core.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ae6c2ec

Please sign in to comment.