mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 09:34:11 +02:00
push -> name
This commit is contained in:
parent
34a3c66a7e
commit
5e116bc9ac
5 changed files with 15 additions and 15 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -18,13 +18,13 @@ jobs:
|
||||||
- name: Test public cache
|
- name: Test public cache
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
push: cachix-action
|
name: cachix-action
|
||||||
file: test.nix
|
file: test.nix
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
- name: Test private cache
|
- name: Test private cache
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
push: cachix-action-private
|
name: cachix-action-private
|
||||||
file: test.nix
|
file: test.nix
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY_PRIVATE }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY_PRIVATE }}'
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
- uses: cachix/install-nix-action@v2
|
- uses: cachix/install-nix-action@v2
|
||||||
- uses: cachix/cachix-action@v1
|
- uses: cachix/cachix-action@v1
|
||||||
with:
|
with:
|
||||||
push: cachix-action
|
name: cachix-action
|
||||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||||
# Only needed for private caches
|
# Only needed for private caches
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ inputs:
|
||||||
description: 'Nix file to build. Defaults to default.nix'
|
description: 'Nix file to build. Defaults to default.nix'
|
||||||
attributes:
|
attributes:
|
||||||
description: 'Nix attributes to nix-build. By default, all attributes are built.'
|
description: 'Nix attributes to nix-build. By default, all attributes are built.'
|
||||||
push:
|
name:
|
||||||
description: 'Names of cachix caches to push (and pull/substitute)'
|
description: 'Name of a cachix cache to push and pull/substitute'
|
||||||
required: true
|
required: true
|
||||||
authToken:
|
authToken:
|
||||||
description: 'Authentication token for Cachix, needed only for private cache access'
|
description: 'Authentication token for Cachix, needed only for private cache access'
|
||||||
|
|
|
||||||
10
lib/main.js
10
lib/main.js
|
|
@ -25,7 +25,7 @@ function run() {
|
||||||
// inputs
|
// inputs
|
||||||
const file = core.getInput('file');
|
const file = core.getInput('file');
|
||||||
const attributes = core.getInput('attributes');
|
const attributes = core.getInput('attributes');
|
||||||
const push = core.getInput('push', { required: true });
|
const name = core.getInput('name', { required: true });
|
||||||
const signingKey = core.getInput('signingKey', { required: true });
|
const signingKey = core.getInput('signingKey', { required: true });
|
||||||
const authToken = core.getInput('authToken');
|
const authToken = core.getInput('authToken');
|
||||||
core.startGroup('Installing Cachix');
|
core.startGroup('Installing Cachix');
|
||||||
|
|
@ -36,8 +36,8 @@ function run() {
|
||||||
if (authToken !== "") {
|
if (authToken !== "") {
|
||||||
yield exec.exec('cachix', ['authtoken', authToken]);
|
yield exec.exec('cachix', ['authtoken', authToken]);
|
||||||
}
|
}
|
||||||
core.startGroup(`Cachix: using ` + push);
|
core.startGroup(`Cachix: using ` + name);
|
||||||
yield exec.exec('cachix', ['use', push]);
|
yield exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey);
|
||||||
// TODO: cachix use --watch-store
|
// TODO: cachix use --watch-store
|
||||||
|
|
@ -53,8 +53,8 @@ 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 ` + push);
|
core.startGroup(`Cachix: pushing to ` + name);
|
||||||
yield exec.exec('cachix', ['push', push].concat(strings_1.nonEmptySplit(paths, /\s/).join(' ')));
|
yield exec.exec('cachix', ['push', name].concat(strings_1.nonEmptySplit(paths, /\s/).join(' ')));
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
|
|
||||||
10
src/main.ts
10
src/main.ts
|
|
@ -7,7 +7,7 @@ async function run() {
|
||||||
// inputs
|
// inputs
|
||||||
const file = core.getInput('file');
|
const file = core.getInput('file');
|
||||||
const attributes = core.getInput('attributes');
|
const attributes = core.getInput('attributes');
|
||||||
const push = core.getInput('push', { required: true });
|
const name = core.getInput('name', { required: true });
|
||||||
const signingKey = core.getInput('signingKey', { required: true });
|
const signingKey = core.getInput('signingKey', { required: true });
|
||||||
const authToken = core.getInput('authToken')
|
const authToken = core.getInput('authToken')
|
||||||
|
|
||||||
|
|
@ -21,8 +21,8 @@ async function run() {
|
||||||
await exec.exec('cachix', ['authtoken', authToken]);
|
await exec.exec('cachix', ['authtoken', authToken]);
|
||||||
}
|
}
|
||||||
|
|
||||||
core.startGroup(`Cachix: using ` + push);
|
core.startGroup(`Cachix: using ` + name);
|
||||||
await exec.exec('cachix', ['use', push]);
|
await exec.exec('cachix', ['use', name]);
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
core.exportVariable('CACHIX_SIGNING_KEY', signingKey)
|
core.exportVariable('CACHIX_SIGNING_KEY', signingKey)
|
||||||
|
|
@ -41,8 +41,8 @@ async function run() {
|
||||||
await exec.exec('nix-build', args, options);
|
await exec.exec('nix-build', args, options);
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
|
|
||||||
core.startGroup(`Cachix: pushing to ` + push);
|
core.startGroup(`Cachix: pushing to ` + name);
|
||||||
await exec.exec('cachix', ['push', push].concat(nonEmptySplit(paths, /\s/).join(' ')));
|
await exec.exec('cachix', ['push', name].concat(nonEmptySplit(paths, /\s/).join(' ')));
|
||||||
core.endGroup()
|
core.endGroup()
|
||||||
} 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