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
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
- run: yarn install --frozen-lockfile
|
- run: yarn install --frozen-lockfile
|
||||||
- run: yarn build
|
- run: yarn build
|
||||||
- run: yarn test
|
- run: yarn test
|
||||||
- uses: cachix/install-nix-action@v2
|
- uses: cachix/install-nix-action@v3
|
||||||
- name: Test public cache
|
- name: Test public cache
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: cachix/install-nix-action@v2
|
- uses: cachix/install-nix-action@v3
|
||||||
- uses: cachix/cachix-action@v1
|
- uses: cachix/cachix-action@v2
|
||||||
with:
|
with:
|
||||||
name: cachix-action
|
name: cachix-action
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
|
|
|
||||||
20
lib/main.js
20
lib/main.js
|
|
@ -26,7 +26,7 @@ function run() {
|
||||||
const file = core.getInput('file');
|
const file = core.getInput('file');
|
||||||
const attributes = core.getInput('attributes');
|
const attributes = core.getInput('attributes');
|
||||||
const name = core.getInput('name', { required: true });
|
const name = core.getInput('name', { required: true });
|
||||||
const signingKey = core.getInput('signingKey', { required: true });
|
const signingKey = core.getInput('signingKey');
|
||||||
const authToken = core.getInput('authToken');
|
const authToken = core.getInput('authToken');
|
||||||
core.startGroup('Installing Cachix');
|
core.startGroup('Installing Cachix');
|
||||||
// TODO: use cachix official installation link
|
// TODO: use cachix official installation link
|
||||||
|
|
@ -39,7 +39,9 @@ function run() {
|
||||||
core.startGroup(`Cachix: using ` + name);
|
core.startGroup(`Cachix: using ` + name);
|
||||||
yield exec.exec('cachix', ['use', name]);
|
yield exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
if (signingKey !== "") {
|
||||||
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
|
}
|
||||||
// TODO: cachix use --watch-store
|
// TODO: cachix use --watch-store
|
||||||
core.startGroup(`Invoking nix-build`);
|
core.startGroup(`Invoking nix-build`);
|
||||||
let paths = '';
|
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);
|
yield exec.exec('nix-build', args, options);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
core.startGroup(`Cachix: pushing to ` + name);
|
// Needed for PRs
|
||||||
yield exec.exec('cachix', ['push', name].concat(strings_1.nonEmptySplit(paths, /\s/).join(' ')));
|
if (signingKey !== "") {
|
||||||
core.endGroup();
|
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) {
|
catch (error) {
|
||||||
core.setFailed(`Action failed with error: ${error}`);
|
core.setFailed(`Action failed with error: ${error}`);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue