From db822e98139b5e266fa4a001a21ddbfcc454aaf4 Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Tue, 16 Jan 2024 22:48:48 +0900 Subject: [PATCH] Add reusable workflows --- .github/dependabot.yaml | 7 +++++++ .github/workflows/flake-check.yaml | 6 ++++++ .github/workflows/generate-mrpack.yaml | 2 +- .github/workflows/update-flake-lock.yaml | 11 +++++++++++ dev/flake.nix | 10 ++-------- flake.nix | 1 + 6 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 .github/dependabot.yaml create mode 100644 .github/workflows/flake-check.yaml create mode 100644 .github/workflows/update-flake-lock.yaml diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..23c4cb3 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/flake-check.yaml b/.github/workflows/flake-check.yaml new file mode 100644 index 0000000..a2c4fc3 --- /dev/null +++ b/.github/workflows/flake-check.yaml @@ -0,0 +1,6 @@ +name: Nix Flake Check +on: push + +jobs: + nix-flake-check: + uses: pedorich-n/github-workflows/.github/workflows/flake-check.yaml@main diff --git a/.github/workflows/generate-mrpack.yaml b/.github/workflows/generate-mrpack.yaml index 6edb129..39c9dfb 100644 --- a/.github/workflows/generate-mrpack.yaml +++ b/.github/workflows/generate-mrpack.yaml @@ -13,7 +13,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v23 + uses: cachix/install-nix-action@v25 - name: Create mrpack run: | OUTPUT_PATH=$(nix build .#modrinth-pack --print-out-paths) diff --git a/.github/workflows/update-flake-lock.yaml b/.github/workflows/update-flake-lock.yaml new file mode 100644 index 0000000..8c18efc --- /dev/null +++ b/.github/workflows/update-flake-lock.yaml @@ -0,0 +1,11 @@ +name: Update flake.lock +on: + workflow_dispatch: # allows manual triggering + schedule: + - cron: "0 10 1,14 * *" + +jobs: + update-flake-lock: + uses: pedorich-n/github-workflows/.github/workflows/update-flake-lock.yaml@main + secrets: + gh_access_token: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/dev/flake.nix b/dev/flake.nix index d1699be..cafcfea 100644 --- a/dev/flake.nix +++ b/dev/flake.nix @@ -22,7 +22,8 @@ }; }; }; - outputs = inputs@{ flake-parts, systems, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ moduleWithSystem, ... }: { + + outputs = inputs@{ flake-parts, systems, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ systems = import systems; perSystem = { system, pkgs, ... }: { @@ -42,13 +43,6 @@ poetry ]; }; - - builder = pkgs.mkShell { - packages = with pkgs; [ - yq-go - packwiz - ]; - }; }; }; }); diff --git a/flake.nix b/flake.nix index 4e8e3f9..7933a25 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; }; + outputs = inputs@{ flake-parts, systems, packwiz2nix, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ moduleWithSystem, ... }: { systems = import systems;