Compare commits

...

10 commits
v0.2 ... main

Author SHA1 Message Date
6544c41112
ci: run on nix-flakes 2024-09-01 16:42:16 +02:00
80432ea2ff
add dist script 2024-09-01 16:41:09 +02:00
31f177f66d
remove release 2024-09-01 16:37:54 +02:00
81793b07ae
ci: fix action url 2024-09-01 13:51:21 +02:00
5121b742ce
add return code info 2024-09-01 13:48:51 +02:00
fe7e4e104a
ci: install docker explicitly 2024-09-01 11:18:18 +02:00
54b0d06fc7
ci: use forgejo workflows 2024-09-01 10:35:03 +02:00
Paul Zinselmeyer
5619ef4781
feat: skip installation of attic when installed () 2024-05-25 08:29:36 +00:00
dependabot[bot]
37f74ba5fa
chore(deps): bump pnpm/action-setup from 2 to 3 ()
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 ()
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
7 changed files with 46 additions and 82 deletions
.forgejo/workflows
.github
dist
src

View file

@ -0,0 +1,25 @@
name: "Test"
on:
push:
branches: ["main"]
workflow_call:
workflow_dispatch:
jobs:
test-cache:
runs-on: nix-flakes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Attic Cache
uses: ./
with:
endpoint: ${{ vars.ATTIC_ENDPOINT }}
cache: ${{ vars.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: Build Nix Package
run: nix-build test.nix

View file

@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

View file

@ -1,31 +0,0 @@
name: Release
on:
release:
types: [published, edited]
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Build
run: pnpm install && pnpm build
- uses: JasonEtco/build-and-tag-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}

View file

@ -1,41 +0,0 @@
name: "Test"
on:
push:
branches: ["main"]
workflow_call:
workflow_dispatch:
jobs:
test-cache:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Build
run: pnpm install && pnpm build
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v7
- name: Setup Attic Cache
uses: ./
with:
endpoint: ${{ secrets.ATTIC_ENDPOINT }}
cache: ${{ secrets.ATTIC_CACHE }}
token: ${{ secrets.ATTIC_TOKEN }}
- name: Build Nix Package
run: nix-build test.nix

8
dist/index.js vendored Normal file

File diff suppressed because one or more lines are too long

View file

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

View file

@ -33,3 +33,9 @@ export const install = async () => {
core.endGroup();
};
export const isInstalled = async () => {
let return_code = await exec("attic", ["-V"]);
core.info(`Attic command returned code ${return_code}`);
return return_code === 0;
};