From 9400db5a9ce99abe2fdc29e0fa15f71bc84c577d Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Sun, 25 Feb 2024 13:58:26 +0000 Subject: [PATCH] feat(ci): use nix to build extension zip --- .forgejo/workflows/build-ext.yml | 4 ++-- flake.nix | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build-ext.yml b/.forgejo/workflows/build-ext.yml index 5180641..304c554 100644 --- a/.forgejo/workflows/build-ext.yml +++ b/.forgejo/workflows/build-ext.yml @@ -15,9 +15,9 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Build extension - run: ./build-ext.sh + run: nix build .#extension - name: Upload extension uses: actions/upload-artifact@v4 with: name: aci-ext.zip - path: aci-ext.zip + path: result diff --git a/flake.nix b/flake.nix index d338329..54f9df8 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,18 @@ WorkingDir = "/state"; }; }; + + extension = pkgs.stdenv.mkDerivation { + name = "aci-extension.zip"; + inherit version; + src = ./extension; + phases = "installPhase"; + nativeBuildInputs = [ pkgs.zip ]; + installPhase = '' + cd $src/ + zip -r $out * + ''; + }; }; devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [