5 Commits

Author SHA1 Message Date
dependabot[bot]
9fe40381c3 chore(deps): bump pnpm/action-setup from 3 to 4
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 3 to 4.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v3...v4)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-27 22:32:56 +00:00
Paul Zinselmeyer
5619ef4781 feat: skip installation of attic when installed (#21) 2024-05-25 08:29:36 +00:00
dependabot[bot]
37f74ba5fa chore(deps): bump pnpm/action-setup from 2 to 3 (#19)
Bumps [pnpm/action-setup](https://github.com/pnpm/action-setup) from 2 to 3.
- [Release notes](https://github.com/pnpm/action-setup/releases)
- [Commits](https://github.com/pnpm/action-setup/compare/v2...v3)

---
updated-dependencies:
- dependency-name: pnpm/action-setup
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 03:37:47 -04:00
dependabot[bot]
6cfb1137df chore(deps): bump DeterminateSystems/nix-installer-action from 7 to 9 (#15)
Bumps [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action) from 7 to 9.
- [Release notes](https://github.com/determinatesystems/nix-installer-action/releases)
- [Commits](https://github.com/determinatesystems/nix-installer-action/compare/v7...v9)

---
updated-dependencies:
- dependency-name: DeterminateSystems/nix-installer-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 03:37:03 -04:00
Ryan
f75ac4b827 fix: support nix >= 2.19 (#18)
* fix: TypeError when pushing

* fix: compatibility with Nix 2.18
2024-01-07 22:00:22 +00:00
5 changed files with 23 additions and 7 deletions

View File

@@ -17,7 +17,7 @@ jobs:
with: with:
ref: ${{ github.event.release.tag_name }} ref: ${{ github.event.release.tag_name }}
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm

View File

@@ -18,7 +18,7 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: pnpm/action-setup@v2 - uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4
with: with:
cache: pnpm cache: pnpm
@@ -28,7 +28,7 @@ jobs:
run: pnpm install && pnpm build run: pnpm install && pnpm build
- name: Install Nix - name: Install Nix
uses: DeterminateSystems/nix-installer-action@v7 uses: DeterminateSystems/nix-installer-action@v9
- name: Setup Attic Cache - name: Setup Attic Cache
uses: ./ uses: ./

View File

@@ -1,12 +1,16 @@
import { install } from "./stages/install"; import { install, isInstalled } from "./stages/install";
import { configure } from "./stages/configure"; import { configure } from "./stages/configure";
import { push } from "./stages/push"; import { push } from "./stages/push";
import { getState, saveState } from "@actions/core"; import { getState, saveState, info } from "@actions/core";
const isPost = !!getState("isPost"); const isPost = !!getState("isPost");
const main = async () => { const main = async () => {
if (await isInstalled()) {
info("Skipping attic installation because it is already installed");
} else {
await install(); await install();
}
await configure(); await configure();
}; };

View File

@@ -33,3 +33,8 @@ export const install = async () => {
core.endGroup(); core.endGroup();
}; };
export const isInstalled = async () => {
let return_code = await exec("attic", ["-V"]);
return return_code === 0;
};

View File

@@ -6,5 +6,12 @@ export const saveStorePaths = async () => {
await exec("sh", ["-c", "nix path-info --all --json > /tmp/store-paths"]); await exec("sh", ["-c", "nix path-info --all --json > /tmp/store-paths"]);
}; };
export const getStorePaths = async () => { export const getStorePaths = async () => {
return (JSON.parse(await readFile("/tmp/store-paths", "utf8")) as { path: string }[]).map((path) => path.path); const rawStorePaths = JSON.parse(await readFile("/tmp/store-paths", "utf8")) as { path: string }[];
// compatibility with Nix 2.18
if (Array.isArray(rawStorePaths)) {
return rawStorePaths.map((path) => path.path);
};
return Object.keys(rawStorePaths);
}; };